/// <summary> /// 删除 /// </summary> private static string Delete(HttpContext context) { // if (!_isedit) // { // return null; // } string ids = context.Request["id"]; try { //删除流 bll.Delete(new WXFlowInfo(), string.Format("FlowID in({0}) ", ids)); //删除 bll.Delete(new WXFlowStepInfo(), string.Format("FlowID in({0}) ", ids)); bll.Delete(new WXFlowDataInfo(), string.Format("FlowID in({0}) ", ids)); return("true"); } catch (Exception ex) { return(ex.Message); } }
/// <summary> /// 删除 /// </summary> private static string Delete(HttpContext context) { try { string ids = context.Request["id"]; bll.Delete(new WeixinReplyRuleInfo(), string.Format("UID in({0}) ", ids)); return("true"); } catch (Exception ex) { return(ex.Message); } }
private static string Edit(HttpContext context) { //if (!_isedit) //{ // return null; //} try { var uid = context.Request["UID"]; //if (string.IsNullOrEmpty(userid)) //{ // return "请重新登录"; //} var keyword = context.Request["MsgKeyword"]; var matchType = context.Request["MatchType"]; var oldInfo = bll.Get <WeixinReplyRuleInfo>(string.Format("UID={0}", uid)); if (oldInfo.MsgKeyword != keyword)//对比关键字已经改变 { //关键字改变,检查关键字是否重复 if (!bll.CheckUserKeyword(websiteOwner, keyword)) { return("关键字重复"); } } var sourceType = context.Request["SourceType"]; var sourceIds = context.Request["SourceIds"]; var model = new WeixinReplyRuleInfo(); model.UID = uid; model.MsgKeyword = keyword; model.MatchType = matchType; model.ReceiveType = "news"; model.ReplyType = "news"; model.RuleType = 1; model.UID = context.Request["UID"]; model.UserID = websiteOwner; WeixinReplyRuleImgsInfo ruleImgsInfo; if (bll.Update(model))//规则表更新成功,更新图文表信息 { if (!string.IsNullOrEmpty(sourceIds)) { if (sourceType.Equals("imagelist"))//原有的图文表 { //更新图文列表 bll.Delete(new WeixinReplyRuleImgsInfo(), string.Format("RuleID='{0}' And UID Not IN ({1})", uid, sourceIds)); return("true"); } else if (sourceType.Equals("source"))//从素材表中选择 { //删除旧图片 bll.Delete(new WeixinReplyRuleImgsInfo(), string.Format("RuleID='{0}'", uid)); //添加新图片 foreach (var item in sourceIds.Split(',')) { var sourceInfo = bll.Get <WeixinMsgSourceInfo>(string.Format("SourceID='{0}'", item)); ruleImgsInfo = new WeixinReplyRuleImgsInfo(); ruleImgsInfo.UID = bll.GetGUID(BLLJIMP.TransacType.WeixinReplyRuleImgAdd); ruleImgsInfo.RuleID = model.UID; ruleImgsInfo.Title = sourceInfo.Title; ruleImgsInfo.Description = sourceInfo.Description; ruleImgsInfo.PicUrl = sourceInfo.PicUrl; ruleImgsInfo.Url = sourceInfo.Url; bll.Add(ruleImgsInfo); } return("true"); } } else { return("请选择素材"); } } else { return("更新规则表失败"); } } catch (Exception ex) { return(ex.Message); } return("false"); }