Esempio n. 1
0
        public void SENDWXMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            var tx = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);

            int msgid = Int32.Parse(tx.MsgID);

            var model = new SZHL_XXFBB().GetEntity(p => p.ID == msgid);

            UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, model.CRUser);
            if (model != null)
            {
                var item = new SZHL_XXFB_ITEMB().GetEntities(d => d.XXFBId == model.ID);
                if (item.Count() > 0)
                {
                    List <Article> Msgs = new List <Article>();
                    foreach (var v in item)
                    {
                        new JH_Auth_User_CenterB().SendMsg(UserInfo, "XXFB", model.CRUserName + "发布了一个企业信息", v.ID.ToString(), model.JSUser);

                        Article ar = new Article();
                        ar.Title       = v.XXTitle;
                        ar.Description = v.XXTitle;
                        ar.PicUrl      = v.ImageIds.Split(',')[0];
                        ar.Url         = v.ID.ToString();
                        Msgs.Add(ar);
                    }

                    WXHelp wx = new WXHelp(UserInfo.QYinfo);
                    wx.SendTH(Msgs, "XXFB", "A", model.JSUser);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 分享链接的信息
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void SENDWXMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            var tx    = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);
            int msgid = Int32.Parse(tx.MsgID);

            UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, tx.CRUser);

            var model = new JH_Auth_WXMSGB().GetEntity(p => p.ID == msgid && p.ComId == UserInfo.User.ComId);

            if (model != null)
            {
                Article ar0 = new Article();
                ar0.Title       = model.Title;
                ar0.Description = "您收到了" + tx.CRUserRealName + "创建的话题信息,请查阅";
                ar0.Url         = model.ID.ToString();
                ar0.PicUrl      = model.FileId;

                List <Article> al = new List <Article>();
                al.Add(ar0);

                string jsr = string.Empty;
                jsr = model.CRUser;
                //发送消息
                //string content = ar0.Description;
                //new JH_Auth_User_CenterB().SendMsg(UserInfo, "CRM", content, model.ID.ToString(), jsr, "A");
                if (!string.IsNullOrEmpty(jsr))
                {
                    WXHelp wx = new WXHelp(UserInfo.QYinfo);
                    wx.SendTH(al, "TSSQ", "D", jsr);
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 发送微信信息
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void SENDXZMSG(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            SZHL_TXSX TX  = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);
            Article   ar0 = new Article();

            ar0.Title       = TX.TXContent;
            ar0.Description = "";
            ar0.Url         = TX.MsgID;

            List <Article> al = new List <Article>();

            al.Add(ar0);
            if (!string.IsNullOrEmpty(TX.TXUser))
            {
                try
                {
                    //发送PC消息
                    UserInfo = new JH_Auth_UserB().GetUserInfo(TX.ComId.Value, TX.CRUser);
                    WXHelp wx = new WXHelp(UserInfo.QYinfo);
                    wx.SendTH(al, TX.TXMode, "A", TX.TXUser);
                    new JH_Auth_User_CenterB().SendMsg(UserInfo, TX.TXMode, TX.TXContent, TX.MsgID, TX.TXUser);
                }
                catch (Exception)
                {
                }
                //发送微信消息
            }
        }
Esempio n. 4
0
        public void LCSPCHECK(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            SZHL_TXSX TX = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);

            //todo 需要根据PID找到对应的数据ID
            Article ar0 = new Article();

            ar0.Title       = TX.TXContent;
            ar0.Description = "";
            ar0.Url         = TX.MsgID;
            List <Article> al = new List <Article>();

            al.Add(ar0);
            JH_Auth_UserB.UserInfo UserTXInfo = new JH_Auth_UserB().GetUserInfo(TX.ComId.Value, TX.CRUser);
            if (!string.IsNullOrEmpty(TX.TXUser))
            {
                try
                {
                    //发送PC消息
                    new JH_Auth_User_CenterB().SendMsg(UserTXInfo, TX.TXMode, TX.TXContent, TX.MsgID, TX.TXUser, "A", TX.intProcessStanceid, TX.ISCS);
                }
                catch (Exception)
                {
                }

                //发送微信消息
                WXHelp wx = new WXHelp(UserTXInfo.QYinfo);
                wx.SendTH(al, TX.TXMode, "A", TX.TXUser);
            }
        }
