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)); }
/// <summary> /// 保存上传的友情链接Logo /// </summary> /// <param name="logo">友情链接logo</param> /// <returns></returns> public string SaveUploadFriendLinkLogo(HttpPostedFileBase logo) { if (logo == null) { return("-1"); } ShopConfigInfo shopConfig = BSPConfig.ShopConfig; string fileName = logo.FileName; string extension = Path.GetExtension(fileName); if (!ValidateHelper.IsImgFileName(fileName) || !CommonHelper.IsInArray(extension, shopConfig.UploadImgType)) { return("-2"); } int fileSize = logo.ContentLength; if (fileSize > shopConfig.UploadImgSize) { return("-3"); } string dirPath = IOHelper.GetMapPath("/upload/friendlink/"); string newFileName = string.Format("fr_{0}{1}", DateTime.Now.ToString("yyMMddHHmmssfffffff"), extension);//生成文件名 if (!Directory.Exists(dirPath)) { Directory.CreateDirectory(dirPath); } logo.SaveAs(dirPath + newFileName); return(newFileName); }
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)); }
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)); }
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)); }
protected void SubmitButton_Click(object sender, EventArgs E) { string oldPassword = StringHelper.Password(Password.Text, (PasswordType)ShopConfig.ReadConfigInfo().PasswordType); string newPassword = StringHelper.Password(NewPassword.Text, (PasswordType)ShopConfig.ReadConfigInfo().PasswordType); AdminInfo admin = AdminBLL.Read(Cookies.Admin.GetAdminID(false)); if (admin.Password == oldPassword) { AdminBLL.ChangePassword(Cookies.Admin.GetAdminID(false), oldPassword, newPassword); AdminLogBLL.Add(ShopLanguage.ReadLanguage("ChangePassword")); Task.Run(() => { //安全码 ShopConfigInfo config = ShopConfig.ReadConfigInfo(); config.SecureKey = Convert.ToBase64String(Guid.NewGuid().ToByteArray()); ShopConfig.UpdateConfigInfo(config); }); //清除现有cookie CookiesHelper.DeleteCookie(ShopConfig.ReadConfigInfo().AdminCookies); ScriptHelper.Alert(ShopLanguage.ReadLanguage("UpdateOK"), RequestHelper.RawUrl); } else { ScriptHelper.Alert(ShopLanguage.ReadLanguage("OldPasswordError"), RequestHelper.RawUrl); } }
/// <summary> /// 重置商城信息 /// </summary> public static void ResetShop() { lock (_locker) { _shopconfiginfo = BSPConfig.ShopConfig; } }
public ActionResult Upload() { ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig; UploadModel model = new UploadModel(); model.UploadServer = shopConfigInfo.UploadServer; model.UploadImgType = shopConfigInfo.UploadImgType; model.UploadImgSize = shopConfigInfo.UploadImgSize / 1000; model.WatermarkType = shopConfigInfo.WatermarkType; model.WatermarkQuality = shopConfigInfo.WatermarkQuality; model.WatermarkPosition = shopConfigInfo.WatermarkPosition; model.WatermarkImg = shopConfigInfo.WatermarkImg; model.WatermarkImgOpacity = shopConfigInfo.WatermarkImgOpacity; model.WatermarkText = shopConfigInfo.WatermarkText; model.WatermarkTextFont = shopConfigInfo.WatermarkTextFont; model.WatermarkTextSize = shopConfigInfo.WatermarkTextSize; model.BrandThumbSize = shopConfigInfo.BrandThumbSize; model.ProductShowThumbSize = shopConfigInfo.ProductShowThumbSize; model.UserAvatarThumbSize = shopConfigInfo.UserAvatarThumbSize; model.UserRankAvatarThumbSize = shopConfigInfo.UserRankAvatarThumbSize; LoadFont(); return(View(model)); }
/// <summary> /// 提交按钮点击方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SubmitButton_Click(object sender, EventArgs e) { CheckAdminPower("UpdateConfig", PowerCheckType.Single); ShopConfigInfo config = ShopConfig.ReadConfigInfo(); //满立减 decimal orderMoney = 0; decimal orderDiscount = 0; config.PayDiscount = RequestHelper.GetForm <int>("ctl00$ContentPlaceHolder$PayDiscount"); if (config.PayDiscount == 1) { if (!decimal.TryParse(OrderMoney.Text, out orderMoney) || !decimal.TryParse(OrderDisCount.Text, out orderDiscount)) { ScriptHelper.Alert("满立减金额填写错误"); } if (orderMoney <= orderDiscount) { ScriptHelper.Alert("满立减金额必须小于订单金额"); } } config.OrderMoney = orderMoney; config.OrderDisCount = orderDiscount; ShopConfig.UpdateConfigInfo(config); AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateConfig")); ScriptHelper.Alert(ShopLanguage.ReadLanguage("UpdateOK"), RequestHelper.RawUrl); }
public static void RefreshConfigCache() { string fileName = ServerHelper.MapPath(GetFileName()); ShopConfigInfo cacheValue = ConfigHelper.ReadPropertyFromXml <ShopConfigInfo>(fileName); CacheDependency cd = new CacheDependency(fileName); CacheHelper.Write(configCacheKey, cacheValue, cd); RefreshApp(); }
private static ShopConfigInfo _shopconfiginfo = null; //商城配置 static SMSes() { _ismsstrategy = BSPSMS.Instance; _smsconfiginfo = BSPConfig.SMSConfig; _shopconfiginfo = BSPConfig.ShopConfig; _ismsstrategy.Url = _smsconfiginfo.Url; _ismsstrategy.UserName = _smsconfiginfo.UserName; _ismsstrategy.Password = _smsconfiginfo.Password; }
/// <summary> /// 刷新全局设置 /// </summary> public static void RefreshConfigCache() { string fileName = ServerHelper.MapPath("~/Config/ShopConfig.config"); ShopConfigInfo config = ConfigHelper.ReadPropertyFromXml <ShopConfigInfo>(fileName); CacheDependency cd = new CacheDependency(fileName); CacheHelper.Write(configCacheKey, config, cd); RefreshApp(); }
/// <summary> /// 保存上传的品牌logo /// </summary> /// <param name="logo">品牌logo</param> /// <returns></returns> public string SaveUploadBrandLogo(HttpPostedFileBase logo) { if (logo == null) { return("-1"); } ShopConfigInfo shopConfig = BSPConfig.ShopConfig; string fileName = logo.FileName; string extension = Path.GetExtension(fileName); if (!ValidateHelper.IsImgFileName(fileName) || !CommonHelper.IsInArray(extension, shopConfig.UploadImgType)) { return("-2"); } int fileSize = logo.ContentLength; if (fileSize > shopConfig.UploadImgSize) { return("-3"); } string dirPath = IOHelper.GetMapPath("/upload/brand/"); string newFileName = string.Format("b_{0}{1}", DateTime.Now.ToString("yyMMddHHmmssfffffff"), extension); string[] sizeList = StringHelper.SplitString(shopConfig.BrandThumbSize); string sourceDirPath = dirPath + "source/"; if (!Directory.Exists(sourceDirPath)) { Directory.CreateDirectory(sourceDirPath); } string sourcePath = sourceDirPath + newFileName; logo.SaveAs(sourcePath); foreach (string size in sizeList) { string thumbDirPath = string.Format("{0}thumb{1}/", dirPath, size); if (!Directory.Exists(thumbDirPath)) { Directory.CreateDirectory(thumbDirPath); } string[] widthAndHeight = StringHelper.SplitString(size, "_"); IOHelper.GenerateThumb(sourcePath, thumbDirPath + newFileName, TypeHelper.StringToInt(widthAndHeight[0]), TypeHelper.StringToInt(widthAndHeight[1]), "H"); } return(newFileName); }
/// <summary> /// 保存商品编辑器中的图片 /// </summary> /// <param name="image">图片</param> /// <returns></returns> public static string SaveProductEditorImage(HttpPostedFileBase image) { if (image == null) { return("-1"); } ShopConfigInfo shopConfig = BSPConfig.ShopConfig; string fileName = image.FileName; string extension = Path.GetExtension(fileName); if (!ValidateHelper.IsImgFileName(fileName) || !CommonHelper.IsInArray(extension, shopConfig.UploadImgType)) { return("-2"); } int fileSize = image.ContentLength; if (fileSize > shopConfig.UploadImgSize) { return("-3"); } string dirPath = IOHelper.GetMapPath("/upload/product/editor/"); string newFileName = string.Format("pe_{0}{1}", DateTime.Now.ToString("yyMMddHHmmssfffffff"), extension);//生成文件名 string sourceDirPath = dirPath + "source/"; if (!Directory.Exists(sourceDirPath)) { Directory.CreateDirectory(sourceDirPath); } string sourcePath = sourceDirPath + newFileName; image.SaveAs(sourcePath); string path = dirPath + newFileName; if (shopConfig.WatermarkType == 1)//文字水印 { IOHelper.GenerateTextWatermark(sourcePath, path, shopConfig.WatermarkText, shopConfig.WatermarkTextSize, shopConfig.WatermarkTextFont, shopConfig.WatermarkPosition, shopConfig.WatermarkQuality); } else if (shopConfig.WatermarkType == 2)//图片水印 { string watermarkPath = IOHelper.GetMapPath("/watermarks/" + shopConfig.WatermarkImg); IOHelper.GenerateImageWatermark(sourcePath, watermarkPath, path, shopConfig.WatermarkPosition, shopConfig.WatermarkImgOpacity, shopConfig.WatermarkQuality); } else { image.SaveAs(path); } return(newFileName); }
protected void SubmitButton_Click(object sender, EventArgs e) { base.CheckAdminPower("Sitemap", PowerCheckType.Single); ShopConfigInfo config = ShopConfig.ReadConfigInfo(); config.Domain = this.Domain.Text; config.Frequency = this.Frequency.Text; config.Priority = this.Priority.Text; ShopConfig.UpdateConfigInfo(config); ScriptHelper.Alert(ShopLanguage.ReadLanguage("UpdateOK"), RequestHelper.RawUrl); }
private static ShopConfigInfo _shopconfiginfo = null; //商城配置信息 /// <summary> /// 静态构造函数 /// </summary> static Emails() { _iemailstrategy = BSPEmail.Instance; _emailconfiginfo = BSPConfig.EmailConfig; _shopconfiginfo = BSPConfig.ShopConfig; _iemailstrategy.Host = _emailconfiginfo.Host; _iemailstrategy.Port = _emailconfiginfo.Port; _iemailstrategy.UserName = _emailconfiginfo.UserName; _iemailstrategy.Password = _emailconfiginfo.Password; _iemailstrategy.From = _emailconfiginfo.From; _iemailstrategy.FromName = _emailconfiginfo.FromName; }
protected void SubmitButton_Click(object sender, EventArgs e) { base.CheckAdminPower("TaobaoProduct", PowerCheckType.Single); ShopConfigInfo config = ShopConfig.ReadConfigInfo(); config.AppKey = this.AppKey.Text; config.AppSecret = this.AppSecret.Text; config.NickName = this.NickName.Text; config.DeleteProductClass = Convert.ToInt32(this.DeleteProductClass.Text); ShopConfig.UpdateConfigInfo(config); ScriptHelper.Alert(ShopLanguage.ReadLanguage("UpdateOK"), RequestHelper.RawUrl); }
/// <summary> /// 处理海报图片 /// </summary> /// <param name="image"></param> /// <param name="filepath">格式:/upload/finance/123/</param> /// <returns></returns> public string SaveUploadImgForPoster(HttpPostedFileBase image, string filepath) { if (image == null) { return("-1"); } ShopConfigInfo shopConfig = BSPConfig.ShopConfig; string fileName = image.FileName; string extension = Path.GetExtension(fileName); if (!ValidateHelper.IsImgFileName(fileName) || !CommonHelper.IsInArray(extension, shopConfig.UploadImgType)) { return("-2"); } int fileSize = image.ContentLength; if (fileSize > shopConfig.UploadImgSize) { return("-3"); } string dirPath = IOHelper.GetMapPath(filepath); string newFileName = string.Format("img_{0}{1}", DateTime.Now.ToString("yyMMddHHmmssfffffff"), extension);//生成文件名 string[] sizeList = StringHelper.SplitString(shopConfig.ProductShowThumbSize); if (!Directory.Exists(dirPath)) { Directory.CreateDirectory(dirPath); } string path = dirPath + newFileName; image.SaveAs(path); string hbfilename = "hb" + newFileName; string url = "http://2d-code.cn/2dcode/api.php?key=c_e541Q4CL7uA9kSMaYQTBOWIOvhohLggo0nOtyr8QmU&url=" + System.Web.HttpUtility.UrlEncode(BSPConfig.ShopConfig.SiteUrl, Encoding.UTF8) + "&logo=http://app.himicall.com/images/hmk.jpg&border=2&cl=H&size=100"; string watermarkPath = IOHelper.GetMapPath("/watermarks/" + shopConfig.WatermarkImg); //动态生成二维码 //IOHelper.HttpDownloadFile(url, watermarkPath); IOHelper.GenerateImageWatermark(dirPath + newFileName, watermarkPath, dirPath + hbfilename, shopConfig.WatermarkPosition, shopConfig.WatermarkImgOpacity, shopConfig.WatermarkQuality); File.Delete(path); return(hbfilename); }
/// <summary> /// 选中标签页 /// </summary> /// <param name="page"></param> public void OnPageSelect(PackageSelect.ShopPage page) { if (ShopId == 0) { return; } ShopConfigInfo info = ConfigReader.ShopXmlInfoDict[ShopId]; List <int> items = new List <int>(); switch (page) { case PackageSelect.ShopPage.ShopPage1: items = info.un32ItemIDPage1; break; case PackageSelect.ShopPage.ShopPage2: items = info.un32ItemIDPage2; break; case PackageSelect.ShopPage.ShopPage3: items = info.un32ItemIDPage3; break; case PackageSelect.ShopPage.ShopPage4: items = info.un32ItemIDPage4; break; case PackageSelect.ShopPage.ShopPage5: items = info.un32ItemIDPage5; break; case PackageSelect.ShopPage.ShopPage6: items = GetHeroRecommendEquip(); break; } if (items != null && items.Count != 0) { isRecommendEquip = false; if (page == PackageSelect.ShopPage.ShopPage6) { isRecommendEquip = true; } BuyPackageItem buy = (BuyPackageItem)ShopItemAll[ShopSelectType.TypeBuy]; buy.ToggleSelectItem(items); this.ToggleSelectPageItem(buy, (items.Count > 0) ? items[0] : 0); } }
private void AddButtonListener(Transform head, int shopid) { ShopConfigInfo info = ConfigReader.ShopXmlInfoDict[shopid]; List <int> items = new List <int>(); for (int ct = 0; ct < PackageBtnCount; ct++) { int ctt = ct + 1; ShopPage page = (ShopPage)ctt; switch (page) { case PackageSelect.ShopPage.ShopPage1: items = info.un32ItemIDPage1; break; case PackageSelect.ShopPage.ShopPage2: items = info.un32ItemIDPage2; break; case PackageSelect.ShopPage.ShopPage3: items = info.un32ItemIDPage3; break; case PackageSelect.ShopPage.ShopPage4: items = info.un32ItemIDPage4; break; case PackageSelect.ShopPage.ShopPage5: items = info.un32ItemIDPage5; break; case PackageSelect.ShopPage.ShopPage6: items = UIShop.Instance.GetHeroRecommendEquip(); break; } ButtonOnPress click = head.Find("Kind" + ctt.ToString()).GetComponent <ButtonOnPress>(); if (items == null || items.Count == 0) { click.GetComponent <BoxCollider>().enabled = false; continue; } click.AddListener(ctt, KindSelectFunc, ButtonOnPress.EventType.PressType); PageButton.Add(click); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("Template", PowerCheckType.Single); string queryString = RequestHelper.GetQueryString <string>("Action"); string str2 = RequestHelper.GetQueryString <string>("Path"); if ((queryString == "Active") && (str2 != string.Empty)) { ShopConfigInfo config = ShopConfig.ReadConfigInfo(); config.TemplatePath = str2; ShopConfig.UpdateConfigInfo(config); ScriptHelper.Alert("ÆôÓóɹ¦", "Template.aspx"); } this.templatePluginsList = TemplatePlugins.ReadTemplatePluginsList(); } }
public ActionResult Site() { ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig; SiteModel model = new SiteModel(); model.ShopName = shopConfigInfo.WebName; model.SiteUrl = shopConfigInfo.SiteUrl; model.SiteTitle = shopConfigInfo.SiteTitle; model.SEOKeyword = shopConfigInfo.SEOKeyword; model.SEODescription = shopConfigInfo.SEODescription; model.ICP = shopConfigInfo.ICP; model.Script = shopConfigInfo.Script; model.IsLicensed = shopConfigInfo.IsLicensed; return(View(model)); }
protected void SubmitButton_Click(object sender, EventArgs E) { int tempAdminID = RequestHelper.GetQueryString <int>("ID"); if (tempAdminID != int.MinValue) { string newPassword = StringHelper.Password(NewPassword.Text, (PasswordType)ShopConfig.ReadConfigInfo().PasswordType); AdminBLL.ChangePassword(tempAdminID, newPassword); Task.Run(() => { //安全码 ShopConfigInfo config = ShopConfig.ReadConfigInfo(); config.SecureKey = Convert.ToBase64String(Guid.NewGuid().ToByteArray()); ShopConfig.UpdateConfigInfo(config); }); AdminLogBLL.Add(ShopLanguage.ReadLanguage("ChangeAdminPassword"), tempAdminID); ScriptHelper.Alert(ShopLanguage.ReadLanguage("UpdateOK"), RequestHelper.RawUrl); } }
public ActionResult Account() { ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig; AccountModel model = new AccountModel(); model.RegType = StringToIntArray(shopConfigInfo.RegType); model.ReservedName = shopConfigInfo.ReservedName; model.RegTimeSpan = shopConfigInfo.RegTimeSpan; model.IsWebcomeMsg = shopConfigInfo.IsWebcomeMsg; model.WebcomeMsg = shopConfigInfo.WebcomeMsg; model.LoginType = StringToIntArray(shopConfigInfo.LoginType); model.ShadowName = shopConfigInfo.ShadowName; model.IsRemember = shopConfigInfo.IsRemember; model.LoginFailTimes = shopConfigInfo.LoginFailTimes; return(View(model)); }
/// <summary> /// 保存上传的图片 /// </summary> /// <param name="image"></param> /// <param name="filepath">格式:/upload/finance/123/</param> /// <returns></returns> public string SaveUploadImgNoSize(HttpPostedFileBase image, string filepath) { if (image == null) { return("-1"); } ShopConfigInfo shopConfig = BSPConfig.ShopConfig; string fileName = image.FileName; string extension = Path.GetExtension(fileName); if (!ValidateHelper.IsImgFileName(fileName) || !CommonHelper.IsInArray(extension, shopConfig.UploadImgType)) { return("-2"); } int fileSize = image.ContentLength; if (fileSize > shopConfig.UploadImgSize) { return("-3"); } string dirPath = IOHelper.GetMapPath(filepath); string newFileName = string.Format("img_{0}{1}", DateTime.Now.ToString("yyMMddHHmmssfffffff"), extension);//生成文件名 string[] sizeList = StringHelper.SplitString(shopConfig.ProductShowThumbSize); if (!Directory.Exists(dirPath)) { Directory.CreateDirectory(dirPath); } string path = dirPath + newFileName; image.SaveAs(path); return(newFileName); }
public ActionResult Shop() { ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig; ShopModel model = new ShopModel(); model.IsGuestSC = shopConfigInfo.IsGuestSC; model.SCSubmitType = shopConfigInfo.SCSubmitType; model.GuestSCCount = shopConfigInfo.GuestSCCount; model.MemberSCCount = shopConfigInfo.MemberSCCount; model.SCExpire = shopConfigInfo.SCExpire; model.OSNFormat = shopConfigInfo.OSNFormat; model.OnlinePayExpire = shopConfigInfo.OnlinePayExpire; model.OfflinePayExpire = shopConfigInfo.OfflinePayExpire; model.BroHisCount = shopConfigInfo.BroHisCount; model.MaxShipAddress = shopConfigInfo.MaxShipAddress; model.FavoriteCount = shopConfigInfo.FavoriteCount; return(View(model)); }
public ActionResult Performance() { ShopConfigInfo shopConfigInfo = BSPConfig.ShopConfig; PerformanceModel model = new PerformanceModel(); model.ImageCDN = shopConfigInfo.ImageCDN; model.CSSCDN = shopConfigInfo.CSSCDN; model.ScriptCDN = shopConfigInfo.ScriptCDN; model.OnlineUserExpire = shopConfigInfo.OnlineUserExpire; model.UpdateOnlineTimeSpan = shopConfigInfo.UpdateOnlineTimeSpan; model.MaxOnlineCount = shopConfigInfo.MaxOnlineCount; model.OnlineCountExpire = shopConfigInfo.OnlineCountExpire; model.UpdatePVStatTimespan = shopConfigInfo.UpdatePVStatTimespan; model.IsStatBrowser = shopConfigInfo.IsStatBrowser; model.IsStatOS = shopConfigInfo.IsStatOS; model.IsStatRegion = shopConfigInfo.IsStatRegion; return(View(model)); }
/// <summary> /// 提交按钮点击方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SubmitButton_Click(object sender, EventArgs e) { CheckAdminPower("UpdateConfig", PowerCheckType.Single); ShopConfigInfo config = ShopConfig.ReadConfigInfo(); #region 微信登录参数 config.AppID = AppID.Text.Trim(); config.Appsecret = AppSecret.Text.Trim(); config.Token = Token.Text.Trim(); config.EncodingAESKey = EncodingAESKey.Text.Trim(); config.WechatLoginURL = WechatLoginURL.Text.Trim(); config.AttentionTitle = AttentionTitle.Text; config.AttentionSummary = AttentionSummary.Text; config.AttentionPicture = AttentionPicture.Text; config.DefaultReply = DefaultReply.Text; #endregion ShopConfig.UpdateConfigInfo(config); AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateConfig")); ScriptHelper.Alert(ShopLanguage.ReadLanguage("UpdateOK"), RequestHelper.RawUrl); }
/// <summary> /// 保存上传的基本资料图片 /// </summary> /// <param name="baseinfo">基本资料图片</param> /// <returns></returns> public string SaveUploadBaseInfo(HttpPostedFileBase baseinfo) { if (baseinfo == null) { return("-1"); } ShopConfigInfo shopConfig = BSPConfig.ShopConfig; string fileName = baseinfo.FileName; string extension = Path.GetExtension(fileName); if (!ValidateHelper.IsImgFileName(fileName) || !CommonHelper.IsInArray(extension, shopConfig.UploadImgType)) { return("-2"); } int fileSize = baseinfo.ContentLength; if (fileSize > shopConfig.UploadImgSize) { return("-3"); } string dirPath = IOHelper.GetMapPath("/upload/baseinfo/"); string newFileName = string.Format("fr_{0}{1}", DateTime.Now.ToString("yyMMddHHmmssfffffff"), extension);//生成文件名 if (!Directory.Exists(dirPath)) { Directory.CreateDirectory(dirPath); } baseinfo.SaveAs(dirPath + newFileName); //string watermarkPath = IOHelper.GetMapPath("/watermarks/" + shopConfig.WatermarkImg); //IOHelper.GenerateImageWatermark(dirPath + newFileName, watermarkPath, dirPath + "dd.jpg", shopConfig.WatermarkPosition, shopConfig.WatermarkImgOpacity, shopConfig.WatermarkQuality); //IOHelper.BuildWatermark(dirPath + newFileName, watermarkPath, "", dirPath+"dd.jpg"); return(newFileName); }
/// <summary> /// 提交按钮点击方法 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SubmitButton_Click(object sender, EventArgs e) { CheckAdminPower("UpdateConfig", PowerCheckType.Single); ShopConfigInfo config = ShopConfig.ReadConfigInfo(); //订单支付模板Id config.OrderPayTemplateId = OrderPayTemplateId.Text.Trim(); //订单自提模板Id config.SelfPickTemplateId = SelfPickTemplateId.Text.Trim(); //开团成功模板Id config.OpenGroupTemplateId = OpenGroupTemplateId.Text.Trim(); //参团成功模板Id config.GroupSignTemplateId = GroupSignTemplateId.Text.Trim(); //砍价成功模板Id config.BarGainTemplateId = BarGainTemplateId.Text.Trim(); //拼团成功模板Id config.GroupSuccessTemplateId = GroupSuccessTemplateId.Text.Trim(); //拼团失败模板Id config.GroupFailTemplateId = GroupFailTemplateId.Text.Trim(); //积分抵现功能是否开启 config.EnablePointPay = RequestHelper.GetForm <int>("ctl00$ContentPlaceHolder$EnablePointPay"); config.PointToMoney = Convert.ToInt32(PointToMoney.Text) < 0 ? 0 : Convert.ToInt32(PointToMoney.Text); if (config.EnablePointPay == 1 && (config.PointToMoney <= 0 || config.PointToMoney > 100)) { ScriptHelper.Alert("积分抵现百分比必须大于0小于100"); } if ((config.VoteStartDate - config.VoteEndDate).Days > 0) { ScriptHelper.Alert("投票结束日期不得小于开始日期"); } //订单付款时限,不小于0 config.OrderPayTime = Convert.ToInt32(OrderPayTime.Text) < 0 ? 0 : Convert.ToInt32(OrderPayTime.Text); //订单单自动收货天数 config.OrderRecieveShippingDays = Convert.ToInt32(OrderRecieveShippingDays.Text) < 0 ? 0 : Convert.ToInt32(OrderRecieveShippingDays.Text); ShopConfig.UpdateConfigInfo(config); AdminLogBLL.Add(ShopLanguage.ReadLanguage("UpdateConfig")); ScriptHelper.Alert(ShopLanguage.ReadLanguage("UpdateOK"), RequestHelper.RawUrl); }