protected void Page_Load(object sender, EventArgs e) { wid = GetCurWebId(); if (string.IsNullOrEmpty(wid)) { return; } /*SF.BLL.sf_website*/ bll = new Chenduo.BLL.sf_website(); /*SF.Model.sf_website*/ website = bll.GetModelByWid(wid); if (website == null) { return; } this.btnSave.Click += new EventHandler(this.btnSave_Click); if (!base.IsPostBack) { //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); this.txtSiteName.Text = website.sitename; //masterSettings.SiteName; this.txtShopIntroduction.Text = website.description; //masterSettings.ShopIntroduction; this.txtShopTel.Text = website.tel; //masterSettings.ShopTel; this.hidpic.Value = website.logo; //masterSettings.DistributorLogoPic; if (!File.Exists(base.Server.MapPath(website.logo /*masterSettings.DistributorLogoPic*/))) { this.hidpic.Value = "http://fpoimg.com/70x70"; } } }
protected void Page_Load(object sender, EventArgs e) { wid = GetCurWebId(); 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; } Utility.RegisterTypeForAjax(typeof(ShopIndex)); if (!base.IsPostBack) { int port = base.Request.Url.Port; string str = (port == 80) ? "" : (":" + port.ToString()); this.showUrl = "http://" + base.Request.Url.Host + str + Globals.ApplicationPath + "/default.aspx?wid=" + this.wid; //SiteSettings masterSettings = SettingsManager.GetMasterSettings(true); //this.tempLatePath = masterSettings.VTheme; this.tempLatePath = website.templatesNum; this.DataBind(); } }
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 (!base.IsPostBack) { this.txt_appid.Text = website.appid; //this.siteSettings.WeixinAppId; this.txt_appsecret.Text = website.appsecret; //this.siteSettings.WeixinAppSecret; this.txt_key.Text = website.account_pay_key; //this.siteSettings.WeixinPartnerKey; this.txt_mch_id.Text = website.weixin_pay_account; //this.siteSettings.WeixinPartnerID; //this._enable = website.Enableweixinrequest.Equals("1") ? true : false;//website.state==0?true:false; } //this._enable = website.state;//this.siteSettings.EnableWeiXinRequest; this._enable = website.Enableweixinrequest == "1" ? true : 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"); 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 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) { DateTime today = DateTime.Today; DateTime beginDate = today.AddDays(-7.0); wid = GetCurWebId(); if (string.IsNullOrEmpty(wid)) { return; } if (!base.IsPostBack) { //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); //this.lbShopName.Text = masterSettings.SiteName; //this.imgLogo.Src = masterSettings.DistributorLogoPic; Chenduo.BLL.sf_website bll = new Chenduo.BLL.sf_website(); Chenduo.Model.sf_website website = bll.GetModelByWid(wid); this.lbShopName.Text = website.sitename; this.imgLogo.Src = website.logo; if (!File.Exists(base.Server.MapPath(website.logo /*masterSettings.DistributorLogoPic*/))) { this.imgLogo.Src = "http://fpoimg.com/80x80"; } int port = base.Request.Url.Port; string str = (port == 80) ? "" : (":" + port.ToString()); this.showUrl = "http://" + base.Request.Url.Host + str + Globals.ApplicationPath + "/default.aspx?wid=" + this.wid; DataRow drOne = ShopStatisticHelper.ShopGlobal_GetMemberCount(this.wid); DataRow row2 = ShopStatisticHelper.ShopGlobal_GetOrderCountByDate(today, this.wid); DataRow row3 = ShopStatisticHelper.ShopGlobal_GetOrderCountByDate(today.AddDays(-1.0), this.wid); this.WaitSendOrderQty = base.GetFieldValue(drOne, "WaitSendOrderQty"); this.OrderQty_Today = base.GetFieldValue(row2, "OrderQty"); this.OrderQty_Yesterday = base.GetFieldValue(row3, "OrderQty"); this.OrderAmountFee_Today = base.GetFieldDecimalValue(row2, "OrderAmountFee").ToString("N2"); this.OrderAmountFee_Yesterday = base.GetFieldDecimalValue(row3, "OrderAmountFee").ToString("N2"); this.ServiceOrderQty = base.GetFieldValue(drOne, "ServiceOrderQty"); this.lbServiceOrderQty.Text = this.ServiceOrderQty; if (this.ServiceOrderQty == "0") { this.lbServiceOrderQty.ForeColor = Color.Green; } else { this.lbServiceOrderQty.ForeColor = Color.Red; } this.GoodsQty = base.GetFieldValue(drOne, "GoodsQty"); this.MemberQty = base.GetFieldValue(drOne, "MemberQty"); this.DistributorQty = base.GetFieldValue(drOne, "DistributorQty"); this.LoadTradeDataList(beginDate, 7); this.rptDistributor.DataSource = ShopStatisticHelper.ShopGlobal_GetSortList_Distributor(beginDate, 8, this.wid); this.rptDistributor.DataBind(); this.rptMember.DataSource = ShopStatisticHelper.ShopGlobal_GetSortList_Member(beginDate, 8, this.wid); this.rptMember.DataBind(); } }
private void BtnSave_Click(object sender, EventArgs e) { IList <MenuInfo> initMenus = VShopHelper.GetInitMenus(this.wid); Hishop.Weixin.MP.Domain.Menu.Menu menu = new Hishop.Weixin.MP.Domain.Menu.Menu(); foreach (MenuInfo info in initMenus) { if ((info.Chilren == null) || (info.Chilren.Count == 0)) { menu.menu.button.Add(this.BuildMenu(info)); } else { SubMenu item = new SubMenu { name = info.Name }; foreach (MenuInfo info2 in info.Chilren) { item.sub_button.Add(this.BuildMenu(info2)); } menu.menu.button.Add(item); } } bll = new Chenduo.BLL.sf_website(); website = bll.GetModelByWid(this.wid); if (website == null) { return; } string json = JsonConvert.SerializeObject(menu.menu); //SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); //if (string.IsNullOrEmpty(masterSettings.WeixinAppId) || string.IsNullOrEmpty(masterSettings.WeixinAppSecret)) //{ // base.Response.Write("<script>alert('您的服务号配置存在问题,请您先检查配置!');location.href='PayConfig.aspx'</script>"); //} //else if (MenuApi.CreateMenus(JsonConvert.DeserializeObject<Token>(TokenApi.GetToken(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret)).access_token, json).Contains("\"ok\"")) //{ // this.ShowMsg("成功的把自定义菜单保存到了微信", true); //} if (string.IsNullOrEmpty(website.appid) || string.IsNullOrEmpty(website.appsecret)) { base.Response.Write("<script>alert('您的服务号配置存在问题,请您先检查配置!');location.href='PayConfig.aspx'</script>"); } else if (MenuApi.CreateMenus(JsonConvert.DeserializeObject <Token>(TokenApi.GetToken(website.appid, website.appsecret)).access_token, json).Contains("\"ok\"")) { this.ShowMsg("成功的把自定义菜单保存到了微信", true); } else { this.ShowMsg("操作失败!服务号配置信息错误或没有微信自定义菜单权限", false); } }
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); } }
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, ""); } }
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 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 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); } } }