예제 #1
0
        /// <summary>
        /// 开启修改/新增模板View
        /// </summary>
        /// <param name="pIndex"></param>
        /// <returns></returns>
        public ActionResult TemplateEdit(string pIndex)
        {
            WeChatMessageService   pService = new WeChatMessageService("MP");
            TemplateMessageConfigM pEn      = pService.GetTemplateMessageSingle <TemplateMessageConfigM>(Convert.ToInt32(pIndex));
            EGExceptionResult      pResult  = pService.GetActionResult();

            if (pResult != null)
            {
                return(Json(pResult));
            }
            return(View("TemplateEdit", pEn));
        }
예제 #2
0
        /// <summary>
        /// 消息模板配置View加载
        /// </summary>
        /// <returns></returns>
        public ActionResult MessageConfig()
        {
            WeChatMessageService          pService = new WeChatMessageService("MP");
            List <TemplateMessageConfigM> pList    = pService.GetTemplateMessageList <TemplateMessageConfigM>();
            EGExceptionResult             pResult  = pService.GetActionResult();

            if (pResult != null)
            {
                return(Json(pResult));
            }
            return(View("MessageConfig", pList));
        }
예제 #3
0
        public ActionResult GetQYMsByFilter(string filterString)
        {
            WeChatMessageService pService = new WeChatMessageService("QY");
            List <WXGsMessageVM> pList    = pService.GetGsMessage <WXGsMessageVM>(filterString);
            EGExceptionResult    pResult  = pService.GetActionResult();

            //
            if (pResult != null)
            {
                return(Json(pResult));
            }
            return(Json(pList));
        }
예제 #4
0
        public ActionResult GetQYMs()
        {
            WeChatMessageService pService = new WeChatMessageService("QY");
            List <WXGsMessageVM> pList    = pService.GetAllGsMessage <WXGsMessageVM>();
            EGExceptionResult    pResult  = pService.GetActionResult();

            //
            if (pResult != null)
            {
                return(new EmptyResult());
            }
            return(Json(pList));
        }
예제 #5
0
        /// <summary>
        /// 发送企业消息
        /// </summary>
        /// <param name="messageid"></param>
        /// <param name="mediaid"></param>
        /// <param name="lcId"></param>
        /// <param name="msgtype"></param>
        /// <param name="toUser"></param>
        /// <param name="toParty"></param>
        /// <param name="toTag"></param>
        /// <param name="agentId"></param>
        /// <returns></returns>
        public ActionResult QYMsSend(string messageid, string keyW, string msgtype, string agentId, string toUser = "******", string toParty = "@all", string toTag = "@all", int safe = 0)
        {
            var pService = new WeChatMessageService("QY");

            pService.SendQYMessage(messageid, UserID, keyW, msgtype, toUser, toParty, toTag, agentId, safe);
            EGExceptionResult pResult = pService.GetActionResult();

            //
            if (pResult != null)
            {
                return(Json(pResult));
            }
            pResult = new EGExceptionResult(true, "", "");
            return(Json(pResult));
        }
예제 #6
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ActionResult TestSend()
        {
            var pService = new WeChatMessageService("QY");

            pService.SendQYMessage("", "", "1", "", "", "", "", "");
            EGExceptionResult pResult = pService.GetActionResult();

            //
            if (pResult != null)
            {
                return(Json(pResult));
            }
            pResult = new EGExceptionResult(true, "", "");
            return(Json(pResult));
        }
예제 #7
0
        public ActionResult GroupSendingByOpenID(string messageid, string mediaid, string textcontent, string msgtype, string sex)
        {
            WeChatMessageService pService = new WeChatMessageService("MP");

            pService.SendGroupMessageByOpenID(messageid, UserID, mediaid, textcontent, msgtype, sex);
            EGExceptionResult pResult = pService.GetActionResult();

            //
            if (pResult != null)
            {
                return(Json(pResult));
            }
            pResult = new EGExceptionResult(true, "", "");
            return(Json(pResult));
        }
예제 #8
0
        public ActionResult CreateGsMessage(string mediaid, int sendtype, string sendtarget, string textcontent, string msgtype)
        {
            WeChatMessageService pService = new WeChatMessageService("MP");

            pService.CreateGsMessage(UserID, mediaid, sendtype, sendtarget, textcontent, msgtype, 1, 0, 0);
            EGExceptionResult pResult = pService.GetActionResult();

            //
            if (pResult != null)
            {
                return(Json(pResult));
            }
            pResult = new EGExceptionResult(true, "", "");
            return(Json(pResult));
        }
예제 #9
0
        /// <summary>
        /// 发送模板消息执行action_通过平台界面发送
        /// </summary>
        /// <returns></returns>
        public ActionResult MessageSend(WCTemplateBindingA model)
        {
            if (!ModelState.IsValid)
            {
                return(Content("填写错误,请重新输入!"));
            }

            WeChatMessageService pService = new WeChatMessageService("MP");

            //发送模板消息
            pService.SendTemplateMessage(model.OpenID, model.TemplateID, model.URL, model.TemData);
            EGExceptionResult pResult = pService.GetActionResult();

            if (pResult != null)
            {
                return(Json(pResult));
            }
            pResult = new EGExceptionResult(true, "", "");
            return(Json(pResult));
        }
예제 #10
0
        public ActionResult CreateGsMessage(GsMessageVM gsMegVM)
        {
            WeChatMessageService pService = new WeChatMessageService("QY");

            pService.CreateGsMessage(UserID, gsMegVM.MediaId, 1, gsMegVM.ToTarget, gsMegVM.Content, gsMegVM.MsgType, 2, gsMegVM.AgentId, gsMegVM.Safe);
            EGExceptionResult pResult = pService.GetActionResult();

            if (pResult != null)
            {
                return(Json(pResult));
            }

            //if (gsMegVM.FuncID != 0 && gsMegVM.FuncType != 0)
            //{
            //    gsMegVM.FuncID = 1;
            //    gsMegVM.FuncType = 1;
            //    FuncStatistic funcStatistic = new FuncStatistic();
            //    funcStatistic.AddStatisticList(gsMegVM.ToTarget, gsMegVM.FuncID.ToString(), gsMegVM.FuncType.ToString(), "86", UserID);

            //}
            pResult = new EGExceptionResult(true, "", "");
            return(Json(pResult));
        }
예제 #11
0
        /// <summary>
        /// 执行修改/新增模板action
        /// </summary>
        /// <param name="pModel"></param>
        /// <returns></returns>
        public ActionResult TemplateEdit(TemplateMessageConfigM pModel)
        {
            EGExceptionResult pResult;

            if (!ModelState.IsValid)
            {
                pResult = new EGExceptionResult(false, "请填写 * 项", ((int)EGActionCode.缺少必要参数).ToString());
                return(Json(pResult));
            }

            WeChatMessageService pService = new WeChatMessageService("MP");

            pService.UpdateTemplateMessageList <TemplateMessageConfigM>(pModel, pModel.ID);
            pResult = pService.GetActionResult();
            if (pResult != null)
            {
                return(Json(pResult));
            }
            else
            {
                pResult = new EGExceptionResult(true, "保存成功", ((int)EGActionCode.执行成功).ToString());
                return(Json(pResult));
            }
        }