Esempio n. 5
0
        public void SENDZANMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            var tx    = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);
            int msgid = Int32.Parse(tx.MsgID);

            UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, tx.CRUser);

            var model = new SZHL_TSSQB().GetEntity(p => p.ID == msgid && p.ComId == UserInfo.User.ComId);

            if (model != null)
            {
                Article ar0 = new Article();
                ar0.Title       = "您收到一个赞";
                ar0.Description = "话题:" + CommonHelp.RemoveHtml(model.HTNR) + "\r\n来自:" + UserInfo.User.UserRealName;
                ar0.Url         = model.ID.ToString();
                List <Article> al = new List <Article>();
                al.Add(ar0);

                string jsr = string.Empty;
                jsr = model.CRUser;

                if (!string.IsNullOrEmpty(jsr))
                {
                    WXHelp wx = new WXHelp(UserInfo.QYinfo);
                    wx.SendTH(al, "TSSQ", "A", jsr);
                }
            }
        }
Esempio n. 6
0
        public void TSGLMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            SZHL_TXSX TX   = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);
            int       rwid = 0;

            int.TryParse(TX.MsgID, out rwid);
            SZHL_TSGL jy = new SZHL_TSGLB().GetEntity(d => d.ID == rwid);

            Article ar0 = new Article();

            ar0.Title       = TX.TXContent;
            ar0.Description = jy == null ? "" : jy.TSName;
            ar0.Url         = TX.MsgID;
            List <Article> al = new List <Article>();

            al.Add(ar0);
            if (!string.IsNullOrEmpty(TX.TXUser))
            {
                try
                {
                    //发送PC消息
                    UserInfo = new JH_Auth_UserB().GetUserInfo(TX.ComId.Value, TX.CRUser);
                    new JH_Auth_User_CenterB().SendMsg(UserInfo, TX.TXMode, TX.TXContent, TX.MsgID, TX.TXUser, "A", 0, TX.ISCS);
                }
                catch (Exception)
                {
                }
            }

            //发送微信消息
            WXHelp wx = new WXHelp(UserInfo.QYinfo);

            wx.SendTH(al, TX.TXMode, "A", TX.TXUser);
        }
Esempio n. 7
0
        public void SENDWXMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            var tx = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);

            int msgid = Int32.Parse(tx.MsgID);

            var qyhd = new SZHL_QYHDNB().GetEntity(p => p.ID == msgid);

            UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, qyhd.CRUser);
            if (qyhd != null)
            {
                ////发送消息
                string content = qyhd.FQF + "发起了以(" + qyhd.Title + ")为主题的" + (qyhd.Type == 0 ? "活动" : "投票");
                new JH_Auth_User_CenterB().SendMsg(UserInfo, "QYHD", content, qyhd.ID.ToString(), qyhd.CYR, qyhd.Type == 1 ? "A" : "B");

                ////发送微信消息
                Article ar = new Article();
                ar.Title       = content;
                ar.Description = "";
                //ar.PicUrl = qyhd.
                ar.Url = qyhd.ID.ToString();

                List <Article> Msgs = new List <Article>();
                Msgs.Add(ar);
                WXHelp wx = new WXHelp(UserInfo.QYinfo);
                wx.SendTH(Msgs, "QYHD", "B", qyhd.CYR);
            }
        }
