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());
            }
        }
示例#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;
     }
 }
 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;
     }
 }
示例#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;
         }
     }
 }
示例#7
0
        public static void SavePreference(DateTime pathorderDate, string currencyName, bool includeShippingTax, int orderProcess, bool geoTarget, bool paymentGateway, bool fullFillmentHouse, string title, string imagePath, int days, string siteName, string siteUrl)
        {
            using (CSCommerceDataContext context = new CSCommerceDataContext(ConfigHelper.GetDBConnection()))
            {
                SitePref Item = context.SitePrefs.First();
                if (Item != null)
                {
                    Item.PathOrderDate           = pathorderDate;
                    Item.Currency                = currencyName;
                    Item.OrderTotalShipping      = includeShippingTax;
                    Item.OrderProcessType        = orderProcess;
                    Item.ArchiveData             = days;
                    Item.GeoTargetService        = geoTarget;
                    Item.PaymentGatewayService   = paymentGateway;
                    Item.FulfillmentHouseService = fullFillmentHouse;
                    Item.SiteHeader              = title;
                    Item.LogoPath                = imagePath;
                    Item.SiteName                = siteName;
                    Item.SiteUrl = siteUrl;
                    context.SubmitChanges();
                }
                else
                {
                    SitePref item = new SitePref
                    {
                        PathOrderDate         = pathorderDate,
                        Currency              = currencyName,
                        OrderTotalShipping    = includeShippingTax,
                        OrderProcessType      = orderProcess,
                        GeoTargetService      = geoTarget,
                        PaymentGatewayService = paymentGateway,
                        SiteHeader            = title,
                        LogoPath              = imagePath,
                        ArchiveData           = days,
                        SiteName              = siteName,
                        SiteUrl = siteUrl
                    };

                    context.SitePrefs.InsertOnSubmit(item);
                    context.SubmitChanges();
                }
            }
        }
        //This will return site level shipping preference
        public static SitePreference GetCartPrefrence()
        {
            SitePreference prefObject = new SitePreference();

            //Site Level Settings
            SitePref item = CSFactory.GetSitePreference();

            prefObject.PrefID = item.PrefId;
            prefObject.IncludeShippingCostInTaxCalculation = item.OrderTotalShipping;
            prefObject.OrderProcessType   = (OrderProcessTypeEnum)item.OrderProcessType;
            prefObject.GeoLocationService = item.GeoTargetService;
            prefObject.VersionItems       = GetAllVersion();
            prefObject.CouponItems        = GetAllCoupon();

            prefObject.LoadAttributeValues();

            //Shipping Preferences
            ShippingPref val = ShippingDAL.GetShippingPref().Where(p => p.PrefId == 1).First();

            prefObject.ShippingPrefID     = val.PrefId;
            prefObject.RushShippingPrefID = val.PrefId;

            prefObject.ShippingOptionId = (ShippingOptionType)val.OptionId;
            if (val.RushOptionId.HasValue)
            {
                prefObject.RushShippingOptionID = (ShippingOptionType)val.RushOptionId.Value;
            }
            else
            {
                prefObject.RushShippingOptionID = prefObject.ShippingOptionId;
            }

            prefObject.IncludeRushShipping = val.InCludeRushShipping;
            prefObject.RushShippingCost    = val.RushShippingCost;
            prefObject.FlatShippingCost    = val.flatShipping;

            //Default Settings
            prefObject.PaymentGatewayService   = item.PaymentGatewayService;
            prefObject.FulfillmentHouseService = item.FulfillmentHouseService;

            return(prefObject);
        }
示例#9
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;
         }
     }
 }