UpdateAffiliate() public method

public UpdateAffiliate ( AffiliateInfo affiliate ) : void
affiliate AffiliateInfo
return void
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// cmdUpdate_Click runs when the Update 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 OnUpdateClick(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                var objAffiliate = new AffiliateInfo
                                       {
                                           AffiliateId = AffiliateId,
                                           VendorId = VendorId,
                                           StartDate =  StartDatePicker.SelectedDate.HasValue ? StartDatePicker.SelectedDate.Value : Null.NullDate,
                                           EndDate = EndDatePicker.SelectedDate.HasValue ? EndDatePicker.SelectedDate.Value : Null.NullDate,
                                           CPC = double.Parse(txtCPC.Text),
                                           CPA = double.Parse(txtCPA.Text)
                                       };
                var objAffiliates = new AffiliateController();

                if (AffiliateId == -1)
                {
                    objAffiliates.AddAffiliate(objAffiliate);
                }
                else
                {
                    objAffiliates.UpdateAffiliate(objAffiliate);
                }
				
                //Redirect back to the portal home page
                Response.Redirect(EditUrl("VendorId", VendorId.ToString()), true);
            }
        }