Esempio n. 8
0
        public void SENDMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int     Id         = int.Parse(P1);
            var     model      = new SZHL_YCGLB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId);
            string  strContent = "发起人:" + new JH_Auth_UserB().GetUserRealName(UserInfo.User.ComId.Value, model.CRUser) + "\r\n驾驶人:" + new JH_Auth_UserB().GetUserRealName(UserInfo.User.ComId.Value, model.JSR) + "\r\n您有新的用车通知,请尽快查看";
            Article ar0        = new Article();

            ar0.Title       = "用车通知";
            ar0.Description = strContent;
            ar0.Url         = model.ID.ToString();
            List <Article> al = new List <Article>();

            al.Add(ar0);
            //new JH_Auth_User_CenterB().SendMsg(UserInfo, "HYGL", strContent, model.ID.ToString(), model.JSR, "B", model.intProcessStanceid);

            WXHelp wx = new WXHelp(UserInfo.QYinfo);

            wx.SendTH(al, "YCGL", "A", model.JSR);
        }
Esempio n. 9
0
        public void SENDHTMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            var tx    = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);
            int msgid = Int32.Parse(tx.MsgID);

            UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, tx.CRUser);

            var model = new SZHL_TSSQB().GetEntity(p => p.ID == msgid && p.ComId == UserInfo.User.ComId);

            if (model != null)
            {
                Article ar0 = new Article();

                ar0.Title       = UserInfo.User.UserRealName + "发表了新话题";
                ar0.Description = CommonHelp.RemoveHtml(model.HTNR);
                ar0.Url         = model.ID.ToString();
                if (!string.IsNullOrEmpty(model.Files))
                {
                    ar0.PicUrl = model.Files.Split(',')[0];
                }
                List <Article> al = new List <Article>();
                al.Add(ar0);

                string jsr = string.Empty;
                if (!string.IsNullOrEmpty(model.CYR))
                {
                    jsr = model.CYR;
                }
                else
                {
                    jsr = new JH_Auth_UserB().GetEntities(p => p.ComId == UserInfo.QYinfo.ComId).Select(d => d.UserName).ToList().ListTOString(',');
                }
                //发送消息
                string content = ar0.Description;
                new JH_Auth_User_CenterB().SendMsg(UserInfo, "TSSQ", content, model.ID.ToString(), jsr, "A");
                if (!string.IsNullOrEmpty(jsr))
                {
                    WXHelp wx = new WXHelp(UserInfo.QYinfo);
                    wx.SendTH(al, "TSSQ", "A", jsr);
                }
            }
        }
Esempio n. 10
0
        public void SENDMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int Id    = int.Parse(P1);
            var model = new SZHL_HYGLB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId);
            var rm    = new SZHL_HYGL_ROOMB().GetEntity(p => p.ID == model.RoomID && p.ComId == UserInfo.User.ComId);

            Article ar0 = new Article();

            ar0.Title       = "会议通知";
            ar0.Description = "发起人:" + new JH_Auth_UserB().GetUserRealName(UserInfo.User.ComId.Value, model.CRUser) + "\r\n您有新的会议[" + model.Title + "],会议室[" + rm.Name + "],请尽快查看吧";
            ar0.Url         = model.ID.ToString();
            List <Article> al = new List <Article>();

            al.Add(ar0);
            //new JH_Auth_User_CenterB().SendMsg(UserInfo, "HYGL", strContent, model.ID.ToString(), model.JSR, "B", model.intProcessStanceid);

            WXHelp wx = new WXHelp(UserInfo.QYinfo);

            wx.SendTH(al, "HYGL", "A", model.CYUser);
        }
