protected void Page_Load(object sender, EventArgs e)
        {
            lblSuccess.Text = ResourceHelper.GetResoureValue("LabelSuccess");
            lblCancel.Text  = ResourceHelper.GetResoureValue("LabelCancel");

            if (!Page.IsPostBack)
            {
                SitePref item = CSFactory.GetSitePreference();
                if (item.PathOrderDate.Value.Year != 2079)
                {
                    dateControlStart.ValueLocal = item.PathOrderDate;
                }
                tblCurrency.Text           = item.Currency;
                CbShippingOption.Checked   = item.OrderTotalShipping;
                cbGeoTarget.Checked        = item.GeoTargetService;
                txtDays.Text               = item.ArchiveData.ToString();
                txtTitle.Text              = item.SiteHeader;
                txtImagePath.Text          = item.LogoPath;
                txtSiteName.Text           = item.SiteName;
                txtSiteUrl.Text            = item.SiteUrl;
                cbPaymentGateway.Checked   = item.PaymentGatewayService;
                cbFulfillmentHouse.Checked = item.FulfillmentHouseService;
                BindOrderProcess(item.OrderProcessType);
                ucAttributes.Populate(CSFactory.GetCacheSitePref());
            }
        }
Exemplo n.º 2
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                base.Page_Load(sender, e);

                if (Request.Headers["X-HTTPS"] != null)
                {
                    if (Request.Headers["X-HTTPS"].ToLower().Equals("no"))
                    {
                        if (Request.Url.ToString().Contains("www"))
                        {
                            Response.Redirect((Request.Url.ToString().Replace("http:/", "https:/").Replace("index.aspx", "")));
                        }
                        else
                        {
                            Response.Redirect((Request.Url.ToString().Replace("http:/", "https:/").Replace("https://", "https://www.").Replace("index.aspx", "")));
                        }
                    }
                }
            }

            if (!Page.IsPostBack)
            {
                SitePref PrefObject = CSFactory.GetSitePreference();
                siteTitle        = PrefObject.SiteHeader;
                siteName         = PrefObject.SiteName;
                siteUrl          = PrefObject.SiteUrl;
                imgLogo.ImageUrl = PrefObject.LogoPath;
            }
        }
        protected void btnAction_Command(object sender, CommandEventArgs e)
        {
            if (e.CommandName == "Save")
            {
                if (Page.IsValid)
                {
                    DateTime ExpireDate;
                    if (dateControlStart.ValueLocal.HasValue)
                    {
                        ExpireDate = Convert.ToDateTime(dateControlStart.ValueLocal.ToString());
                    }
                    else
                    {
                        ExpireDate = Convert.ToDateTime("1/1/2079");
                    }
                    string currency = CommonHelper.fixquotesAccents(tblCurrency.Text);

                    int days = (txtDays.Text.Length > 0) ? Convert.ToInt32(txtDays.Text) : 0;

                    CSFactory.SavePreference(ExpireDate, currency, CbShippingOption.Checked,
                                             Convert.ToInt32(ddlOrderProcessList.SelectedValue), cbGeoTarget.Checked,
                                             cbPaymentGateway.Checked, cbFulfillmentHouse.Checked, txtTitle.Text,
                                             txtImagePath.Text, days, txtSiteName.Text, txtSiteUrl.Text);

                    SitePreference sitePreference = CSFactory.GetCacheSitePref();

                    ucAttributes.SaveAllEnteredAttributeValues(sitePreference.ObjectName, sitePreference.ItemId);
                }
                lblSuccess.Visible = true;
                lblCancel.Visible  = false;
            }
            else
            {
                SitePref item = CSFactory.GetSitePreference();
                if (item.PathOrderDate.Value.Year != 2079)
                {
                    dateControlStart.ValueLocal = item.PathOrderDate;
                }
                tblCurrency.Text           = item.Currency;
                CbShippingOption.Checked   = item.OrderTotalShipping;
                cbGeoTarget.Checked        = item.GeoTargetService;
                txtDays.Text               = item.ArchiveData.ToString();
                txtTitle.Text              = item.SiteHeader;
                txtImagePath.Text          = item.LogoPath;
                txtSiteName.Text           = item.SiteName;
                txtSiteUrl.Text            = item.SiteUrl;
                cbPaymentGateway.Checked   = item.PaymentGatewayService;
                cbFulfillmentHouse.Checked = item.FulfillmentHouseService;
                BindOrderProcess(item.OrderProcessType);
                ucAttributes.Populate(CSFactory.GetCacheSitePref());
                lblCancel.Visible  = true;
                lblSuccess.Visible = false;
            }



            //Response.Redirect("Main.aspx");
        }
 public void BindSettings()
 {
     if (!Page.IsPostBack)
     {
         SitePref PrefObject = CSFactory.GetSitePreference();
         siteTitle        = PrefObject.SiteHeader;
         siteName         = PrefObject.SiteName;
         siteUrl          = PrefObject.SiteUrl;
         imgLogo.ImageUrl = PrefObject.LogoPath;
     }
 }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         SitePref PrefObject = CSFactory.GetSitePreference();
         siteTitle        = PrefObject.SiteHeader;
         siteName         = PrefObject.SiteName;
         siteUrl          = PrefObject.SiteUrl;
         imgLogo.ImageUrl = PrefObject.LogoPath;
     }
 }
Exemplo n.º 6
0
 public void BindSettings()
 {
     if (!Page.IsPostBack)
     {
         SitePref PrefObject = CSFactory.GetSitePreference();
         imgLogo.ImageUrl = PrefObject.LogoPath;
         SitePreference sitePreference = CSFactory.GetCacheSitePref();
         sitePreference.LoadAttributeValues();
         if (sitePreference.AttributeValues["hitslinkusername"] != null)
         {
             hitsLinkUserName = sitePreference.AttributeValues["hitslinkusername"].Value;
         }
         if (sitePreference.AttributeValues["hitslinkpassword"] != null)
         {
             hitsLinkPassword = sitePreference.AttributeValues["hitslinkpassword"].Value;
         }
     }
 }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         SitePref PrefObject = CSFactory.GetSitePreference();
         siteTitle        = PrefObject.SiteHeader;
         siteName         = PrefObject.SiteName;
         siteUrl          = PrefObject.SiteUrl;
         imgLogo.ImageUrl = PrefObject.LogoPath;
     }
     if (Request.Cookies["CSVal"] != null)
     {
         HttpCookie cookie     = Request.Cookies["CSVal"];
         int        userTypeId = Convert.ToInt32(cookie.Value);
         if (userTypeId == 4)
         {
             plLeftNav.Visible = true;
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         liHeader.Text    = DateTime.Now.ToString("MMMM") + " " + DateTime.Now.Day.ToString() + ", " + DateTime.Now.Year.ToString();
         liSubHeader.Text = DateTime.Now.DayOfWeek + " " + DateTime.Now.ToShortTimeString() + " (PST)";
         SitePref PrefObject = CSFactory.GetSitePreference();
         siteTitle        = PrefObject.SiteHeader;
         siteName         = PrefObject.SiteName;
         siteUrl          = PrefObject.SiteUrl;
         imgLogo.ImageUrl = PrefObject.LogoPath;
     }
     if (Request.Cookies["CSVal"] != null)
     {
         HttpCookie cookie     = Request.Cookies["CSVal"];
         int        userTypeId = Convert.ToInt32(cookie.Value);
         if (userTypeId == 4)
         {
             //plLeftNav.Visible = true;
         }
     }
 }