public void ProcessRequest(HttpContext context) { var website = bllWebsite.GetWebsiteInfoModelFromDataBase(); int num = 30; string url = string.Empty; if (HttpContext.Current.Request.Url.Host.ToString().Contains("localhost")) { num = 1; url = "https://open-api-sandbox.shop.ele.me/token"; } else { url = "https://open-api.shop.ele.me/token"; } if (!string.IsNullOrWhiteSpace(website.ElemeAccessToken) && website.ElemeTokenLastUpdateDate.Value.AddDays(num) > DateTime.Now) { apiResp.result = website.ElemeAccessToken; } else { Authorize model = new Authorize(website.ElemeAppKey, website.ElemeAppSecret); AuthorizeResponse toKenModel = model.GetToken(url); website.ElemeAccessToken = toKenModel.access_token; website.ElemeTokenLastUpdateDate = DateTime.Now; bllWebsite.Update(website); apiResp.result = website.ElemeAccessToken; } apiResp.status = true; context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp)); }
protected void Page_Load(object sender, EventArgs e) { config = bll.GetCompanyWebsiteConfig(); toolBars = bllCompanyWebSite.GetToolBarList(int.MaxValue, 1, bllCompanyWebSite.WebsiteOwner, null, null, false) .OrderBy(p => p.KeyType).Select(p => p.KeyType).Distinct().ToList(); slides = bllSlide.GetCurrWebsiteAllTypeList(); #region 会员标准字段 List <TableFieldMapping> baseFieldList = bllTableFieldMap.GetTableFieldMap(null, "ZCJ_UserInfo"); List <TableFieldMapping> webFieldList = bllTableFieldMap.GetTableFieldMap(bllTableFieldMap.WebsiteOwner, "ZCJ_UserInfo", null, null, true); foreach (var item in baseFieldList) { if (fieldList.Exists(p => p.Value == item.Field)) { continue; } TableFieldMapping nWebFieldItem = webFieldList.FirstOrDefault(p => p.Field == item.Field); fieldList.Add(new ListItem { Value = item.Field, Text = nWebFieldItem == null ? item.MappingName : nWebFieldItem.MappingName, Selected = nWebFieldItem != null && nWebFieldItem.IsDelete == 0 ? true:false }); } List <string> baseFieldStringList = baseFieldList.Select(p => p.Field).ToList(); foreach (var item in webFieldList.Where(p => !baseFieldStringList.Contains(p.Field))) { if (fieldList.Exists(p => p.Value == item.Field)) { continue; } fieldList.Add(new ListItem { Value = item.Field, Text = item.MappingName, Selected = item.IsDelete == 0 ? true : false }); } #endregion 会员标准字段 currentWebsiteInfo = bll.GetWebsiteInfoModelFromDataBase(); List <CompanyWebsite_ToolBar> dataList = bll.GetColList <CompanyWebsite_ToolBar>(int.MaxValue, 1, string.Format(" WebsiteOwner = '{0}'", bll.WebsiteOwner), "AutoID,KeyType,BaseID"); ArticleGroups = dataList.OrderBy(p => p.KeyType).Select(p => p.KeyType).Distinct().ToList(); if (!string.IsNullOrEmpty(config.LoginConfigJson)) { JTokenLogin = JToken.Parse(config.LoginConfigJson); } }
/// <summary> /// 设置短信余额提醒 /// </summary> /// <param name="context"></param> public void ProcessRequest(HttpContext context) { string smsRemindValue = context.Request["sms_remind_value"]; string smsRemindPhones = context.Request["sms_remind_phones"]; string smsRemindFrequency = context.Request["sms_remind_frequency"]; var website = bllWebsite.GetWebsiteInfoModelFromDataBase(); website.SmsAccountRemindValue = Convert.ToInt32(smsRemindValue); website.SmsAccountRemindPhones = smsRemindPhones; website.SmsAccountRemindFrequency = Convert.ToInt32(smsRemindFrequency); if (bllWebsite.Update(website)) { apiResp.msg = "设置成功"; apiResp.status = true; } else { apiResp.msg = "设置出错"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail; } context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp)); }
protected void Page_Load(object sender, EventArgs e) { templatename = bll.GetWebsiteInfoModelFromDataBase().CompanyWebSiteTemplateName; TemplateList = bll.GetCompanyWebsiteTemplateList(); }
protected void Page_Load(object sender, EventArgs e) { websiteOwner = BLLJIMP.BLLStatic.bll.WebsiteOwner; webSite = bllWebsite.GetWebsiteInfoModelFromDataBase(); }