Esempio n. 11
0
        public void SENDWQMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            var tx    = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);
            int msgid = Int32.Parse(tx.MsgID);

            UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, tx.CRUser);

            var model = new SZHL_WQQDB().GetEntity(p => p.ID == msgid && p.ComId == UserInfo.User.ComId);

            if (model != null)
            {
                Article ar0 = new Article();

                ar0.Title       = "外勤签到提醒";
                ar0.Description = "签到人:" + UserInfo.User.UserRealName + "\r\n签到位置:" + model.Position + "\r\n签到备注:" + CommonHelp.RemoveHtml(model.QDContent) + "\r\n签到时间:" + model.CRDate;
                ar0.Url         = model.ID.ToString();
                if (!string.IsNullOrEmpty(model.Files))
                {
                    ar0.PicUrl = model.Files.Split(',')[0];
                }
                List <Article> al = new List <Article>();
                al.Add(ar0);

                string jsr = string.Empty;
                if (!string.IsNullOrEmpty(model.HBUser))
                {
                    jsr = model.HBUser;

                    //发送消息
                    string content = ar0.Description;
                    new JH_Auth_User_CenterB().SendMsg(UserInfo, "WQQD", content, model.ID.ToString(), jsr, "A");
                    if (!string.IsNullOrEmpty(jsr))
                    {
                        WXHelp wx = new WXHelp(UserInfo.QYinfo);
                        wx.SendTH(al, "WQQD", "A", jsr);
                    }
                }
            }
        }
Esempio n. 12
0
        //发送审核消息
        public void SENDWXMSG_CHECK(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            var tx    = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);
            int ID    = Int32.Parse(tx.MsgID);
            var model = new SZHL_XXFBB().GetEntity(p => p.ID == ID);

            UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, model.CRUser);
            if (model != null)
            {
                if (model.SHStatus == 0 || model.SHStatus == 1) //如果已处理,则不再发消息
                {
                    string  wxflag = "B";                       //审核页面
                    string  JSUser = "";
                    Article ar0    = new Article();
                    if (model.SHStatus == 0)
                    {
                        JSUser    = model.SHUser;
                        ar0.Title = model.CRUserName + "发布了一个企业信息,请您审核";
                    }
                    else if (model.SHStatus == 1)
                    {
                        ar0.Title = new JH_Auth_UserB().GetUserRealName(UserInfo.QYinfo.ComId, model.SHUser) + "审核了一个企业信息,请您确认发布";
                        JSUser    = model.CRUser;
                        wxflag    = "C"; //发布确认页面
                    }
                    ar0.Description = "";
                    ar0.Url         = model.XXFBType.ToString();

                    List <Article> al = new List <Article>();
                    al.Add(ar0);

                    WXHelp wx = new WXHelp(UserInfo.QYinfo);
                    new JH_Auth_User_CenterB().SendMsg(UserInfo, "XXFB", ar0.Title, model.ID.ToString(), JSUser, wxflag);
                    wx.SendTH(al, "XXFB", wxflag, JSUser);
                }
            }
        }
Esempio n. 13
0
        /// <summary>
        /// 会议发送提醒信息
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void SENDWXMSG_TX(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            var tx    = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);
            int msgid = Int32.Parse(tx.MsgID);

            UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, tx.CRUser);

            var model = new SZHL_HYGLB().GetEntity(p => p.ID == msgid && p.ComId == UserInfo.User.ComId);

            if (model != null)
            {
                var     rm  = new SZHL_HYGL_ROOMB().GetEntity(p => p.ID == model.RoomID && p.ComId == UserInfo.User.ComId);
                Article ar0 = new Article();
                ar0.Title       = "会议提醒";
                ar0.Description = "发起人:" + UserInfo.User.UserRealName + "\r\n您有会议[" + model.Title + "],会议室[" + rm.Name + "],将于" + model.StartTime.Value.ToString("yyyy-MM-dd HH:mm") + "开始,请及时参加";
                ar0.Url         = model.ID.ToString();

                List <Article> al = new List <Article>();
                al.Add(ar0);

                string jsr = string.Empty;
                if (!string.IsNullOrEmpty(model.FQUser))
                {
                    jsr = model.FQUser;
                }
                if (!string.IsNullOrEmpty(model.CYUser))
                {
                    if (!string.IsNullOrEmpty(jsr))
                    {
                        jsr = jsr + "," + model.CYUser;
                    }
                    else
                    {
                        jsr = model.CYUser;
                    }
                }
                if (!string.IsNullOrEmpty(model.ZCUser))
                {
                    if (!string.IsNullOrEmpty(jsr))
                    {
                        jsr = jsr + "," + model.ZCUser;
                    }
                    else
                    {
                        jsr = model.ZCUser;
                    }
                }
                if (!string.IsNullOrEmpty(model.JLUser))
                {
                    if (!string.IsNullOrEmpty(jsr))
                    {
                        jsr = jsr + "," + model.JLUser;
                    }
                    else
                    {
                        jsr = model.JLUser;
                    }
                }
                if (!string.IsNullOrEmpty(model.SXUser))
                {
                    if (!string.IsNullOrEmpty(jsr))
                    {
                        jsr = jsr + "," + model.SXUser;
                    }
                    else
                    {
                        jsr = model.SXUser;
                    }
                }

                ////发送消息
                string content = ar0.Description;
                new JH_Auth_User_CenterB().SendMsg(UserInfo, "HYGL", content, model.ID.ToString(), jsr, "B", model.intProcessStanceid, tx.ISCS);
                if (!string.IsNullOrEmpty(jsr))
                {
                    WXHelp wx = new WXHelp(UserInfo.QYinfo);
                    wx.SendTH(al, "HYGL", "A", jsr);
                }
            }
        }
