Beispiel #1
0
        /// <summary>
        /// 添加
        /// </summary>
        private static string Add(HttpContext context)
        {
            //if (!_isedit)
            //{
            //    return null;
            //}


            var userid = Comm.DataLoadTool.GetCurrUserID();

            if (string.IsNullOrEmpty(userid))
            {
                return("请重新登录");
            }
            var flowname    = context.Request["FlowName"];
            var flowkeyword = context.Request["FlowKeyword"];

            if (!bll.CheckUserKeyword(userid, flowkeyword))
            {
                return("关键字重复");
            }
            WXFlowInfo model = new WXFlowInfo();

            model.FlowID           = int.Parse(bll.GetGUID(TransacType.WeixinFlowAdd));
            model.UserID           = userid;
            model.FlowName         = flowname;
            model.FlowKeyword      = flowkeyword;
            model.FlowEndMsg       = context.Request["FlowEndMsg"];
            model.MemberLimitState = int.Parse(context.Request["MemberLimitState"]);
            model.FlowLimitMsg     = context.Request["FlowLimitMsg"];
            model.FlowSysType      = 1;
            model.IsEnable         = int.Parse(context.Request["IsEnable"]);
            return(bll.Add(model).ToString().ToLower());
        }
Beispiel #2
0
        /// <summary>
        /// 添加
        /// </summary>
        private static string Add(HttpContext context)
        {
            //if (!_isedit)
            //{
            //    return null;
            //}

            try
            {
                //var userid = websiteOwner; //Comm.DataLoadTool.GetCurrUserID();
                //if (string.IsNullOrEmpty(userid))
                //{
                //    return "请重新登录";
                //}
                var keyword   = context.Request["MsgKeyword"];
                var matchtype = context.Request["MatchType"];
                if (!bll.CheckUserKeyword(websiteOwner, keyword))
                {
                    return("关键字重复");
                }
                var model = new WeixinReplyRuleInfo();
                model.MsgKeyword  = keyword;
                model.MatchType   = matchtype;
                model.ReceiveType = "news";
                model.ReplyType   = "news";
                model.CreateDate  = DateTime.Now;
                model.RuleType    = 1;
                var sourceIds = context.Request["SourceIds"];
                model.UID    = bll.GetGUID(BLLJIMP.TransacType.WeixinReplyRuleAdd);
                model.UserID = websiteOwner;
                WeixinReplyRuleImgsInfo ruleImgsInfo;
                if (bll.Add(model))//规则表添加成功,往图文表插入
                {
                    if (!string.IsNullOrEmpty(sourceIds))
                    {
                        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");
                    }
                }
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }

            return("false");
        }
        /// <summary>
        /// 添加
        /// </summary>
        private static string Add(HttpContext context)
        {
            //if (!_isedit)
            //{
            //    return null;
            //}

            try
            {
                //var userid = websiteOwner;
                //if (string.IsNullOrEmpty(userid))
                //{
                //    return "请重新登录";
                //}
                var keyword   = context.Request["MsgKeyword"];
                var matchType = context.Request["MatchType"];
                if (!bll.CheckUserKeyword(websiteOwner, keyword))
                {
                    return("关键字重复");
                }
                var model = new WeixinReplyRuleInfo();
                model.MsgKeyword   = keyword;
                model.MatchType    = matchType;
                model.ReplyContent = context.Request["ReplyContent"];
                model.ReceiveType  = "text";
                model.ReplyType    = "text";
                model.CreateDate   = DateTime.Now;
                model.RuleType     = 1;
                model.UID          = bll.GetGUID(BLLJIMP.TransacType.WeixinReplyRuleAdd);
                model.UserID       = websiteOwner;
                return(bll.Add(model).ToString().ToLower());
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }

            //return "false";
        }