コード例 #1
0
ファイル: SetController.cs プロジェクト: hzl091/BrnShop
        public ActionResult Mall(MallModel model)
        {
            if (ModelState.IsValid)
            {
                MallConfigInfo mallConfigInfo = BMAConfig.MallConfig;

                mallConfigInfo.IsGuestSC            = model.IsGuestSC;
                mallConfigInfo.SCSubmitType         = model.SCSubmitType;
                mallConfigInfo.GuestSCCount         = model.GuestSCCount;
                mallConfigInfo.MemberSCCount        = model.MemberSCCount;
                mallConfigInfo.SCExpire             = model.SCExpire;
                mallConfigInfo.OSNFormat            = model.OSNFormat;
                mallConfigInfo.OnlinePayExpire      = model.OnlinePayExpire;
                mallConfigInfo.ReceiveExpire        = model.ReceiveExpire;
                mallConfigInfo.BroHisCount          = model.BroHisCount;
                mallConfigInfo.MaxShipAddress       = model.MaxShipAddress;
                mallConfigInfo.FavoriteProductCount = model.FavoriteProductCount;
                mallConfigInfo.FavoriteStoreCount   = model.FavoriteStoreCount;

                BMAConfig.SaveMallConfig(mallConfigInfo);
                Emails.ResetMall();
                SMSes.ResetMall();
                AddMallAdminLog("修改商城设置");
                return(PromptView(Url.Action("mall"), "修改商城设置成功"));
            }
            return(View(model));
        }
コード例 #2
0
ファイル: SetController.cs プロジェクト: hzl091/BrnShop
        public ActionResult Access(AccessModel model)
        {
            if (ModelState.IsValid)
            {
                MallConfigInfo mallConfigInfo = BMAConfig.MallConfig;

                mallConfigInfo.IsClosed           = model.IsClosed;
                mallConfigInfo.CloseReason        = model.CloseReason == null ? "" : model.CloseReason;
                mallConfigInfo.BanAccessTime      = model.BanAccessTime == null ? "" : model.BanAccessTime;
                mallConfigInfo.BanAccessIP        = model.BanAccessIP == null ? "" : model.BanAccessIP;
                mallConfigInfo.AllowAccessIP      = model.AllowAccessIP == null ? "" : model.AllowAccessIP;
                mallConfigInfo.AdminAllowAccessIP = model.AdminAllowAccessIP == null ? "" : model.AdminAllowAccessIP;
                mallConfigInfo.SecretKey          = model.SecretKey;
                mallConfigInfo.CookieDomain       = model.CookieDomain == null ? "" : model.CookieDomain.Trim('.');
                mallConfigInfo.RandomLibrary      = model.RandomLibrary == null ? "" : model.RandomLibrary;
                mallConfigInfo.VerifyPages        = CommonHelper.StringArrayToString(model.VerifyPages);
                mallConfigInfo.IgnoreWords        = model.IgnoreWords == null ? "" : model.IgnoreWords;
                mallConfigInfo.AllowEmailProvider = model.AllowEmailProvider == null ? "" : model.AllowEmailProvider;
                mallConfigInfo.BanEmailProvider   = model.BanEmailProvider == null ? "" : model.BanEmailProvider;

                BMAConfig.SaveMallConfig(mallConfigInfo);
                Emails.ResetMall();
                SMSes.ResetMall();
                Randoms.ResetRandomLibrary();
                FilterWords.ResetIgnoreWordsRegex();
                AddMallAdminLog("修改访问控制");
                return(PromptView(Url.Action("access"), "修改访问控制成功"));
            }

            ViewData["verifyPages"] = CommonHelper.StringArrayToString(model.VerifyPages);
            return(View(model));
        }