Esempio n. 14
0
        /// <summary>
        /// 会议管理发送消息
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void SENDWXMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            var tx    = JsonConvert.DeserializeObject <SZHL_TXSX>(P1);
            int msgid = Int32.Parse(tx.MsgID);

            UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, tx.CRUser);
            var model = new SZHL_HYGLB().GetEntity(p => p.ID == msgid && p.ComId == UserInfo.User.ComId);

            if (model != null)
            {
                var     user = new JH_Auth_UserB().GetUserByUserName(model.ComId.Value, model.CRUser);
                var     rm   = new SZHL_HYGL_ROOMB().GetEntity(p => p.ID == model.RoomID && p.ComId == UserInfo.User.ComId);
                Article ar0  = new Article();
                ar0.Title       = "会议通知";
                ar0.Description = "发起人:" + user.UserRealName + "\r\n您有新的会议[" + model.Title + "],会议室[" + rm.Name + "],请尽快查看吧";
                ar0.Url         = model.ID.ToString();

                List <Article> al = new List <Article>();
                al.Add(ar0);

                string jsr = string.Empty;
                if (!string.IsNullOrEmpty(model.FQUser))
                {
                    jsr = model.FQUser;
                }
                if (!string.IsNullOrEmpty(model.CYUser))
                {
                    if (!string.IsNullOrEmpty(jsr))
                    {
                        jsr = jsr + "," + model.CYUser;
                    }
                    else
                    {
                        jsr = model.CYUser;
                    }
                }
                if (!string.IsNullOrEmpty(model.ZCUser))
                {
                    if (!string.IsNullOrEmpty(jsr))
                    {
                        jsr = jsr + "," + model.ZCUser;
                    }
                    else
                    {
                        jsr = model.ZCUser;
                    }
                }
                if (!string.IsNullOrEmpty(model.JLUser))
                {
                    if (!string.IsNullOrEmpty(jsr))
                    {
                        jsr = jsr + "," + model.JLUser;
                    }
                    else
                    {
                        jsr = model.JLUser;
                    }
                }
                if (!string.IsNullOrEmpty(model.SXUser))
                {
                    if (!string.IsNullOrEmpty(jsr))
                    {
                        jsr = jsr + "," + model.SXUser;
                    }
                    else
                    {
                        jsr = model.SXUser;
                    }
                }

                UserInfo = new JH_Auth_UserB().GetUserInfo(model.ComId.Value, model.CRUser);
                if (!string.IsNullOrEmpty(jsr))
                {
                    //发送消息
                    string content = user.UserRealName + "邀请您参加会议:" + model.Title;
                    new JH_Auth_User_CenterB().SendMsg(UserInfo, "HYGL", content, model.ID.ToString(), jsr, "B", model.intProcessStanceid, tx.ISCS);

                    WXHelp wx = new WXHelp(UserInfo.QYinfo);
                    wx.SendTH(al, "HYGL", "A", jsr);
                }

                if (model.TXSJ > 0)
                {
                    DateTime  dt  = model.StartTime.ToDateTime().AddMinutes(-model.TXSJ.Value);
                    SZHL_TXSX tx1 = new SZHL_TXSX();
                    tx1.ComId   = model.ComId;
                    tx1.APIName = "HYGL";
                    tx1.MsgID   = model.ID.ToString();
                    tx1.FunName = "SENDWXMSG_TX";
                    tx1.Date    = dt.ToString("yyyy-MM-dd HH:mm:ss");
                    tx1.CRUser  = model.CRUser;
                    tx1.CRDate  = DateTime.Now;
                    TXSX.TXSXAPI.AddALERT(tx1); //时间为发送时间

                    //TXSX.TXSXAPI.AddALERT(UserInfo.User.ComId.Value, "HYGL", "SENDWXMSG_TX", model.ID.ToString(), dt); //时间为发送时间
                }
            }
        }
