/// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]	9/21/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        /// -----------------------------------------------------------------------------
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            cmdCancel.Click += OnCancelClick;
            cmdDelete.Click += OnDeleteClick;
            cmdSend.Click   += OnSendClick;
            cmdUpdate.Click += OnUpdateClick;

            if ((Request.QueryString["VendorId"] != null))
            {
                VendorId = Int32.Parse(Request.QueryString["VendorId"]);
            }

            if ((Request.QueryString["AffilId"] != null))
            {
                AffiliateId = Int32.Parse(Request.QueryString["AffilId"]);
            }

            //this needs to execute always to the client script code is registred in InvokePopupCal
            cmdStartCalendar.NavigateUrl = Calendar.InvokePopupCal(txtStartDate);
            cmdEndCalendar.NavigateUrl   = Calendar.InvokePopupCal(txtEndDate);

            if (Page.IsPostBack == false)
            {
                var objAffiliates = new AffiliateController();
                if (AffiliateId != Null.NullInteger)
                {
                    //Obtain a single row of banner information
                    var objAffiliate = objAffiliates.GetAffiliate(AffiliateId, VendorId, PortalId);
                    if (objAffiliate != null)
                    {
                        if (!Null.IsNull(objAffiliate.StartDate))
                        {
                            txtStartDate.Text = objAffiliate.StartDate.ToShortDateString();
                        }
                        if (!Null.IsNull(objAffiliate.EndDate))
                        {
                            txtEndDate.Text = objAffiliate.EndDate.ToShortDateString();
                        }
                        txtCPC.Text = objAffiliate.CPC.ToString("#0.0####");
                        txtCPA.Text = objAffiliate.CPA.ToString("#0.0####");
                    }
                    else //security violation attempt to access item not related to this Module
                    {
                        Response.Redirect(EditUrl("VendorId", VendorId.ToString()), true);
                    }
                }
                else
                {
                    txtCPC.Text = 0.ToString("#0.0####");
                    txtCPA.Text = 0.ToString("#0.0####");

                    cmdDelete.Visible = false;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]	9/21/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        protected void Page_Load(Object sender, EventArgs e)
        {
            if ((Request.QueryString["VendorId"] != null))
            {
                VendorId = int.Parse(Request.QueryString["VendorId"]);
            }

            if ((Request.QueryString["AffilId"] != null))
            {
                AffiliateId = int.Parse(Request.QueryString["AffilId"]);
            }

            //this needs to execute always to the client script code is registred in InvokePopupCal
            cmdStartCalendar.NavigateUrl = Calendar.InvokePopupCal(txtStartDate);
            cmdEndCalendar.NavigateUrl   = Calendar.InvokePopupCal(txtEndDate);

            if (Page.IsPostBack == false)
            {
                ClientAPI.AddButtonConfirm(cmdDelete, Localization.GetString("DeleteItem"));

                AffiliateController objAffiliates = new AffiliateController();
                if (AffiliateId != Null.NullInteger)
                {
                    // Obtain a single row of banner information
                    AffiliateInfo objAffiliate = objAffiliates.GetAffiliate(AffiliateId, VendorId, PortalId);

                    if (objAffiliate != null)
                    {
                        if (!Null.IsNull(objAffiliate.StartDate))
                        {
                            txtStartDate.Text = objAffiliate.StartDate.ToShortDateString();
                        }
                        if (!Null.IsNull(objAffiliate.EndDate))
                        {
                            txtEndDate.Text = objAffiliate.EndDate.ToShortDateString();
                        }
                        txtCPC.Text = objAffiliate.CPC.ToString("#0.#####");
                        txtCPA.Text = objAffiliate.CPA.ToString("#0.#####");
                    }
                    else // security violation attempt to access item not related to this Module
                    {
                        Response.Redirect(EditUrl("VendorId", VendorId.ToString()), true);
                    }
                }
                else
                {
                    txtCPC.Text = "0.00";
                    txtCPA.Text = "0.00";

                    cmdDelete.Visible = false;
                }
            }
        }
Exemplo n.º 3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]	9/21/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        /// -----------------------------------------------------------------------------
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            cmdCancel.Click += OnCancelClick;
            cmdDelete.Click += OnDeleteClick;
            cmdSend.Click   += OnSendClick;
            cmdUpdate.Click += OnUpdateClick;

            if ((Request.QueryString["VendorId"] != null))
            {
                VendorId = Int32.Parse(Request.QueryString["VendorId"]);
            }

            if ((Request.QueryString["AffilId"] != null))
            {
                AffiliateId = Int32.Parse(Request.QueryString["AffilId"]);
            }

            if (Page.IsPostBack == false)
            {
                var affiliateController = new AffiliateController();
                if (AffiliateId != Null.NullInteger)
                {
                    //Obtain a single row of banner information
                    var affiliate = affiliateController.GetAffiliate(AffiliateId, VendorId, PortalId);
                    if (affiliate != null)
                    {
                        StartDatePicker.SelectedDate = Null.IsNull(affiliate.StartDate) ? (DateTime?)null : affiliate.StartDate;
                        EndDatePicker.SelectedDate   = Null.IsNull(affiliate.EndDate) ? (DateTime?)null : affiliate.EndDate;

                        txtCPC.Text = affiliate.CPC.ToString("#0.0####");
                        txtCPA.Text = affiliate.CPA.ToString("#0.0####");
                    }
                    else //security violation attempt to access item not related to this Module
                    {
                        Response.Redirect(EditUrl("VendorId", VendorId.ToString()), true);
                    }
                }
                else
                {
                    txtCPC.Text = 0.ToString("#0.0####");
                    txtCPA.Text = 0.ToString("#0.0####");

                    cmdDelete.Visible = false;
                }
            }
        }