コード例 #3
0
ファイル: SetController.cs プロジェクト: hzl091/BrnShop
        public ActionResult Credit(CreditModel model)
        {
            if (ModelState.IsValid)
            {
                CreditConfigInfo creditConfigInfo = BMAConfig.CreditConfig;

                creditConfigInfo.PayCreditName              = model.PayCreditName;
                creditConfigInfo.PayCreditPrice             = model.PayCreditPrice;
                creditConfigInfo.DayMaxSendPayCredits       = model.DayMaxSendPayCredits;
                creditConfigInfo.OrderMaxUsePayCredits      = model.OrderMaxUsePayCredits;
                creditConfigInfo.RegisterPayCredits         = model.RegisterPayCredits;
                creditConfigInfo.LoginPayCredits            = model.LoginPayCredits;
                creditConfigInfo.VerifyEmailPayCredits      = model.VerifyEmailPayCredits;
                creditConfigInfo.VerifyMobilePayCredits     = model.VerifyMobilePayCredits;
                creditConfigInfo.CompleteUserInfoPayCredits = model.CompleteUserInfoPayCredits;
                creditConfigInfo.ReceiveOrderPayCredits     = model.ReceiveOrderPayCredits;
                creditConfigInfo.ReviewProductPayCredits    = model.ReviewProductPayCredits;

                creditConfigInfo.RankCreditName              = model.RankCreditName;
                creditConfigInfo.DayMaxSendRankCredits       = model.DayMaxSendRankCredits;
                creditConfigInfo.RegisterRankCredits         = model.RegisterRankCredits;
                creditConfigInfo.LoginRankCredits            = model.LoginRankCredits;
                creditConfigInfo.VerifyEmailRankCredits      = model.VerifyEmailRankCredits;
                creditConfigInfo.VerifyMobileRankCredits     = model.VerifyMobileRankCredits;
                creditConfigInfo.CompleteUserInfoRankCredits = model.CompleteUserInfoRankCredits;
                creditConfigInfo.ReceiveOrderRankCredits     = model.ReceiveOrderRankCredits;
                creditConfigInfo.ReviewProductRankCredits    = model.ReviewProductRankCredits;

                BMAConfig.SaveCreditConfig(creditConfigInfo);
                Credits.ResetCreditConfig();
                AddMallAdminLog("修改积分设置");
                return(PromptView(Url.Action("credit"), "修改积分设置成功"));
            }
            return(View(model));
        }
コード例 #4
0
ファイル: SetController.cs プロジェクト: hzl091/BrnShop
        public ActionResult Performance(PerformanceModel model)
        {
            if (ModelState.IsValid)
            {
                MallConfigInfo mallConfigInfo = BMAConfig.MallConfig;

                mallConfigInfo.ImageCDN             = model.ImageCDN == null ? "" : model.ImageCDN;
                mallConfigInfo.CSSCDN               = model.CSSCDN == null ? "" : model.CSSCDN;
                mallConfigInfo.ScriptCDN            = model.ScriptCDN == null ? "" : model.ScriptCDN;
                mallConfigInfo.OnlineUserExpire     = model.OnlineUserExpire;
                mallConfigInfo.UpdateOnlineTimeSpan = model.UpdateOnlineTimeSpan;
                mallConfigInfo.MaxOnlineCount       = model.MaxOnlineCount;
                mallConfigInfo.OnlineCountExpire    = model.OnlineCountExpire;
                mallConfigInfo.IsStatBrowser        = model.IsStatBrowser;
                mallConfigInfo.IsStatOS             = model.IsStatOS;
                mallConfigInfo.IsStatRegion         = model.IsStatRegion;

                BMAConfig.SaveMallConfig(mallConfigInfo);
                Emails.ResetMall();
                SMSes.ResetMall();
                AddMallAdminLog("修改性能设置");
                return(PromptView(Url.Action("performance"), "修改性能设置成功"));
            }
            return(View(model));
        }
コード例 #5
0
ファイル: SetController.cs プロジェクト: hzl091/BrnShop
        public ActionResult Upload(UploadModel model)
        {
            if (ModelState.IsValid)
            {
                UploadConfigInfo uploadConfigInfo = BMAConfig.UploadConfig;

                uploadConfigInfo.UploadImgType            = model.UploadImgType;
                uploadConfigInfo.UploadImgSize            = model.UploadImgSize * 1000;
                uploadConfigInfo.WatermarkType            = model.WatermarkType;
                uploadConfigInfo.WatermarkQuality         = model.WatermarkQuality;
                uploadConfigInfo.WatermarkPosition        = model.WatermarkPosition;
                uploadConfigInfo.WatermarkImg             = model.WatermarkImg == null ? "" : model.WatermarkImg;
                uploadConfigInfo.WatermarkImgOpacity      = model.WatermarkImgOpacity;
                uploadConfigInfo.WatermarkText            = model.WatermarkText == null ? "" : model.WatermarkText;
                uploadConfigInfo.WatermarkTextFont        = model.WatermarkTextFont;
                uploadConfigInfo.WatermarkTextSize        = model.WatermarkTextSize;
                uploadConfigInfo.BrandThumbSize           = model.BrandThumbSize;
                uploadConfigInfo.ProductShowThumbSize     = model.ProductShowThumbSize;
                uploadConfigInfo.UserAvatarThumbSize      = model.UserAvatarThumbSize;
                uploadConfigInfo.UserRankAvatarThumbSize  = model.UserRankAvatarThumbSize;
                uploadConfigInfo.StoreRankAvatarThumbSize = model.StoreRankAvatarThumbSize;
                uploadConfigInfo.StoreLogoThumbSize       = model.StoreLogoThumbSize;

                BMAConfig.SaveUploadConfig(uploadConfigInfo);
                AddMallAdminLog("修改上传设置");
                return(PromptView(Url.Action("upload"), "修改上传设置成功"));
            }

            LoadFont();
            return(View(model));
        }
