Dnn.Modules.Vendors.Components.AffiliateController.DeleteAffiliate C# (CSharp) Method

DeleteAffiliate() public method

public DeleteAffiliate ( int affiliateId ) : void
affiliateId int
return void
        public void DeleteAffiliate(int affiliateId)
        {
            _dataService.DeleteAffiliate(affiliateId);
        }

Usage Example

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// cmdDelete_Click runs when the Delete Button is clicked
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	9/21/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void OnDeleteClick(object sender, EventArgs e)
        {
            if (AffiliateId != -1)
            {
                var objAffiliates = new AffiliateController();
                objAffiliates.DeleteAffiliate(AffiliateId);

                //Redirect back to the portal home page
                Response.Redirect(EditUrl("VendorId", VendorId.ToString()), true);
            }
        }