Example #1
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 GETHYSMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int            Id    = int.Parse(P1);
            SZHL_HYGL_ROOM model = new SZHL_HYGL_ROOMB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId);

            var st = DateTime.Now;

            var list = new SZHL_HYGLB().GetEntities(p => p.ComId == UserInfo.User.ComId && p.RoomID == model.ID && p.IsDel == 0 && st < p.EndTime).OrderBy(p => p.StartTime);

            List <int> li = new List <int>();

            foreach (var l in list)
            {
                var pi = new Yan_WF_PIB().GetEntity(p => p.ComId == UserInfo.User.ComId && p.ID == l.intProcessStanceid);
                if (pi != null)
                {
                    if (pi.IsCanceled == "Y")
                    {
                        li.Add(l.ID);
                    }
                }
            }

            var list1 = list.Where(p => !li.Contains(p.ID));


            msg.Result  = model;
            msg.Result1 = list1;
        }
Example #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 DELHYS(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int            Id    = int.Parse(P1);
            int            ss    = int.Parse(P2);
            SZHL_HYGL_ROOM model = new SZHL_HYGL_ROOMB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId);

            model.IsDel   = ss;
            model.DelUser = UserInfo.User.UserName;
            model.DelDate = DateTime.Now;
            new SZHL_HYGL_ROOMB().Update(model);
        }
Example #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 ADDHYS(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            SZHL_HYGL_ROOM hys = JsonConvert.DeserializeObject <SZHL_HYGL_ROOM>(P1);

            if (string.IsNullOrEmpty(hys.Name))
            {
                msg.ErrorMsg = "会议室名称不能为空!";
            }
            //if (string.IsNullOrEmpty(hys.Location ))
            //{
            //    msg.ErrorMsg =msg.ErrorMsg+ "位置不能为空!";
            //}
            //if (string.IsNullOrEmpty(hys.AdminUser ))
            //{
            //    msg.ErrorMsg = msg.ErrorMsg + "管理员不能为空!";
            //}

            if (string.IsNullOrEmpty(msg.ErrorMsg))
            {
                if (hys.ID == 0)
                {
                    var hys1 = new SZHL_HYGL_ROOMB().GetEntity(p => p.ComId == UserInfo.User.ComId && p.Name == hys.Name);
                    if (hys1 != null)
                    {
                        msg.ErrorMsg = "系统已经存在此会议室名称!";
                    }
                    else
                    {
                        hys.CRDate = DateTime.Now;
                        hys.CRUser = UserInfo.User.UserName;
                        hys.ComId  = UserInfo.User.ComId;
                        hys.Status = "1";
                        hys.IsDel  = 0;
                        new SZHL_HYGL_ROOMB().Insert(hys);
                        msg.Result = hys;
                    }
                }
                else
                {
                    var hys1 = new SZHL_HYGL_ROOMB().GetEntity(p => p.ComId == UserInfo.User.ComId && p.Name == hys.Name && p.ID != hys.ID);
                    if (hys1 != null)
                    {
                        msg.ErrorMsg = "系统已经存在此会议室名称";
                    }
                    else
                    {
                        new SZHL_HYGL_ROOMB().Update(hys);
                        msg.Result = hys;
                    }
                }
            }
        }
Example #4
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 GETKYHYSLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            //var list = new SZHL_HYGL_ROOMB().GetEntities(p => p.Status == "1" && p.IsDel == 0);
            DataTable dt = new SZHL_HYGL_ROOMB().GetDTByCommand("select * from dbo.SZHL_HYGL_ROOM where IsDel=0 and Status='1' and ComId=" + UserInfo.User.ComId);

            dt.Columns.Add("ZT", Type.GetType("System.String"));
            dt.Columns.Add("ZYSJ", Type.GetType("System.String"));

            foreach (DataRow dr in dt.Rows)
            {
                int rid  = Int32.Parse(dr["ID"].ToString());
                var st   = DateTime.Now;
                var et   = DateTime.Now.AddHours(3);
                var list = new SZHL_HYGLB().GetEntities(p => p.RoomID == rid && p.IsDel == 0 && ((st >= p.StartTime && st < p.EndTime) || (et > p.StartTime && et <= p.EndTime) || (et > p.StartTime && st <= p.StartTime) || (et >= p.EndTime && st < p.EndTime)) && p.ComId == UserInfo.User.ComId).OrderBy(p => p.StartTime);

                List <int> li = new List <int>();

                foreach (var l in list)
                {
                    var pi = new Yan_WF_PIB().GetEntity(p => p.ComId == UserInfo.User.ComId && p.ID == l.intProcessStanceid);
                    if (pi != null)
                    {
                        if (pi.IsCanceled == "Y")
                        {
                            li.Add(l.ID);
                        }
                    }
                }

                var list1 = list.Where(p => !li.Contains(p.ID));

                if (list1.Count() == 0)
                {
                    dr["ZT"]   = "0";
                    dr["ZYSJ"] = "";
                }
                else
                {
                    dr["ZT"]   = "1";
                    dr["ZYSJ"] = list1.First().StartTime.Value.ToString("yyyy-MM-dd HH:mm") + "~" + list1.First().EndTime.Value.ToString("yyyy-MM-dd HH:mm");
                }
            }

            msg.Result = dt;
        }
Example #5
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);
        }
Example #6
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);
                }
            }
        }
Example #7
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); //时间为发送时间
                }
            }
        }