public void UpdateAffiliate(AffiliateInfo affiliate) { _dataService.UpdateAffiliate(affiliate.AffiliateId, affiliate.StartDate, affiliate.EndDate, affiliate.CPC, affiliate.CPA); }
public void AddAffiliate(AffiliateInfo affiliate) { _dataService.AddAffiliate(affiliate.VendorId, affiliate.StartDate, affiliate.EndDate, affiliate.CPC, affiliate.CPA); }
/// ----------------------------------------------------------------------------- /// <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); } }