Esempio n. 1
0
        private void GetModel()
        {
            ShowShop.BLL.SystemInfo.CustomerSetting bll = new ShowShop.BLL.SystemInfo.CustomerSetting();
            Model.SystemInfo.CustomerSetting model = bll.GetModel();
            if (model != null)
            {
                this.txtId.Value = model.SID.ToString();
                this.ckbAllowRegister.Text = model.AllowRegister;
                this.ckbSameEmailRegister.Text = model.SameEmailRegister.ToString();
                this.ckbAdminValidate.Text = model.AdminValidate.ToString();
                this.ckbEmailValidate.Text = model.EmailValidate.ToString();
                this.txtEmailValidateContent.Text = model.EmailValidateContent;
                this.ckbHandselCoupons.Text = model.HandselCoupons.ToString();
                this.txtHandselCouponsNumber.Text = model.HandselCouponsNumber.ToString();
                this.txtHandselCouponsBeginTime.Text = model.HandselCouponsBeginTime.ToString();
                this.txtHandselCouponsEndTime.Text = model.HandselCouponsEndTime.ToString();
                this.txtHandselPoint.Text = model.HandselPoint;
                this.txtForbidUserId.Text = model.ForbidUserId;
                this.ckbAnswerValidate.Text = model.AnswerValidate.ToString();
                this.txtQuestionFirst.Text = model.QuestionFirst;
                this.txtAnswerFirst.Text = model.AnswerFirst;
                this.txtQuestionSecond.Text = model.QuestionSecond;
                this.txtAnswerSecond.Text = model.AnswerSecond;
                this.ddlUserDefaultGroup.SelectedValue = model.UserDefaultGroup;
                this.ckbGetPasswordMethod.Text = model.GetPasswordMethod.ToString();
                this.txtLoginPoint.Text = model.LoginPoint.ToString();
                this.ckbLoginIsNeedCheckCode.Text = model.LoginIsNeedCheckCode.ToString();
                this.ckbAllowOtherLogin.Text = model.AllowOtherLogin.ToString();
                this.txtMoneyToCoupons.Text = model.MoneyToCoupons;
                this.txtMoneyToDate.Text = model.MoneyToDate;
                this.txtPointToCoupons.Text = model.PointToCoupons;
                this.txtPointToDate.Text = model.PointToDate;
                this.txtCouponsName.Text = model.CouponsName;
                this.txtCouponsUnits.Text = model.CouponsUnits;
                foreach (ListItem item in this.ckbRegisterRequired.Items)
                {
                    if (model.RegisterRequired.IndexOf(item.Value)>=0)
                    {
                        item.Selected=true;
                    }
                }
                foreach (ListItem item in this.ckbRegisterRequiredOptional.Items)
                {
                    if (model.RegisterRequiredOptional.IndexOf(item.Value)>=0)
                    {
                        item.Selected=true;
                    }
                }

            }
            bll = null;
            model = null;
        }
