/// -----------------------------------------------------------------------------
        /// <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);
            }
        }
Beispiel #2
0
 public void UpdateAffiliate(AffiliateInfo objAffiliate)
 {
     DataProvider.Instance().UpdateAffiliate(objAffiliate.AffiliateId, objAffiliate.StartDate, objAffiliate.EndDate, objAffiliate.CPC, objAffiliate.CPA);
 }
Beispiel #3
0
 public void AddAffiliate(AffiliateInfo objAffiliate)
 {
     DataProvider.Instance().AddAffiliate(objAffiliate.VendorId, objAffiliate.StartDate, objAffiliate.EndDate, objAffiliate.CPC, objAffiliate.CPA);
 }
Beispiel #4
0
 public void UpdateAffiliate(AffiliateInfo objAffiliate)
 {
     DataProvider.Instance().UpdateAffiliate(objAffiliate.AffiliateId, objAffiliate.StartDate, objAffiliate.EndDate, objAffiliate.CPC, objAffiliate.CPA);
 }
Beispiel #5
0
 public void AddAffiliate(AffiliateInfo objAffiliate)
 {
     DataProvider.Instance().AddAffiliate(objAffiliate.VendorId, objAffiliate.StartDate, objAffiliate.EndDate, objAffiliate.CPC, objAffiliate.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 cmdUpdate_Click( object sender, EventArgs e )
        {
            if( Page.IsValid )
            {
                AffiliateInfo objAffiliate = new AffiliateInfo();

                objAffiliate.AffiliateId = AffiliateId;
                objAffiliate.VendorId = VendorId;
                if( !String.IsNullOrEmpty(txtStartDate.Text) )
                {
                    objAffiliate.StartDate = DateTime.Parse( txtStartDate.Text );
                }
                else
                {
                    objAffiliate.StartDate = Null.NullDate;
                }
                if( !String.IsNullOrEmpty(txtEndDate.Text) )
                {
                    objAffiliate.EndDate = DateTime.Parse( txtEndDate.Text );
                }
                else
                {
                    objAffiliate.EndDate = Null.NullDate;
                }
                objAffiliate.CPC = double.Parse( txtCPC.Text );
                objAffiliate.CPA = double.Parse( txtCPA.Text );

                AffiliateController 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 );
            }
        }