コード例 #6
0
ファイル: EventController.cs プロジェクト: hzl091/BrnShop
        public ActionResult Add(EventModel model)
        {
            if (!string.IsNullOrWhiteSpace(model.Key) && BMAConfig.EventConfig.BMAEventList.Find(x => x.Key == model.Key.Trim().ToLower()) != null)
                ModelState.AddModelError("Key", "键已经存在");

            if (!string.IsNullOrWhiteSpace(model.Title) && BMAConfig.EventConfig.BMAEventList.Find(x => x.Title == model.Title.Trim().ToLower()) != null)
                ModelState.AddModelError("Title", "名称已经存在");

            if (ModelState.IsValid)
            {
                EventInfo eventInfo = new EventInfo()
                {
                    Key = model.Key.Trim().ToLower(),
                    Title = model.Title.Trim().ToLower(),
                    TimeType = model.TimeType,
                    TimeValue = model.TimeValue,
                    ClassName = model.ClassName,
                    Code = model.Code ?? "",
                    Enabled = model.Enabled
                };

                BMAConfig.EventConfig.BMAEventList.Add(eventInfo);
                BMAConfig.SaveEventConfig(BMAConfig.EventConfig);
                AddMallAdminLog("添加事件", "添加事件,事件为:" + model.Title);
                return PromptView("事件添加成功");
            }
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return View(model);
        }
コード例 #7
0
ファイル: EventController.cs プロジェクト: hzl091/BrnShop
        public ActionResult Edit(EventModel model)
        {
            EventInfo eventInfo = null;

            if (!string.IsNullOrWhiteSpace(model.Key))
                eventInfo = BMAConfig.EventConfig.BMAEventList.Find(x => x.Key == model.Key);

            if (eventInfo == null)
                return PromptView("事件不存在");

            if (!string.IsNullOrWhiteSpace(model.Title))
            {
                EventInfo temp = BMAConfig.EventConfig.BMAEventList.Find(x => x.Title == model.Title.Trim().ToLower());
                if (temp != null && temp.Key != eventInfo.Key)
                    ModelState.AddModelError("Title", "名称已经存在");
            }

            if (ModelState.IsValid)
            {
                //eventInfo.Key = model.Key.Trim().ToLower(),
                eventInfo.Title = model.Title.Trim().ToLower();
                eventInfo.TimeType = model.TimeType;
                eventInfo.TimeValue = model.TimeValue;
                eventInfo.ClassName = model.ClassName;
                eventInfo.Code = model.Code ?? "";
                eventInfo.Enabled = model.Enabled;

                BMAConfig.SaveEventConfig(BMAConfig.EventConfig);
                AddMallAdminLog("编辑事件", "编辑事件,事件为:" + model.Title);
                return PromptView("事件编辑成功");
            }
            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return View(model);
        }
コード例 #8
0
ファイル: SetController.cs プロジェクト: hzl091/BrnShop
        public ActionResult SMS(SMSModel model)
        {
            if (ModelState.IsValid)
            {
                SMSConfigInfo smsConfigInfo = BMAConfig.SMSConfig;

                smsConfigInfo.Url          = model.Url;
                smsConfigInfo.UserName     = model.UserName;
                smsConfigInfo.Password     = model.Password;
                smsConfigInfo.FindPwdBody  = model.FindPwdBody;
                smsConfigInfo.SCVerifyBody = model.SCVerifyBody;
                smsConfigInfo.SCUpdateBody = model.SCUpdateBody;
                smsConfigInfo.WebcomeBody  = model.WebcomeBody;

                BMAConfig.SaveSMSConfig(smsConfigInfo);
                SMSes.ResetSMS();
                AddMallAdminLog("修改短信设置");
                return(PromptView(Url.Action("sms"), "修改短信设置成功"));
            }
            return(View(model));
        }
