Example #1
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);
        }
Example #2
0
        public void REBACKTS(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int JYId = int.Parse(P2);

            new SZHL_TSGL_TSB().UPSTATUS(P1, "0", UserInfo.User.ComId.ToString());
            SZHL_TSGL jygl = new SZHL_TSGLB().GetEntity(d => d.ID == JYId && d.ComId == UserInfo.User.ComId);

            jygl.BackDate = DateTime.Now;
            jygl.BackBZ   = (jygl.BackBZ + "," + P1).TrimStart(',');
            new SZHL_TSGLB().Update(jygl);


            //发送归还提醒
            SZHL_TXSX TX = new SZHL_TXSX();

            TX.Date           = DateTime.Now.ToString();
            TX.APIName        = "JYGL";
            TX.ComId          = UserInfo.User.ComId;
            TX.FunName        = "TSGLMSG";
            TX.TXMode         = "JYGL";
            TX.CRUserRealName = UserInfo.User.UserRealName;
            TX.MsgID          = JYId.ToString();
            TX.TXContent      = "您好:" + UserInfo.User.UserRealName + ",您借阅的图书(" + jygl.TSName + ")已归还";
            TX.TXUser         = jygl.JYR;
            TX.CRUser         = UserInfo.User.UserName;
            TXSX.TXSXAPI.AddALERT(TX); //时间为发送时间
        }
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 GETJYGLMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int Id    = int.Parse(P1);
            var model = new SZHL_TSGLB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId);

            if (model != null)
            {
                msg.Result = model;
                if (!string.IsNullOrEmpty(model.Files))
                {
                    msg.Result1 = new FT_FileB().GetEntities(" ID in (" + model.Files + ")");
                }
                if (model.TSID != null)
                {
                    msg.Result2 = new SZHL_TSGL_TSB().GetEntities(" ID IN (" + model.TSID + ") ");
                }

                new JH_Auth_User_CenterB().ReadMsg(UserInfo, model.ID, "TSGL");
            }
        }
Example #4
0
        public void SENDTXMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int Id = 0;

            int.TryParse(P1, out Id);
            SZHL_TSGL jygl = new SZHL_TSGLB().GetEntity(d => d.ID == Id);

            if (jygl != null)
            {
                SZHL_TXSX TX = new SZHL_TXSX();
                TX.Date           = DateTime.Now.ToString();
                TX.APIName        = "JYGL";
                TX.ComId          = UserInfo.User.ComId;
                TX.FunName        = "TSGLMSG";
                TX.TXMode         = "JYGL";
                TX.CRUserRealName = UserInfo.User.UserRealName;
                TX.MsgID          = P1;
                TX.TXContent      = "您好:" + UserInfo.User.UserRealName + ",请尽快归还图书(" + jygl.TSName + ")";
                TX.TXUser         = jygl.JYR;
                TX.CRUser         = UserInfo.User.UserName;
                TXSX.TXSXAPI.AddALERT(TX); //时间为发送时间
            }
        }
Example #5
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 GETJYGLLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            string userName = UserInfo.User.UserName;
            string strWhere = " 1=1 and jy.ComId=" + UserInfo.User.ComId;


            string strContent = context.Request["Content"] ?? "";

            strContent = strContent.TrimEnd();
            if (strContent != "")
            {
                strWhere += string.Format(" And ( jy.TSName like '%{0}%')", strContent);
            }
            int DataID = -1;

            int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id
            if (DataID != -1)
            {
                string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("JYGL", DataID, UserInfo);
                if (strIsHasDataQX == "Y")
                {
                    strWhere += string.Format(" And jy.ID = '{0}'", DataID);
                }
            }

            if (P1 != "")
            {
                int page      = 0;
                int pagecount = 8;
                int.TryParse(context.Request["p"] ?? "1", out page);
                int.TryParse(context.Request["pagecount"] ?? "8", out pagecount);//页数
                page = page == 0 ? 1 : page;
                int total = 0;

                DataTable dt = new DataTable();
                switch (P1)
                {
                case "0":     //手机单条数据
                {
                    //设置usercenter已读
                    new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "JYGL");
                }
                break;

                case "1":     //创建的
                {
                    strWhere += " And jy.CRUser ='******'";
                }
                break;

                case "2":     //待审核
                {
                    var intProD = new Yan_WF_PIB().GetDSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList();
                    if (intProD.Count > 0)
                    {
                        strWhere += " And jy.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")";
                    }
                    else
                    {
                        strWhere += " And 1=0";
                    }
                }
                break;

                case "3":      //已审核
                {
                    var intProD = new Yan_WF_PIB().GetYSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList();
                    if (intProD.Count > 0)
                    {
                        strWhere += " And jy.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")";
                    }
                    else
                    {
                        strWhere += " And 1=0";
                    }
                }
                break;
                }

                dt = new SZHL_TSGLB().GetDataPager("SZHL_TSGL jy ", "jy.*,dbo.fn_PDStatus(jy.intProcessStanceid) AS StateName", pagecount, page, " jy.CRDate desc", strWhere, ref total);

                if (dt.Rows.Count > 0)
                {
                    dt.Columns.Add("FileList", Type.GetType("System.Object"));
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (dr["Files"] != null && dr["Files"].ToString() != "")
                        {
                            dr["FileList"] = new FT_FileB().GetEntities(" ID in (" + dr["Files"].ToString() + ")");
                        }
                    }
                }
                msg.Result  = dt;
                msg.Result1 = total;
            }
        }