Example #1
0
        public ActionResult Performance(PerformanceModel model)
        {
            if (ModelState.IsValid)
            {
                ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

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

                BSPConfig.SaveShopConfig(shopConfigInfo);
                Emails.ResetShop();
                SMSes.ResetShop();
                AddAdminOperateLog("修改性能设置");
                return(PromptView(Url.Action("performance"), "修改性能设置成功"));
            }
            return(View(model));
        }
Example #2
0
        public ActionResult Shop(ShopModel model)
        {
            if (ModelState.IsValid)
            {
                ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

                shopConfigInfo.IsGuestSC        = model.IsGuestSC;
                shopConfigInfo.SCSubmitType     = model.SCSubmitType;
                shopConfigInfo.GuestSCCount     = model.GuestSCCount;
                shopConfigInfo.MemberSCCount    = model.MemberSCCount;
                shopConfigInfo.SCExpire         = model.SCExpire;
                shopConfigInfo.OSNFormat        = model.OSNFormat;
                shopConfigInfo.OnlinePayExpire  = model.OnlinePayExpire;
                shopConfigInfo.OfflinePayExpire = model.OfflinePayExpire;
                shopConfigInfo.BroHisCount      = model.BroHisCount;
                shopConfigInfo.MaxShipAddress   = model.MaxShipAddress;
                shopConfigInfo.FavoriteCount    = model.FavoriteCount;

                BSPConfig.SaveShopConfig(shopConfigInfo);
                Emails.ResetShop();
                SMSes.ResetShop();
                AddAdminOperateLog("修改商城设置");
                return(PromptView(Url.Action("shop"), "修改商城设置成功"));
            }
            return(View(model));
        }
Example #3
0
        public ActionResult Access(AccessModel model)
        {
            if (ModelState.IsValid)
            {
                ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

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

                BSPConfig.SaveShopConfig(shopConfigInfo);
                Emails.ResetShop();
                SMSes.ResetShop();
                Randoms.ResetRandomLibrary();
                FilterWords.ResetIgnoreWordsRegex();
                AddAdminOperateLog("修改访问控制");
                return(PromptView(Url.Action("access"), "修改访问控制成功"));
            }

            ViewData["verifyPages"] = CommonHelper.StringArrayToString(model.VerifyPages);
            return(View(model));
        }
Example #4
0
        public ActionResult Add(EventModel model)
        {
            if (!string.IsNullOrWhiteSpace(model.Key) && BSPConfig.EventConfig.BSPEventList.Find(x => x.Key == model.Key.Trim().ToLower()) != null)
            {
                ModelState.AddModelError("Key", "键已经存在");
            }

            if (!string.IsNullOrWhiteSpace(model.Title) && BSPConfig.EventConfig.BSPEventList.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
                };

                BSPConfig.EventConfig.BSPEventList.Add(eventInfo);
                BSPConfig.SaveEventConfig(BSPConfig.EventConfig);
                AddAdminOperateLog("添加事件", "添加事件,事件为:" + model.Title);
                return(PromptView("事件添加成功"));
            }
            ViewData["referer"] = ShopUtils.GetAdminRefererCookie();
            return(View(model));
        }
Example #5
0
        public ActionResult Upload(UploadModel model)
        {
            if (ModelState.IsValid)
            {
                ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

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

                BSPConfig.SaveShopConfig(shopConfigInfo);
                Emails.ResetShop();
                SMSes.ResetShop();
                AddAdminOperateLog("修改上传设置");
                return(PromptView(Url.Action("upload"), "修改上传设置成功"));
            }

            LoadFont();
            return(View(model));
        }
Example #6
0
        public ActionResult Credit(CreditModel model)
        {
            if (ModelState.IsValid)
            {
                CreditConfigInfo creditConfigInfo = BSPConfig.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.CompleteOrderPayCredits    = model.CompleteOrderPayCredits;
                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.CompleteOrderRankCredits    = model.CompleteOrderRankCredits;
                creditConfigInfo.ReviewProductRankCredits    = model.ReviewProductRankCredits;

                BSPConfig.SaveCreditConfig(creditConfigInfo);
                Credits.ResetCreditConfig();
                AddAdminOperateLog("修改积分设置");
                return(PromptView(Url.Action("credit"), "修改积分设置成功"));
            }
            return(View(model));
        }