コード例 #9
0
ファイル: SetController.cs プロジェクト: hzl091/BrnShop
        public ActionResult Site(SiteModel model)
        {
            if (ModelState.IsValid)
            {
                MallConfigInfo mallConfigInfo = BMAConfig.MallConfig;

                mallConfigInfo.MallName       = model.MallName == null ? "" : model.MallName;
                mallConfigInfo.SiteUrl        = model.SiteUrl == null ? "" : model.SiteUrl;
                mallConfigInfo.SiteTitle      = model.SiteTitle == null ? "" : model.SiteTitle;
                mallConfigInfo.SEOKeyword     = model.SEOKeyword == null ? "" : model.SEOKeyword;
                mallConfigInfo.SEODescription = model.SEODescription == null ? "" : model.SEODescription;
                mallConfigInfo.ICP            = model.ICP == null ? "" : model.ICP;
                mallConfigInfo.Script         = model.Script == null ? "" : model.Script;
                mallConfigInfo.IsLicensed     = model.IsLicensed;

                BMAConfig.SaveMallConfig(mallConfigInfo);
                Emails.ResetMall();
                SMSes.ResetMall();
                AddMallAdminLog("修改站点信息");
                return(PromptView(Url.Action("site"), "修改站点信息成功"));
            }
            return(View(model));
        }
コード例 #10
0
ファイル: SetController.cs プロジェクト: hzl091/BrnShop
        public ActionResult Account(AccountModel model)
        {
            if (ModelState.IsValid)
            {
                MallConfigInfo mallConfigInfo = BMAConfig.MallConfig;

                mallConfigInfo.RegType        = model.RegType == null ? "" : CommonHelper.IntArrayToString(model.RegType, "");
                mallConfigInfo.ReservedName   = model.ReservedName ?? "";
                mallConfigInfo.RegTimeSpan    = model.RegTimeSpan;
                mallConfigInfo.IsWebcomeMsg   = model.IsWebcomeMsg;
                mallConfigInfo.WebcomeMsg     = model.WebcomeMsg ?? "";
                mallConfigInfo.LoginType      = model.LoginType == null ? "" : CommonHelper.IntArrayToString(model.LoginType, "");
                mallConfigInfo.ShadowName     = model.ShadowName ?? "";
                mallConfigInfo.IsRemember     = model.IsRemember;
                mallConfigInfo.LoginFailTimes = model.LoginFailTimes;

                BMAConfig.SaveMallConfig(mallConfigInfo);
                Emails.ResetMall();
                SMSes.ResetMall();
                AddMallAdminLog("修改账号设置");
                return(PromptView(Url.Action("account"), "修改账号设置成功"));
            }
            return(View(model));
        }
コード例 #11
0
ファイル: SetController.cs プロジェクト: hzl091/BrnShop
        public ActionResult Email(EmailModel model)
        {
            if (ModelState.IsValid)
            {
                EmailConfigInfo emailConfigInfo = BMAConfig.EmailConfig;

                emailConfigInfo.Host         = model.Host;
                emailConfigInfo.Port         = model.Port;
                emailConfigInfo.From         = model.From;
                emailConfigInfo.FromName     = model.FromName;
                emailConfigInfo.UserName     = model.UserName;
                emailConfigInfo.Password     = model.Password;
                emailConfigInfo.FindPwdBody  = model.FindPwdBody;
                emailConfigInfo.SCVerifyBody = model.SCVerifyBody;
                emailConfigInfo.SCUpdateBody = model.SCUpdateBody;
                emailConfigInfo.WebcomeBody  = model.WebcomeBody;

                BMAConfig.SaveEmailConfig(emailConfigInfo);
                Emails.ResetEmail();
                AddMallAdminLog("修改邮箱设置");
                return(PromptView(Url.Action("email"), "修改邮箱设置成功"));
            }
            return(View(model));
        }