Esempio n. 15
0
        public static void AUTOALERT()
        {
            lock (islock)
            {
                var txLst = new SZHL_TXSXB().GetEntities(p => p.Status == "0");

                foreach (var model in txLst)
                {
                    try
                    {
                        bool canclose = false; //是否结束
                        bool cansend  = false; //是否发送提醒
                        bool upcount  = false; //是否更新次数
                        switch (model.TXType)
                        {
                        case "0":      //立即发送
                        {
                            cansend  = true;
                            canclose = true;
                            upcount  = true;
                        }
                        break;

                        case "1":      //仅一次
                        {
                            DateTime sd = DateTime.Parse(model.Date + " " + model.Hour + ":" + model.Minute + ":00");
                            if (DateTime.Now >= sd)
                            {
                                cansend  = true;
                                canclose = true;
                                upcount  = true;
                            }
                        }
                        break;

                        case "2":      //每个工作日
                        {
                            DateTime sd = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " " + model.Hour + ":" + model.Minute + ":00");

                            if ((DateTime.Now.DayOfWeek == DayOfWeek.Monday ||
                                 DateTime.Now.DayOfWeek == DayOfWeek.Tuesday ||
                                 DateTime.Now.DayOfWeek == DayOfWeek.Wednesday ||
                                 DateTime.Now.DayOfWeek == DayOfWeek.Thursday ||
                                 DateTime.Now.DayOfWeek == DayOfWeek.Friday
                                 ) && DateTime.Now > sd && (model.LstSendTime == null || model.LstSendTime.Value.ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd")))
                            {
                                upcount = true;
                            }
                        }
                        break;

                        case "3":      //每天
                        {
                            DateTime sd = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " " + model.Hour + ":" + model.Minute + ":00");

                            if ((DateTime.Now > sd && (model.LstSendTime == null || model.LstSendTime.Value.ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd"))))
                            {
                                upcount = true;
                            }
                        }
                        break;

                        case "5":      //每月
                        {
                            DateTime sd = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-" + model.Days + " " + model.Hour + ":" + model.Minute + ":00");

                            if ((DateTime.Now > sd && (model.LstSendTime == null || model.LstSendTime.Value.ToString("yyyy-MM") != DateTime.Now.ToString("yyyy-MM"))))
                            {
                                upcount = true;
                            }
                        }
                        break;

                        case "4":      //自定义
                        {
                            string Days = model.Days;
                            foreach (var d in Days.Split(','))
                            {
                                if (getWkDays(d) == DateTime.Now.DayOfWeek)
                                {
                                    DateTime sd = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " " + model.Hour + ":" + model.Minute + ":00");
                                    if ((DateTime.Now > sd && (model.LstSendTime == null || model.LstSendTime.Value.ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd"))))
                                    {
                                        upcount = true;
                                    }
                                }
                            }
                        }
                        break;
                        }
                        if (upcount)
                        {
                            if (model.CFType == "1")
                            {
                                cansend = true;
                            }
                            else if (model.CFType == "2" && model.CFCount.Value > model.ZXCount) //次数
                            {
                                cansend = true;
                                if (model.CFCount.Value == model.ZXCount.Value + 1) //到次数,可以结束
                                {
                                    canclose = true;
                                }
                            }
                            else if (model.CFType == "3" && DateTime.Now < model.CFJZDate.Value)
                            {
                                cansend = true;
                            }

                            new SZHL_TXSXB().ExsSql("update SZHL_TXSX set ZXCount=isnull(ZXCount,0)+1,LstSendTime='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where ID=" + model.ID);
                        }
                        if (cansend)
                        {
                            bool smsg   = false;
                            bool swx    = false;
                            bool swxapi = false;
                            if (model.Type == "0") //短信和微信
                            {
                                smsg = true;
                                swx  = true;
                            }
                            else if (model.Type == "1")  //短信
                            {
                                smsg = true;
                            }
                            else if (model.Type == "2") //微信
                            {
                                swx = true;
                            }
                            else if (model.Type == "3")  //调接口
                            {
                                swxapi = true;
                            }

                            if (smsg)  //发短信
                            {
                                foreach (var m in model.TXUser.Split(','))
                                {
                                    object u = new SZHL_TXSXB().ExsSclarSql("select mobphone from JH_Auth_User where UserName='******' and comid='" + model.ComId + "'");
                                    if (u != null)
                                    {
                                        new SZHL_DXGLB().SendSMS(u.ToString(), model.CRUserRealName + "给您添加了提醒\n" + model.TXContent, model.ComId.Value);
                                    }
                                }
                            }
                            if (swx) //发微信
                            {
                                Article a = new Article();
                                a.Title = "日程提醒";

                                a.Description = model.CRUserRealName + "给您添加了提醒\n" + model.TXContent;
                                a.Url         = model.ID.ToString();

                                List <Article> al = new List <Article>();
                                al.Add(a);
                                JH_Auth_UserB.UserInfo UserInfo = new JH_Auth_UserB().GetUserInfo(model.ComId.Value, model.CRUser);

                                try
                                {
                                    new JH_Auth_User_CenterB().SendMsg(UserInfo, model.TXMode, model.TXContent, model.ID.ToString(), model.TXUser, "A", 0, model.ISCS);
                                }
                                catch (Exception)
                                {
                                }

                                WXHelp wx = new WXHelp(UserInfo.QYinfo);
                                wx.SendTH(al, model.TXMode, model.WXLink, model.TXUser);
                            }
                            if (swxapi)  //调接口
                            {
                                try
                                {
                                    Msg_Result Model = new Msg_Result()
                                    {
                                        Action = model.FunName, ErrorMsg = ""
                                    };

                                    // 1.Load(命名空间名称),GetType(命名空间.类名)
                                    Type type = Assembly.Load("QJY.API").GetType("QJY.API." + model.APIName + "Manage");
                                    //2.GetMethod(需要调用的方法名称)
                                    MethodInfo method = type.GetMethod(model.FunName.ToUpper());
                                    // 3.调用的实例化方法(非静态方法)需要创建类型的一个实例
                                    object obj = Activator.CreateInstance(type);
                                    //4.方法需要传入的参数
                                    JObject  JsonData   = new JObject();
                                    object[] parameters = new object[] { JsonData, Model, JsonConvert.SerializeObject(model), "", null };
                                    method.Invoke(obj, parameters);
                                    //TEST
                                }
                                catch (Exception ex)
                                {
                                    canclose = true;
                                    new JH_Auth_LogB().Insert(new JH_Auth_Log()
                                    {
                                        LogType    = "TXSX",
                                        LogContent = ex.ToString(),
                                        CRDate     = DateTime.Now
                                    });
                                }
                            }
                        }
                        if (canclose)
                        {
                            new SZHL_TXSXB().ExsSql("update SZHL_TXSX set Status='1' where ID=" + model.ID);
                        }
                    }
                    catch (Exception ex)
                    {
                        string ss = ex.Message;
                    }
                }
            }
        }