Example #7
0
        public ActionResult Edit(BaseInfo model)
        {
            Load();
            BaseInfo eventInfo = null;

            if (!string.IsNullOrWhiteSpace(model.Key))
            {
                eventInfo = BSPConfig.BaseConfig.BaseList.Find(x => x.Key == model.Key);
            }

            if (eventInfo == null)
            {
                return(PromptView("基础信息不存在"));
            }


            //eventInfo.Key = model.Key.Trim().ToLower(),
            eventInfo.Key         = model.Key.Trim();
            eventInfo.Name        = model.Name;
            eventInfo.Account     = model.Account;
            eventInfo.Bank        = model.Bank;
            eventInfo.BankAddress = model.BankAddress;
            eventInfo.Image       = model.Image;
            BSPConfig.SaveBaseConfig(BSPConfig.BaseConfig);
            return(PromptView("保存成功"));
        }
Example #8
0
        /// <summary>
        /// 修改试用时间及状态
        /// </summary>
        /// <returns></returns>
        public ActionResult SysTimeChange()
        {
            int    type        = WebHelper.GetQueryInt("type");
            string expiredtime = WebHelper.GetQueryString("time", "");

            try
            {
                if (type == 1)
                {
                    BSPConfig.ShopConfig.OnlineTimeSpan = 1;
                    BSPConfig.SaveShopConfig(BSPConfig.ShopConfig);
                    return(APIResult("success", "更新成功"));
                }
                else if (type == 2)
                {
                    //修改状态 系统为试用阶段  时间延迟一个月
                    BSPConfig.ShopConfig.OnlineTimeSpan = 0;
                    BSPConfig.SaveShopConfig(BSPConfig.ShopConfig);

                    string   time      = expiredtime == "" ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : DateTime.Parse(expiredtime).ToString("yyyy-MM-dd HH:mm:ss");
                    BaseInfo base_info = BSPConfig.BaseConfig.BaseList.Find(x => x.Key == "试用");
                    if (base_info != null)
                    {
                        base_info.Account = time;

                        BSPConfig.SaveBaseConfig(BSPConfig.BaseConfig);
                    }
                    else
                    {
                        base_info = new BaseInfo {
                            Key = "试用", Name = "有效期", Account = time
                        };
                        BSPConfig.BaseConfig.BaseList.Add(base_info);
                        BSPConfig.SaveBaseConfig(BSPConfig.BaseConfig);
                    }

                    return(APIResult("success", "更新成功"));
                }
                return(APIResult("error", "更新失败"));
            }
            catch (Exception er)
            {
                return(APIResult("error", "更新失败," + er.Message));
            }
        }
Example #9
0
        public ActionResult SMS(SMSModel model)
        {
            if (ModelState.IsValid)
            {
                SMSConfigInfo smsConfigInfo = BSPConfig.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;

                BSPConfig.SaveSMSConfig(smsConfigInfo);
                SMSes.ResetSMS();
                AddAdminOperateLog("修改短信设置");
                return(PromptView(Url.Action("sms"), "修改短信设置成功"));
            }
            return(View(model));
        }
Example #10
0
        public ActionResult Edit(EventModel model)
        {
            EventInfo eventInfo = null;

            if (!string.IsNullOrWhiteSpace(model.Key))
            {
                eventInfo = BSPConfig.EventConfig.BSPEventList.Find(x => x.Key == model.Key);
            }

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

            if (!string.IsNullOrWhiteSpace(model.Title))
            {
                EventInfo temp = BSPConfig.EventConfig.BSPEventList.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;

                BSPConfig.SaveEventConfig(BSPConfig.EventConfig);
                AddAdminOperateLog("编辑事件", "编辑事件,事件为:" + model.Title);
                return(PromptView("事件编辑成功"));
            }
            ViewData["referer"] = ShopUtils.GetAdminRefererCookie();
            return(View(model));
        }
