public void ProcessRequest(HttpContext context) { string componentId = context.Request["component_id"]; if (string.IsNullOrEmpty(componentId)) { apiResp.msg = "component_id 为必填项,请检查"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound; bll.ContextResponse(context, apiResp); return; } BLLJIMP.Model.Component model = bll.Get <BLLJIMP.Model.Component>(string.Format(" WebsiteOwner='{0}' AND AutoId={1}", bll.WebsiteOwner, componentId)); if (model == null) { apiResp.msg = "没有找到组件"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound; bll.ContextResponse(context, apiResp); return; } apiResp.status = true; apiResp.result = new { component_id = model.AutoId, component_key = model.ComponentKey, component_name = model.ComponentName, component_model_id = model.ComponentModelId, child_component_ids = model.ChildComponentIds, component_config = model.ComponentConfig, decription = model.Decription, is_oauth = model.IsWXSeniorOAuth, access_level = model.AccessLevel }; bll.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { string componentId = context.Request["component_id"]; if (string.IsNullOrEmpty(componentId)) { apiResp.msg = "component_id 为必填项,请检查"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound; bll.ContextResponse(context, apiResp); return; } BLLJIMP.Model.Component model = bll.Get <BLLJIMP.Model.Component>(string.Format(" WebsiteOwner='{0}' AND AutoId={1}", bll.WebsiteOwner, componentId)); if (model == null) { apiResp.msg = "没有找到组件"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound; bll.ContextResponse(context, apiResp); return; } apiResp.status = true; if (!string.IsNullOrWhiteSpace(model.ComponentConfig)) { apiResp.result = JToken.Parse(model.ComponentConfig); //apiResp.result = ZentCloud.Common.JSONHelper.ObjectToJson(model.ComponentConfig); } bll.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { string orderId = context.Request["order_id"]; if (string.IsNullOrEmpty(orderId)) { apiResp.code = (int)APIErrCode.OperateFail; apiResp.msg = "order_id必传"; bll.ContextResponse(context, apiResp); return; } OrderPay orderPay = bllOrder.GetOrderPay(orderId); PayConfig payConfig = bllPay.GetPayConfig(); if (payConfig == null || string.IsNullOrEmpty(payConfig.WXAppId) || string.IsNullOrEmpty(payConfig.WXMCH_ID) || string.IsNullOrEmpty(payConfig.WXPartnerKey)) { apiResp.code = (int)APIErrCode.OperateFail; apiResp.msg = "该商户微信支付还没有配置"; bll.ContextResponse(context, apiResp); return; } string appId = payConfig.WXAppId; //微信AppId string mchId = payConfig.WXMCH_ID; //商户号 string key = payConfig.WXPartnerKey; //api密钥 string openId = CurrentUserInfo.WXOpenId; //openid string ip = context.Request.UserHostAddress; //ip string notifyUrl = string.Format("http://{0}/WxPayNotify/SmsRechargeNotify.aspx", context.Request.Url.Authority); //支付充值通知地址 string body = ""; //订单内容 string payReqStr = bllPay.GetBrandWcPayRequest(orderPay.OrderId, orderPay.Total_Fee, appId, mchId, key, openId, ip, notifyUrl, body); BllPay.WXPayReq payReqModel = ZentCloud.Common.JSONHelper.JsonToModel <BllPay.WXPayReq>(payReqStr); if (string.IsNullOrEmpty(payReqModel.paySign)) { apiResp.code = (int)APIErrCode.OperateFail; apiResp.msg = "构造支付信息失败"; bll.ContextResponse(context, apiResp); return; } apiResp.code = (int)APIErrCode.IsSuccess; apiResp.status = true; apiResp.result = new { pay_req = payReqModel }; bll.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { string idsString = context.Request["ids"]; List <string> ids = idsString.Split(',').ToList(); string path = context.Server.MapPath("/JsonConfig/xmlConfig/至云平台通用图标.xml"); XmlDocument doc = new XmlDocument(); doc.Load(path); StringBuilder sbSymbols = new StringBuilder(); foreach (string id in ids) { XmlNode node = doc.SelectSingleNode(string.Format("{0}/{1}[@{2}='{3}']", "symbols", "symbol", "id", id)); if (node != null) { sbSymbols.AppendFormat(node.OuterXml); } } apiResp.status = true; apiResp.msg = "查询完成"; apiResp.code = (int)APIErrCode.IsSuccess; apiResp.result = sbSymbols.ToString(); bll.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { if (bll.Delete(new PcPage(), string.Format(" PageId in({0})", context.Request["ids"])) > 0) { apiResp.status = true; } else { apiResp.msg = "删除失败"; } bll.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; StringBuilder sbWhere = new StringBuilder(string.Format(" WebSiteOwner='{0}'", bll.WebsiteOwner)); var slideData = bll.GetColList <BLLJIMP.Model.Slide>(int.MaxValue, 1, sbWhere.ToString(), "AutoID,Type"); var result = slideData.Select(p => p.Type).Distinct().OrderBy(p => p); apiResp.code = (int)APIErrCode.IsSuccess; apiResp.status = true; apiResp.result = result; bll.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { string componentId = context.Request["component_id"]; if (string.IsNullOrEmpty(componentId)) { apiResp.msg = "component_id 为必填项,请检查"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound; bll.ContextResponse(context, apiResp); return; } BLLJIMP.Model.Component model = bll.Get <BLLJIMP.Model.Component>(string.Format(" WebsiteOwner='{0}' AND AutoId={1}", bll.WebsiteOwner, componentId)); if (model == null) { apiResp.msg = "没有找到"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound; bll.ContextResponse(context, apiResp); return; } if (!string.IsNullOrWhiteSpace(model.ComponentKey)) { apiResp.msg = "禁止删除"; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail; bll.ContextResponse(context, apiResp); return; } if (bll.Delete(new BLLJIMP.Model.Component(), string.Format(" WebsiteOwner='{0}' AND AutoId={1}", bll.WebsiteOwner, componentId)) > 0) { apiResp.status = true; apiResp.msg = "ok"; } else { apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail; apiResp.msg = "删除出错"; } bll.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { var requestModel = ZentCloud.Common.JSONHelper.JsonToModel <ZentCloud.BLLJIMP.ModelGen.PcPage.PcPage>(context.Request["jsonData"]); PcPage model = bll.Get <PcPage>(string.Format("PageId={0}", requestModel.PageId)); model.PageName = requestModel.PageName; //页面名称 model.TopContent = requestModel.TopContent; //顶部内容 model.Logo = requestModel.Logo; //Logo model.BottomContent = requestModel.BottomContent; //底部内容 model.TopMenu = requestModel.TopMenu; //顶部菜单 model.MiddContent = ZentCloud.Common.JSONHelper.ObjectToJson(requestModel.MiddList); //中部列表 model.WebsiteOwner = bll.WebsiteOwner; //所有者 if (bll.Update(model)) { apiResp.status = true; } else { apiResp.msg = "添加失败"; } bll.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { var requestModel = ZentCloud.Common.JSONHelper.JsonToModel <ZentCloud.BLLJIMP.ModelGen.PcPage.PcPage>(context.Request["jsonData"]); PcPage model = new PcPage(); model.PageName = requestModel.PageName; //页面名称 model.TopContent = requestModel.TopContent; //顶部内容 model.Logo = requestModel.Logo; //Logo model.BottomContent = requestModel.BottomContent; //底部内容 model.TopMenu = requestModel.TopMenu; //顶部菜单 model.MiddContent = ZentCloud.Common.JSONHelper.ObjectToJson(requestModel.MiddList); //中部列表 model.WebsiteOwner = bll.WebsiteOwner; //所有者 model.PageId = int.Parse(bll.GetGUID(BLLJIMP.TransacType.CommAdd)); if (bll.Add(model)) { apiResp.status = true; } else { apiResp.msg = "添加失败"; } bll.ContextResponse(context, apiResp); }