/// <summary>
        /// 判断是否需要刷新
        /// </summary>
        /// <param name="reqP"></param>
        /// <returns></returns>
        public IActionResult GetUnReadCount(DataTablesRequsetDto reqP)
        {
            var userName = LoginUserHelper.GetLoginUserName(reqP.logonid, User.Identity.Name);
            var res      = boxBiz.GetUnReadCount(reqP, userName);

            return(Json(res));
        }
        public JsonResult DataTableList(DataTablesRequsetDto reqP)
        {
            var userName = LoginUserHelper.GetLoginUserName(reqP.logonid, User.Identity.Name);
            var res      = boxBiz.ListForDataTables(reqP, userName);

            return(Json(res));
        }
Esempio n. 3
0
        public BizListResultForDataTables <SignMessageBox> ListForDataTables(DataTablesRequsetDto reqP, string email)
        {
            var    emp     = getUserInfo(email);
            string toempid = emp.emp_id;//"TEST01";


            string formtype = SettingConfig.AllString;

            if (reqP.formtype != formtype)
            {
                formtype = roleService.getAppNameByChs(reqP.formtype);
            }

            int    limit     = reqP.length;
            int    start     = reqP.start;
            double page      = start / limit;
            int    pageIndex = Math.Ceiling(page).ObjToInt() + 1;//Sql Sugar 页从1开始!


            var timeSpan = reqP.timespan.Split("-");

            //零点日期
            var startD = new DateTime(timeSpan[0].ObjToInt(), timeSpan[1].ObjToInt(), timeSpan[2].ObjToInt());
            var endD   = new DateTime(timeSpan[3].ObjToInt(), timeSpan[4].ObjToInt(), timeSpan[5].ObjToInt());


            var res = Service.GetPageList(pageIndex, limit, toempid, startD, endD, formtype, reqP.msgstatus, reqP.msghandlestatus);

            return(new BizListResultForDataTables <SignMessageBox>
            {
                data = res.Rows,
                draw = reqP.draw + 1,
                recordsFiltered = res.total,
                recordsTotal = res.total,
                unReadCount = res.Code
            });

            //Expression<Func<SignMessageBox, object>> orderByExpression = p => p.createtime;
            //Expression<Func<SignMessageBox, bool>> whereExpression = buildWhereExpreesion(reqP, userName);

            //var res = Service.GetPageList(start, limit);
            //return new BizListResultForDataTables<SignMessageBox>
            //{
            //    data = res.Rows,
            //    draw = reqP.draw + 1,
            //    recordsFiltered = res.total,
            //    recordsTotal = res.total
            //};
        }
Esempio n. 4
0
        public BizResult <SignMessageBox> GetUnReadCount(DataTablesRequsetDto reqP, string email)
        {
            var    emp     = getUserInfo(email);
            string toempid = emp.emp_id;//"TEST01";

            var timeSpan = reqP.timespan.Split("-");
            //零点日期
            var startD = new DateTime(timeSpan[0].ObjToInt(), timeSpan[1].ObjToInt(), timeSpan[2].ObjToInt());
            var endD   = new DateTime(timeSpan[3].ObjToInt(), timeSpan[4].ObjToInt(), timeSpan[5].ObjToInt());

            string formtype = SettingConfig.AllString;

            if (reqP.formtype != formtype)
            {
                formtype = roleService.getAppNameByChs(reqP.formtype);
            }

            return(Service.GetUnReadCount(toempid, startD, endD, formtype, HandleStatusString.Undo, (int)ReadStatusEnum.UnRead));
        }
Esempio n. 5
0
        /// <summary>
        /// DataTable
        /// </summary>
        /// <param name="reqP"></param>
        /// <returns></returns>
        public BizListResultForDataTables <SignMessageRole> ListForDataTables(DataTablesRequsetDto reqP1)
        {
            int ordertype = 0;
            int limit     = reqP1.length;
            int start     = reqP1.start;

            if (string.IsNullOrEmpty(reqP1.orderString)) //排序方式为空, 倒序
            {
                ordertype = 1;
            }

            Expression <Func <SignMessageRole, bool> >   whereExpression   = null;
            Expression <Func <SignMessageRole, object> > orderByExpression = p => new { p.isshow, p.createtime };

            var res = Service.GetPageList(start, limit, orderByExpression, ordertype, whereExpression);

            return(new BizListResultForDataTables <SignMessageRole>
            {
                data = res.Rows,
                draw = reqP1.draw + 1,
                recordsFiltered = res.total,
                recordsTotal = res.total
            });
        }
Esempio n. 6
0
        public JsonResult DataTableList(DataTablesRequsetDto reqP)
        {
            var res = roleBiz.ListForDataTables(reqP);

            return(Json(res));
        }