protected void Page_Load(object sender, EventArgs e) { wid = GetCurWebId(); if (string.IsNullOrEmpty(wid)) { return; } bll = new Chenduo.BLL.sf_website(); website = bll.GetModelByWid(wid); if (!base.IsPostBack && (this.action == "setenable")) { base.Response.Clear(); base.Response.ContentType = "application/json"; string s = "{\"type\":\"1\",\"tips\":\"操作成功!\"}"; try { this.siteSettings.OpenManyService = Globals.RequestFormNum("enable") == 1; website.OpenManyService = Globals.RequestFormStr("enable"); //SettingsManager.Save(this.siteSettings); bll.Update(website); } catch { s = "{\"type\":\"0\",\"tips\":\"操作失败!\"}"; } base.Response.Write(s); base.Response.End(); } this.enableManyService = this.siteSettings.OpenManyService; }
public void ProcessRequest(HttpContext context) { wid = context.Session[DTKeys.SESSION_WEB_ID] as string; if (string.IsNullOrEmpty(wid)) { return; } context.Response.ContentType = "text/plain"; try { Chenduo.BLL.sf_website bll = new Chenduo.BLL.sf_website(); Chenduo.Model.sf_website website = bll.GetModelByWid(wid); string str = context.Request["type"].ToString(); SiteSettings masterSettings = SettingsManager.GetMasterSettings(false, wid); if (str == "0") { bool flag = bool.Parse(context.Request["enable"].ToString()); masterSettings.EnableSaleService = flag; website.EnableSaleService = flag; } //SettingsManager.Save(masterSettings); bll.Update(website); context.Response.Write("{\"type\":\"success\",\"data\":\"\"}"); } catch (Exception exception) { context.Response.Write("{\"type\":\"error\",\"data\":\"" + exception.Message + "\"}"); } }
protected void Page_Load(object sender, EventArgs e) { wid = GetCurWebId(); if (string.IsNullOrEmpty(wid)) { return; } bll = new Chenduo.BLL.sf_website(); website = bll.GetModelByWid(wid); this.siteSettings = SettingsManager.GetMasterSettings(false, wid); this.action = Globals.RequestFormStr("action"); if (!base.IsPostBack) { if (this.action == "setenable") { base.Response.Clear(); base.Response.ContentType = "application/json"; string s = "{\"type\":\"1\",\"tips\":\"操作成功!\"}"; this.siteSettings.EnableGuidePageSet = Globals.RequestFormNum("enable") == 1; website.EnableGuidePageSet = Globals.RequestFormStr("enable"); bll.Update(website); //SettingsManager.Save(this.siteSettings); base.Response.Write(s); base.Response.End(); } else if (this.siteSettings.GuidePageSet.Length > 10) { this.txtGuidePageSet.Text = this.siteSettings.GuidePageSet; } } this.enableGuidePageSet = this.siteSettings.EnableGuidePageSet; }
protected void btnSave_Click(object sender, EventArgs e) { this.siteSettings.GuidePageSet = this.txtGuidePageSet.Text.Trim(); website.GuidePageSet = this.txtGuidePageSet.Text.Trim(); bll.Update(website); //SettingsManager.Save(this.siteSettings); this.ShowMsg("修改成功", true); }
private void btnSave_Click(object sender, EventArgs e) { //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); string str = this.txtSiteName.Text.Trim(); if ((str.Length < 1) || (str.Length > 30)) { this.ShowMsg("请填写您的店铺名称,长度在30个字符以内", false); } else { string input = this.txtShopTel.Text.Trim(); if ((input.Length > 0) && !Regex.IsMatch(input, @"(^[0-9]{3,4}\-[0-9]{7,8}(\-[0-9]{2,4})?$)|(^[0-9]{7,8}$)|(^[0−9]3,4[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)|(13\d{9}$)|(15[0135-9]\d{8}$)|(1[4978][0-9]\d{8}$)|(^400(\-)?[0-9]{3,4}(\-)?[0-9]{3,4}$)")) { this.ShowMsg("请填写正确的手机或座机号码", false); } else { string str3 = this.txtShopIntroduction.Text.Trim(); if (str3.Length > 60) { this.ShowMsg("店铺介绍的长度不能超过60个字符", false); } else { //masterSettings.SiteName = str; //masterSettings.ShopIntroduction = str3; //masterSettings.ShopTel = input; //SettingsManager.Save(masterSettings); website.sitename = str; website.description = str3; website.tel = input; bll.Update(website); if (!string.IsNullOrEmpty(this.hidpicdel.Value)) { foreach (string str4 in this.hidpicdel.Value.Split(new char[] { '|' })) { if (!(str4 == "http://fpoimg.com/70x70")) { string path = str4; path = base.Server.MapPath(path); if (File.Exists(path)) { File.Delete(path); } } } } this.hidpicdel.Value = ""; this.ShowMsg("修改成功", true); } } } }
public void setenable(HttpContext context) { string s = "{\"status\":\"1\"}"; Chenduo.BLL.sf_website bll = new Chenduo.BLL.sf_website(); Chenduo.Model.sf_website website = bll.GetModelByWid(wid); //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false,wid); //masterSettings.EnableShopMenu = bool.Parse(context.Request["enable"]); website.EnableShopMenu = bool.Parse(context.Request["enable"]); //SettingsManager.Save(masterSettings); bll.Update(website); context.Response.Write(s); }
protected void SaveBtn_Click(object sender, EventArgs e) { Chenduo.BLL.sf_website bll = new Chenduo.BLL.sf_website(); Chenduo.Model.sf_website website = bll.GetModelByWid(wid); if (string.IsNullOrEmpty(this.txt_entid.Text)) { this.ShowMsg("请输入ent号码!", false); } website.entId = this.txt_entid.Text; if (bll.Update(website)) { this.ShowMsg("保存成功", true); } else { this.ShowMsg("保存失败", false); } }
protected void btnSave_Click(object sender, EventArgs e) { Chenduo.BLL.sf_website bll; Chenduo.Model.sf_website website; bll = new Chenduo.BLL.sf_website(); website = bll.GetModelByWid(wid); SiteSettings masterSettings = SettingsManager.GetMasterSettings(false, wid); masterSettings.ManageOpenID = this.txtManageOpenID.Text.Trim(); website.ManageOpenID = this.txtManageOpenID.Text.Trim(); if (bll.Update(website)) //SettingsManager.Save(masterSettings); { this.ShowMsg("保存成功", true); } else { this.ShowMsg("保存失败", false); } }
protected void btnSave_Click(object sender, EventArgs e) { //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); //if (masterSettings.WeixinAppId != this.txtAppId.Text.Trim()) //{ // WeiXinHelper.ClearWeiXinMediaID(); //} //masterSettings.WeixinAppId = this.txtAppId.Text.Trim(); //masterSettings.WeixinAppSecret = this.txtAppSecret.Text.Trim(); //SettingsManager.Save(masterSettings); //this.ShowMsg("修改成功", true); if (website.appid != this.txtAppId.Text.Trim()) { WeiXinHelper.ClearWeiXinMediaID(this.wid); } website.appid = this.txtAppId.Text.Trim(); website.appsecret = this.txtAppSecret.Text.Trim(); bll.Update(website); this.ShowMsg("修改成功", true); }
private void SaveData() { if (string.IsNullOrEmpty(this.fkContent.Text)) { this.ShowMsg("请输入内容!", false); } Chenduo.BLL.sf_website bll = new Chenduo.BLL.sf_website(); Chenduo.Model.sf_website website = bll.GetModelByWid(wid); //this.siteSettings.OffLinePayContent = this.fkContent.Text; //SettingsManager.Save(this.siteSettings); website.OffLinePayContent = this.fkContent.Text; if (bll.Update(website)) { this.ShowMsgAndReUrl("保存成功", true, "OfflinePay.aspx"); } else { this.ShowMsgAndReUrl("保存失败", false, ""); } }
private void saveData() { if (string.IsNullOrEmpty(this.txt_appid.Text.Trim())) { this.ShowMsg("请输入appid!", false); } if (string.IsNullOrEmpty(this.txt_appsecret.Text.Trim())) { this.ShowMsg("请输入appsecret!", false); } if (string.IsNullOrEmpty(this.txt_key.Text.Trim())) { this.ShowMsg("请输入Key!", false); } if (string.IsNullOrEmpty(this.txt_mch_id.Text.Trim())) { this.ShowMsg("请输入mch_id!", false); } if (this.website.appid != this.txt_appid.Text.Trim()) { WeiXinHelper.ClearWeiXinMediaID(this.wid); } //this.siteSettings.WeixinAppId = this.txt_appid.Text.Trim(); //this.siteSettings.WeixinAppSecret = this.txt_appsecret.Text.Trim(); //this.siteSettings.WeixinPartnerKey = this.txt_key.Text.Trim(); //this.siteSettings.WeixinPartnerID = this.txt_mch_id.Text.Trim(); this.website.appid = this.txt_appid.Text.Trim(); this.website.appsecret = this.txt_appsecret.Text.Trim(); this.website.account_pay_key = this.txt_key.Text.Trim(); this.website.weixin_pay_account = this.txt_mch_id.Text.Trim(); //SettingsManager.Save(this.siteSettings); if (bll.Update(this.website)) { this.ShowMsg("保存成功!", true); } else { this.ShowMsg("保存失败!", false); } }
protected void Page_Load(object sender, EventArgs e) { wid = GetCurWebId(); if (string.IsNullOrEmpty(wid)) { return; } bll = new Chenduo.BLL.sf_website(); website = bll.GetModelByWid(wid); this.siteSettings = SettingsManager.GetMasterSettings(false, wid); this.action = Globals.RequestFormStr("action"); this._dataPath = this.Page.Request.MapPath("~/Pay/Cert"); if (!base.IsPostBack) { if (this.action == "setenable") { base.Response.Clear(); base.Response.ContentType = "application/json"; string s = "{\"type\":\"1\",\"tips\":\"操作成功!\"}"; try { this.siteSettings.EnableWeiXinRequest = Globals.RequestFormNum("enable") == 1; website.Enableweixinrequest = Globals.RequestFormStr("enable"); //SettingsManager.Save(this.siteSettings); bll.Update(website); } catch { s = "{\"type\":\"0\",\"tips\":\"操作失败!\"}"; } base.Response.Write(s); base.Response.End(); } this.labfilename.InnerText = (this.siteSettings.WeixinCertPath != "") ? ("已上传:" + this.siteSettings.WeixinCertPath.Substring(this.siteSettings.WeixinCertPath.LastIndexOf(@"\") + 1, (this.siteSettings.WeixinCertPath.Length - this.siteSettings.WeixinCertPath.LastIndexOf(@"\")) - 1)) : ""; this.txtCertPassword.Text = this.siteSettings.WeixinCertPassword; } this.enableWXRequest = this.siteSettings.EnableWeiXinRequest; }
public bool EnableTemp(string TempName, string wid) { if (string.IsNullOrEmpty(TempName)) { return(false); } //SiteSettings masterSettings = SettingsManager.GetMasterSettings(true); //masterSettings.VTheme = TempName; //SettingsManager.Save(masterSettings); Chenduo.BLL.sf_website bll = new Chenduo.BLL.sf_website(); Chenduo.Model.sf_website website = bll.GetModelByWid(wid); if (website == null) { return(false); } website.templatesNum = TempName; bll.Update(website); HiCache.Remove("TemplateFileCache"); return(true); }
protected void btnOK_Click(object sender, EventArgs e) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(false, wid); if (this.fileUploader.PostedFile.FileName != "") { if (!this.IsAllowableFileType(this.fileUploader.PostedFile.FileName)) { this.ShowMsg("请上传正确的文件", false); return; } string str = DateTime.Now.ToString("yyyyMMddhhmmss") + Path.GetFileName(this.fileUploader.PostedFile.FileName); this.fileUploader.PostedFile.SaveAs(Path.Combine(this._dataPath, str)); masterSettings.WeixinCertPath = Path.Combine(this._dataPath, str); website.WeixinCertPath = Path.Combine(this._dataPath, str); } masterSettings.WeixinCertPassword = this.txtCertPassword.Text; website.WeixinCertPassword = this.txtCertPassword.Text; //SettingsManager.Save(masterSettings); bll.Update(website); this.ShowMsg("设置成功", true); }
protected void Page_Load(object sender, EventArgs e) { wid = GetCurWebId(); if (string.IsNullOrEmpty(wid)) { return; } bll = new Chenduo.BLL.sf_website(); website = bll.GetModelByWid(wid); if (website == null) { return; } if (!this.Page.IsPostBack) { //int mid = Globals.GetCurrentManagerUserId(); //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); //if (string.IsNullOrEmpty(masterSettings.WeixinToken)) if (string.IsNullOrEmpty(website.token_value)) { website.token_value = this.CreateKey(8); //SettingsManager.Save(masterSettings); bll.Update(website); } //if (string.IsNullOrWhiteSpace(masterSettings.CheckCode)) //{ // masterSettings.CheckCode = this.CreateKey(20); // SettingsManager.Save(masterSettings); //} this.hdfCopyUrl.Value = this.txtUrl.Text = string.Format("http://{0}/api/wx.ashx?wid={1}", base.Request.Url.Host, this.wid /*this.txtToken.Text*/); this.hdfCopyToken.Value = this.txtToken.Text = website.token_value; this.txtAppId.Text = website.appid; this.txtAppSecret.Text = website.appsecret; } }
public void ProcessRequest(HttpContext context) { wid = context.Session[DTKeys.SESSION_WEB_ID] as string; if (string.IsNullOrEmpty(wid)) { return; } context.Response.ContentType = "text/plain"; try { string str = context.Request["type"].ToString(); //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); Chenduo.BLL.sf_website bll = new Chenduo.BLL.sf_website(); Chenduo.Model.sf_website website = bll.GetModelByWid(wid); switch (str) { case "0": { string str2 = context.Request["name"].ToString(); string str3 = context.Request["card"].ToString(); string str4 = context.Request["bank"].ToString(); //masterSettings.OfflinePay_BankCard_Name = str2; //masterSettings.OfflinePay_BankCard_CardNo = str3; //masterSettings.OfflinePay_BankCard_BankName = str4; break; } case "1": { string str5 = context.Request["mid"].ToString(); //masterSettings.OfflinePay_Alipay_id = str5; break; } case "2": { string str6 = context.Request["content"].ToString(); //masterSettings.OffLinePayContent = str6; website.OffLinePayContent = str6; break; } case "3": { string str7 = context.Request["mid"].ToString(); string str8 = context.Request["key"].ToString(); //masterSettings.ShenPay_mid = str7; //masterSettings.ShenPay_key = str8; break; } case "4": { string str9 = context.Request["mid"].ToString(); string str10 = context.Request["name"].ToString(); string str11 = context.Request["pid"].ToString(); string str12 = context.Request["key"].ToString(); website.Alipay_mid = str9; website.Alipay_mName = str10; website.Alipay_Pid = str11; website.Alipay_Key = str12; break; } case "5": { string str13 = context.Request["appid"].ToString(); string str14 = context.Request["appsecret"].ToString(); string str15 = context.Request["mch_id"].ToString(); string str16 = context.Request["key"].ToString(); //masterSettings.WeixinAppId = str13; //masterSettings.WeixinAppSecret = str14; //masterSettings.WeixinPartnerID = str15; //masterSettings.WeixinPartnerKey = str16; website.appid = str13; website.appsecret = str14; website.weixin_pay_account = str15; website.account_pay_key = str16; break; } case "6": { string str17 = context.Request["mid"].ToString(); string str18 = context.Request["md5"].ToString(); string str19 = context.Request["des"].ToString(); //masterSettings.ChinaBank_mid = str17; //masterSettings.ChinaBank_MD5 = str18; //masterSettings.ChinaBank_DES = str19; break; } case "7": { string str20 = context.Request["key"].ToString(); website.WeixinCertPassword = str20; break; } case "-1": { bool flag = bool.Parse(context.Request["enable"].ToString()); //货到付款 website.EnablePodRequest = flag?"1":"0"; break; } case "-2": { bool flag2 = bool.Parse(context.Request["enable"].ToString()); website.EnableOffLineRequest = flag2 ? "1" : "0"; break; } case "-3": { bool flag3 = bool.Parse(context.Request["enable"].ToString()); //masterSettings.EnableWapShengPay = flag3; break; } case "-4": { bool flag4 = bool.Parse(context.Request["enable"].ToString()); website.EnableAlipayRequest = flag4 ? "1" : "0"; break; } case "-5": { bool flag5 = bool.Parse(context.Request["enable"].ToString()); website.Enableweixinrequest = flag5 ? "1" : "0"; break; } case "-6": { bool flag6 = bool.Parse(context.Request["enable"].ToString()); //masterSettings.ChinaBank_Enable = flag6; break; } case "-7": { bool flag7 = bool.Parse(context.Request["enable"].ToString()); website.EnableWeixinRed = flag7? "1" : "0"; break; } } //SettingsManager.Save(masterSettings); bll.Update(website); context.Response.Write("保存成功"); } catch (Exception exception) { context.Response.Write("保存失败!(" + exception.Message + ")"); } }
protected void Page_Load(object sender, EventArgs e) { if (base.Request.QueryString["delimg"] != null) { string path = base.Server.HtmlEncode(base.Request.QueryString["delimg"]); path = base.Server.MapPath(path); if (File.Exists(path)) { File.Delete(path); } base.Response.Write("0"); base.Response.End(); } int num = int.Parse(base.Request.QueryString["imgurl"]); //string wid = base.Request.QueryString["webid"]; string wid = Session[DTKeys.SESSION_WEB_ID] as string; try { if (num < 1) { if (string.IsNullOrEmpty(wid)) { return; } Chenduo.BLL.sf_website bll = new Chenduo.BLL.sf_website(); Chenduo.Model.sf_website website = bll.GetModelByWid(wid); if (website == null) { return; } HttpPostedFile file = base.Request.Files["Filedata"]; string str2 = DateTime.Now.ToString("yyyyMMddHHmmss_ffff", DateTimeFormatInfo.InvariantInfo); string str3 = "/Storage/data/DistributorLogoPic/"; string str4 = str2 + Path.GetExtension(file.FileName); file.SaveAs(Globals.MapPath(str3 + str4)); base.Response.StatusCode = 200; base.Response.Write(str2 + "|/Storage/data/DistributorLogoPic/" + str4); //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); string distributorLogoPic = website.logo;//masterSettings.DistributorLogoPic; distributorLogoPic = base.Server.MapPath(distributorLogoPic); if (File.Exists(distributorLogoPic)) { File.Delete(distributorLogoPic); } /*masterSettings.DistributorLogoPic*/ website.logo = "/Storage/data/DistributorLogoPic/" + str4; //SettingsManager.Save(masterSettings); bll.Update(website); } else { base.Response.Write("0"); } } catch (Exception) { base.Response.StatusCode = 500; base.Response.Write("服务器错误"); base.Response.End(); } finally { base.Response.End(); } }
private void saveData() { Chenduo.BLL.sf_website bll = new Chenduo.BLL.sf_website(); Chenduo.Model.sf_website website = bll.GetModelByWid(wid); if (string.IsNullOrEmpty(this.txt_mid.Text)) { this.ShowMsg("请输入支付宝帐号!", false); } this.siteSettings.Alipay_mid = this.txt_mid.Text; website.Alipay_mid = this.txt_mid.Text; if (string.IsNullOrEmpty(this.txt_mName.Text)) { this.ShowMsg("请输入支付宝帐号姓名!", false); } this.siteSettings.Alipay_mName = this.txt_mName.Text; website.Alipay_mName = this.txt_mName.Text; if (string.IsNullOrEmpty(this.txt_pid.Text)) { this.ShowMsg("请输入合作者身份(PID)!", false); } this.siteSettings.Alipay_Pid = this.txt_pid.Text; website.Alipay_Pid = this.txt_pid.Text; if (string.IsNullOrEmpty(this.txt_key.Text)) { this.ShowMsg("请输入安全校验码(Key)!", false); } string text = string.Format("<xml><Partner>{0}</Partner><Key>{1}</Key><Seller_account_name>{2}</Seller_account_name></xml>", this.txt_pid.Text, this.txt_key.Text, this.txt_mid.Text); if (!string.IsNullOrWhiteSpace(this.txt_pid.Text) && !string.IsNullOrWhiteSpace(this.txt_key.Text)) { string.IsNullOrWhiteSpace(this.txt_mid.Text); } PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode("hishop.plugins.payment.ws_wappay.wswappayrequest", this.wid); if (paymentMode == null) { PaymentModeInfo info2 = new PaymentModeInfo { Name = "支付宝手机支付", Gateway = "hishop.plugins.payment.ws_wappay.wswappayrequest", Description = string.Empty, IsUseInpour = true, Charge = 0M, IsPercent = false, Settings = HiCryptographer.Encrypt(text), wid = this.wid }; if (SalesHelper.CreatePaymentMode(info2) == PaymentModeActionStatus.Success) { this.siteSettings.Alipay_Key = this.txt_key.Text; website.Alipay_Key = this.txt_key.Text; bll.Update(website); //SettingsManager.Save(this.siteSettings); this.ShowMsg("设置成功", true); } else { this.ShowMsg("设置失败", false); } } else { paymentMode.Settings = HiCryptographer.Encrypt(text); if (SalesHelper.UpdatePaymentMode(paymentMode) == PaymentModeActionStatus.Success) { this.siteSettings.Alipay_Key = this.txt_key.Text; website.Alipay_Key = this.txt_key.Text; bll.Update(website); //SettingsManager.Save(this.siteSettings); this.ShowMsg("设置成功", true); } else { this.ShowMsg("设置失败", false); } } }