Example #11
0
        public ActionResult Site(SiteModel model)
        {
            if (ModelState.IsValid)
            {
                ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

                shopConfigInfo.WebName        = model.ShopName == null ? "" : model.ShopName;
                shopConfigInfo.SiteUrl        = model.SiteUrl == null ? "" : model.SiteUrl;
                shopConfigInfo.SiteTitle      = model.SiteTitle == null ? "" : model.SiteTitle;
                shopConfigInfo.SEOKeyword     = model.SEOKeyword == null ? "" : model.SEOKeyword;
                shopConfigInfo.SEODescription = model.SEODescription == null ? "" : model.SEODescription;
                shopConfigInfo.ICP            = model.ICP == null ? "" : model.ICP;
                shopConfigInfo.Script         = model.Script == null ? "" : model.Script;
                shopConfigInfo.IsLicensed     = model.IsLicensed;

                BSPConfig.SaveShopConfig(shopConfigInfo);
                Emails.ResetShop();
                SMSes.ResetShop();
                AddAdminOperateLog("修改站点信息");
                return(PromptView(Url.Action("site"), "修改站点信息成功"));
            }
            return(View(model));
        }
Example #12
0
        public ActionResult Add(BaseInfo model)
        {
            Load();
            if (!string.IsNullOrWhiteSpace(model.Key) && BSPConfig.BaseConfig.BaseList.Find(x => x.Key == model.Key.Trim().ToLower()) != null)
            {
                ModelState.AddModelError("Key", "键已经存在");
            }


            BaseInfo eventInfo = new BaseInfo()
            {
                Key         = model.Key,
                Account     = model.Account,
                Name        = model.Name,
                Bank        = model.Bank,
                BankAddress = model.BankAddress
            };

            BSPConfig.BaseConfig.BaseList.Add(eventInfo);
            BSPConfig.SaveBaseConfig(BSPConfig.BaseConfig);

            return(PromptView("添加成功"));
        }
Example #13
0
        /// <summary>
        /// 默认主题
        /// </summary>
        /// <param name="type">类型</param>
        /// <param name="name">主题名称</param>
        /// <returns></returns>
        public ActionResult DefaultTheme(int type = 0, string name = "")
        {
            if (!string.IsNullOrWhiteSpace(name))
            {
                string path = null;
                if (type == 0)
                {
                    path = IOHelper.GetMapPath("/themes");
                }
                else if (type == 1)
                {
                    path = IOHelper.GetMapPath("/mobile/themes");
                }
                DirectoryInfo   dir          = new DirectoryInfo(path);
                DirectoryInfo[] themeDirList = dir.GetDirectories(name);
                if (themeDirList != null)
                {
                    XmlDocument doc = new XmlDocument();
                    doc.Load(themeDirList[0].FullName + @"\theme.xml");

                    ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;
                    if (type == 0)
                    {
                        shopConfigInfo.PCTheme = themeDirList[0].Name;
                    }
                    else if (type == 1)
                    {
                        shopConfigInfo.MobileTheme = themeDirList[0].Name;
                    }

                    BSPConfig.SaveShopConfig(shopConfigInfo);
                    AddAdminOperateLog("设置默认主题", "设置默认主题,主题为:" + doc.DocumentElement.Attributes["title"].Value);
                    return(PromptView(Url.Action("theme"), "设置默认主题成功"));
                }
            }
            return(PromptView(Url.Action("theme"), "主题不存在"));
        }
Example #14
0
        public ActionResult Email(EmailModel model)
        {
            if (ModelState.IsValid)
            {
                EmailConfigInfo emailConfigInfo = BSPConfig.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;

                BSPConfig.SaveEmailConfig(emailConfigInfo);
                Emails.ResetEmail();
                AddAdminOperateLog("修改邮箱设置");
                return(PromptView(Url.Action("email"), "修改邮箱设置成功"));
            }
            return(View(model));
        }
Example #15
0
        public ActionResult Account(AccountModel model)
        {
            if (ModelState.IsValid)
            {
                ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig;

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

                BSPConfig.SaveShopConfig(shopConfigInfo);
                Emails.ResetShop();
                SMSes.ResetShop();
                AddAdminOperateLog("修改账号设置");
                return(PromptView(Url.Action("account"), "修改账号设置成功"));
            }
            return(View(model));
        }