Esempio n. 2
0
        public SysParameter()
        {
            int intCache = 30;//缓存时间
            string cc_WebSetting = "WebSetting";
            string cc_CustomerSetting = "CustomerSetting";
            //string cc_ThumbnailsSetting = "ThumbnailsSetting";
               // string cc_ShopSetting = "ShopSetting";

            #region 系统参数设置
            object objWebSetting=ChangeHope.Common.CacheClass.GetCache(cc_WebSetting);
            ShowShop.Model.SystemInfo.WebSetting wsmodel = null;
            if (objWebSetting != null)
            {
                wsmodel = (ShowShop.Model.SystemInfo.WebSetting)objWebSetting;
            }
            else
            {
                ShowShop.BLL.SystemInfo.WebSetting wsbll = new ShowShop.BLL.SystemInfo.WebSetting();
                wsmodel = wsbll.GetModel();
                ChangeHope.Common.CacheClass.SetCache(cc_WebSetting, wsmodel, DateTime.Now.AddMinutes(intCache), TimeSpan.Zero);
            }
            if (wsmodel != null)
            {
                imageSize = wsmodel.Filesize;
                _isopensite = wsmodel.CloseWebSite == 1 ? true : false;
                _isopenshops = wsmodel.CloseShop == 1 ? true : false;
                _isopenbbs = wsmodel.CloseBBS == 1 ? true : false;
                _sitehttp = wsmodel.WebSiteDomain;
                _dummypath = wsmodel.WebSitePath;
                _websitename = wsmodel.WebSiteName;
                _websitetitle = wsmodel.WebSiteTitle;
                _websitedescription = wsmodel.MeteInfo;
                _websitekey = wsmodel.MeteKey;
                _websitetemplatepath = wsmodel.TmplatePath;
                _websitelogo = wsmodel.LogoPath;
                _websitebanner = wsmodel.BannerPath;
                _isrewrite = wsmodel.PublicMethod == 0 ? true : false;
                _staticpagefiletype = wsmodel.StaticPageFileType;
                _isclosestation = wsmodel.CloseStation == 1 ? true : false;
                _sitetel = wsmodel.Tel;
                _sitefax = wsmodel.Fax;
                _siteemail = wsmodel.Email;
                _copyright = wsmodel.CopyRight;
                _issession = wsmodel.LoginMothod == 0 ? true : false;
                _colecsitedescription = wsmodel.CloseWebSiteInfo;
                _statisticalCode = wsmodel.Statisticscode;
            }

            #endregion

            #region 用户参数设置
            object objCustomerSetting = ChangeHope.Common.CacheClass.GetCache(cc_CustomerSetting);
            ShowShop.Model.SystemInfo.CustomerSetting csmodel = null;
            if (objCustomerSetting != null)
            {
                csmodel = (ShowShop.Model.SystemInfo.CustomerSetting)objCustomerSetting;
            }
            else
            {
                ShowShop.BLL.SystemInfo.CustomerSetting csbll = new ShowShop.BLL.SystemInfo.CustomerSetting();
                csmodel = csbll.GetModel();
                ChangeHope.Common.CacheClass.SetCache(cc_CustomerSetting, csmodel, DateTime.Now.AddMinutes(intCache), TimeSpan.Zero);
            }
            if (csmodel != null)
            {
                _isregistered = csmodel.AllowRegister.Trim() == "1" ? true : false;
                _sameemailregister = csmodel.SameEmailRegister == 1 ? true : false;
                _adminvalidate = csmodel.AdminValidate == 1 ? true : false;
                _emailvalidate = csmodel.EmailValidate == 1 ? true : false;
                _emailvalidatecontent = csmodel.EmailValidateContent.Trim();
                _handselcoupons = csmodel.HandselCoupons == 1 ? true : false;
                _handselcouponsnumber = Convert.ToInt32(csmodel.HandselCouponsNumber);
                _handselcouponsbegintime = Convert.ToDateTime(csmodel.HandselCouponsBeginTime);
                _handselcouponsendtime = Convert.ToDateTime(csmodel.HandselCouponsEndTime);
                _handselpoint = csmodel.HandselPoint;
                _forbiduserid = csmodel.ForbidUserId;
                _userdefaultgroup = csmodel.UserDefaultGroup;
                _loginpoint = Convert.ToDecimal(csmodel.LoginPoint);
                _isloginvalidate = csmodel.LoginIsNeedCheckCode == 1 ? true : false;
                _ismultilogin = csmodel.AllowOtherLogin == 1 ? true : false;
            }
            #endregion

            #region 缩略图参数设置
            //object objThumbnailsSetting = ChangeHope.Common.CacheClass.GetCache(cc_ThumbnailsSetting);
            //ShowShop.Model.SystemInfo.ThumbnailsSetting tsmodel = null;
            //if (objThumbnailsSetting != null)
            //{
            //    tsmodel = (ShowShop.Model.SystemInfo.ThumbnailsSetting)objThumbnailsSetting;
            //}
            //else
            //{
            //    ShowShop.BLL.SystemInfo.ThumbnailsSetting tsbll = new ShowShop.BLL.SystemInfo.ThumbnailsSetting();
            //    tsmodel = tsbll.GetModel();
            //    ChangeHope.Common.CacheClass.SetCache(cc_ThumbnailsSetting, tsmodel, DateTime.Now.AddMinutes(intCache), TimeSpan.Zero);
            //}

            //if (tsmodel != null)
            //{
            //    _thumbnailsheight = Convert.ToInt32(tsmodel.ThumbnailsHeight);
            //    _thumbnailswidth =  Convert.ToInt32(tsmodel.ThumbnailsWidth);
            //    _imagesthumbnailsheight =  Convert.ToInt32(tsmodel.ImageHeight);
            //    _imagesthumbnailswidth = Convert.ToInt32(tsmodel.ImageWidth);
            //    _imagewatermarktransparent =  Convert.ToInt32(tsmodel.ImgTransparent) ;
            //    _textwatermarktransparent = Convert.ToInt32(tsmodel.CharTransparent);
            //    _watermarktext = tsmodel.Characters;
            //    _watermarkimage = tsmodel.WatermarkPicturePath;
            //    _watermarkposition = tsmodel.WatermarkPosition;
            //    _textorimageswatermark = tsmodel.Type;
            //}
            #endregion

            #region 商铺参数设置
            //object objShopSetting = ChangeHope.Common.CacheClass.GetCache(cc_ShopSetting);
            //ShowShop.Model.SystemInfo.ShopSetting ssmodel = null;
            //if (objShopSetting != null)
            //{
            //    ssmodel = (ShowShop.Model.SystemInfo.ShopSetting)objShopSetting;
            //}
            //else
            //{
            //    ShowShop.BLL.SystemInfo.ShopSetting ssbll = new ShowShop.BLL.SystemInfo.ShopSetting();
            //    ssmodel = ssbll.GetModel();
            //    ChangeHope.Common.CacheClass.SetCache(cc_ShopSetting, ssmodel, DateTime.Now.AddMinutes(intCache), TimeSpan.Zero);
            //}
            //if (ssmodel != null)
            //{
            //    _isthumbnails = ssmodel.Thumbnails == 1 ? true : false;
            //    _iswatermark = ssmodel.WaterMark == 1 ? true : false;
            //    _allowgroupbuydeposit = ssmodel.AllowGroupbuyDeposit == 1 ? true : false;
            //    _allowauctiondeposit = ssmodel.AllowAuctionDeposit == 1 ? true : false;
            //    _ispaymentweboperation = ssmodel.OrdersReceive == 1 ? true : false;
            //    _ordersText = ssmodel.OrdersText;
            //}
            #endregion
        }