Exemplo n.º 1
0
        /// <summary>
        /// 获取数据表格
        /// </summary>
        /// <param name="param"></param>
        /// <param name="LoginName"></param>
        /// <returns></returns>
        public DataTableDto GetData(DataTableDto param, string loginName, string userName, string phone)
        {
            var query = Sqldb.Select <sys_user>()
                        //.LeftJoin((u, r) => u.role_id == r.id)
                        .WhereIf(!loginName.IsEmpty(), u => u.login_name == loginName)
                        .WhereIf(!userName.IsEmpty(), u => u.user_name.Contains(userName))
                        .WhereIf(!phone.IsEmpty(), u => u.mobile_phone.Contains(phone))
                        .OrderByDescending(u => u.is_super)
                        .OrderByDescending(u => u.create_time)
                        .Count(out long total)
                        .Page(param.pageNumber, param.pageSize)
                        .ToList();

            if (query.Count > 0)
            {
                var roleIds = query.Where(s => s.role_id > 0).Select(s => s.role_id).ToList();
                if (roleIds.Count > 0)
                {
                    var roles = Sqldb.Select <sys_role>().Where(s => roleIds.Contains(s.id)).ToList();
                    query.ForEach(s =>
                    {
                        s.role_name = roles.Where(a => a.id == s.role_id).Select(a => a.role_name).FirstOrDefault();
                    });
                }
            }
            param.rows  = query;
            param.total = total;

            return(param);
        }
Exemplo n.º 2
0
        public IActionResult GetData(DataTableDto dto)
        {
            var user = RequestHelper.AdminInfo();
            var data = _noticeApp.GetList(dto, "", user);

            return(Json(data));
        }
Exemplo n.º 3
0
        public IActionResult GetReplyList(DataTableDto param)
        {
            var noticeId = RequestHelper.GetQueryInt("noticeId");
            var data     = _noticeApp.GetReplyList(param, noticeId);

            return(Json(data));
        }
Exemplo n.º 4
0
        public IActionResult LogData(DataTableDto dto)
        {
            string jobId = RequestHelper.GetPostString("jobId");
            var    data  = _logApp.GetLogPageList(dto, jobId);

            return(Json(data));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取数据列表
        /// </summary>
        /// <param name="param"></param>
        /// <param name="channelId">栏目</param>
        /// <param name="title">文章标题</param>
        /// <param name="status">审核状态</param>
        /// <param name="contentProperty">0-全部,1-置顶,2-推荐</param>
        /// <returns></returns>
        public DataTableDto GetData(DataTableDto param, int channelId, string title, int status, int contentProperty)
        {
            long total = 0;
            var  query = Sqldb.Select <cms_content>()
                         .WhereIf(channelId > 0, s => s.channel_id == channelId)
                         .WhereIf(status >= 0, s => s.content_status == status)
                         .WhereIf(!title.IsEmpty(), s => s.title.Contains(title));

            if (contentProperty == 1)
            {
                query = query.Where(s => s.is_top == 1);
            }
            else if (contentProperty == 2)
            {
                query = query.Where(s => s.is_recommend == 1);
            }
            var data = query.OrderByDescending(s => s.is_top)
                       .OrderByDescending(s => s.id)
                       .Page(param.pageNumber, param.pageSize)
                       .Count(out total)
                       .ToList();

            param.total = total;
            param.rows  = data;
            return(param);
        }
Exemplo n.º 6
0
        public IActionResult GetData(DataTableDto dto)
        {
            string tableName = RequestHelper.GetPostString("tableName");
            var    data      = codeGenApp.GetList(dto, tableName);

            return(Json(data));
        }
Exemplo n.º 7
0
        public IActionResult GetData(DataTableDto param)
        {
            var name = RequestHelper.GetQueryString("name");
            var data = _addressBookApp.GetList(param, name);

            return(Json(data));
        }
Exemplo n.º 8
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public DataTableDto GetData(DataTableDto dto, int loginStatus, string loginName, string loginIP, string startDate, string endDate)
        {
            var stime = DateTime.Now.AddMonths(-1);
            var etime = DateTime.Now;

            if (!startDate.IsEmpty())
            {
                stime = startDate.ToDate();
            }
            if (!endDate.IsEmpty())
            {
                etime = endDate.ToDate().AddDays(1);
            }
            var query = Sqldb.Select <login_info>()
                        .Where(s => s.request_time > stime && s.request_time < etime)
                        .WhereIf(loginStatus >= 0, s => s.login_status == loginStatus)
                        .WhereIf(!loginName.IsEmpty(), s => s.login_name == loginName)
                        .WhereIf(!loginIP.IsEmpty(), s => s.request_ip == loginIP)
                        .OrderByDescending(s => s.id)
                        .Count(out long total)
                        .Page(dto.pageNumber, dto.pageSize)
                        .ToList();

            dto.total = total;
            dto.rows  = query;
            return(dto);
        }
Exemplo n.º 9
0
        public ActionResult GetData(DataTableDto param)
        {
            string roleName = RequestHelper.GetPostString("roleName", "");
            string roleCode = RequestHelper.GetPostString("roleCode", "");
            var    data     = _roleApp.GetData(param, roleName, roleCode);

            return(Json(data));
        }
Exemplo n.º 10
0
        public ActionResult GetSonList(DataTableDto dto)
        {
            long   pid  = RequestHelper.GetPostInt64("pid", 0);
            string name = RequestHelper.GetPostString("name");
            var    list = _dicApp.GetSonList(dto, pid, name);

            return(Json(list));
        }
Exemplo n.º 11
0
        public ActionResult GetData(DataTableDto dto)
        {
            string dicCode = RequestHelper.GetPostString("dicCode");
            string dicName = RequestHelper.GetPostString("dicName");
            var    list    = _dicApp.GetData(dto, dicCode, dicName);

            return(Json(list));
        }
Exemplo n.º 12
0
        public IActionResult GetData(DataTableDto dto)
        {
            int    pid  = RequestHelper.GetPostInt("pid");
            string name = RequestHelper.GetPostString("templateName", "");
            var    data = _templateApp.GetData(dto, pid, name);

            return(Json(data));
        }
Exemplo n.º 13
0
        public ActionResult GetPageList(DataTableDto param)
        {
            string tableName = RequestHelper.GetPostString("tableName", "");
            string logDate   = RequestHelper.GetPostString("logDate", "");
            var    data      = sysSqlLogApp.GetPageList(param, tableName, logDate.ToDate());

            return(Json(data));
        }
Exemplo n.º 14
0
        public static string ToJson(this DataTableDto grid, string datetimeformats)
        {
            var timeConverter = new IsoDateTimeConverter {
                DateTimeFormat = datetimeformats
            };

            return(JsonConvert.SerializeObject(grid, Formatting.Indented, timeConverter));
        }
Exemplo n.º 15
0
        public ActionResult GetData(DataTableDto dto)
        {
            var log_type    = RequestHelper.GetQueryString("logType", "0").ToInt();
            var log_summary = RequestHelper.GetQueryString("log_summary", "");
            var logDate     = RequestHelper.GetQueryString("logDate", TimeHelper.FormatDate(DateTime.Now, "0"));
            var data        = _logApp.GetList(dto, log_type, log_summary, logDate.ToDate());

            return(Json(data));
        }
Exemplo n.º 16
0
        public DataTableDto GetList(DataTableDto param, string ntitle, LoginUserDto user)
        {
            long total = 0;
            var  query = new List <work_notice>();


            var deptId = 0;

            if (user.IsSuper)
            {
                query = Sqldb.Select <work_notice>()
                        .WhereIf(!string.IsNullOrEmpty(ntitle), s => s.n_title.Contains(ntitle))
                        .OrderByDescending(s => s.id).Count(out total).Page(param.page, param.limit)
                        .ToList();
            }
            else
            {
                query = Sqldb.Select <work_notice, work_notice_reply>()
                        .InnerJoin((n, r) => n.id == r.notice_id)
                        .Where((n, r) => r.dept_id == deptId)
                        .WhereIf(!string.IsNullOrEmpty(ntitle), (n, r) => n.n_title.Contains(ntitle))
                        .OrderByDescending((n, r) => n.id).Count(out total).Page(param.page, param.limit)
                        .ToList();
            }

            if (query.Count > 0)
            {
                var ids = query.Select(s => s.id).ToList();

                var repList = Sqldb.Queryable <work_notice_reply>()
                              .Where(s => ids.Contains(s.notice_id)).ToList();

                query.ForEach(s =>
                {
                    var noticeRefReplys = repList.Where(a => a.notice_id == s.id).ToList();
                    s.received_count    = noticeRefReplys.Where(a => a.reply_status == 1).Count();
                    s.unreceived_count  = noticeRefReplys.Where(a => a.reply_status == 0).Count();
                    if (user.IsSuper)
                    {
                        s.is_check = 1;
                    }
                    else
                    {
                        if (deptId > 0)
                        {
                            s.is_check = noticeRefReplys.Where(a => a.dept_id == deptId).OrderBy(a => a.id)
                                         .Select(a => a.reply_status).FirstOrDefault();
                        }
                    }
                });
            }
            param.total = total;
            param.rows  = query;

            return(param);
        }
Exemplo n.º 17
0
        public IActionResult GetData(DataTableDto dto)
        {
            int    channelId       = RequestHelper.GetPostInt("channelId");
            int    status          = RequestHelper.GetPostInt("status", -1);
            int    contentProperty = RequestHelper.GetPostInt("contentProperty", 0); //0-全部,1-置顶,2-推荐
            string title           = RequestHelper.GetPostString("title");
            var    data            = _contentApp.GetData(dto, channelId, title, status, contentProperty);

            return(Json(data));
        }
Exemplo n.º 18
0
        public ActionResult GetData(DataTableDto param)
        {
            //var data = new DataGridEx();

            string loginName = RequestHelper.GetPostString("loginName");
            string userName  = RequestHelper.GetPostString("userName");
            string phone     = RequestHelper.GetPostString("phone");
            var    data      = _userApp.GetData(param, loginName, userName, phone);

            return(Json(data));
        }
Exemplo n.º 19
0
 /// <summary>
 /// 任务执行日志
 /// </summary>
 /// <param name="dto"></param>
 /// <param name="jobId"></param>
 /// <returns></returns>
 public DataTableDto GetLogPageList(DataTableDto dto, string jobId)
 {
     var query = Sqldb.Select<crontab_history>()
         .Where(s => s.job_id == jobId)
        .OrderByDescending(s => s.id)
        .Count(out long total)
        .Page(dto.pageNumber, dto.pageSize).ToList();
     dto.total = total;
     dto.rows = query;
     return dto;
 }
Exemplo n.º 20
0
        public DataTableDto <Contracts> GetPages(int page, int size, string sort, string search)
        {
            var dataTable    = new DataTableDto <Contracts>();
            var contractList = UnitOfWork.GetRepository <Contracts>().GetAll()
                               .Where(x => (x.Id.ToString().Contains(search) || x.Name.Contains(search)) && x.IsDelete == false).ToList();
            var total = contractList.Count();

            dataTable.TotalElements = total;
            dataTable.Data          = contractList.Skip(page).Take(size).ToList();
            return(dataTable);
        }
Exemplo n.º 21
0
        public DataTableDto GetList(DataTableDto param)
        {
            var query = Sqldb.Select <hangfire_task>()
                        .OrderByDescending(s => s.excute_status)
                        .OrderByDescending(s => s.excute_time).Count(out long total)
                        .Page(param.page, param.limit).ToList();

            param.total = total;
            param.rows  = query;
            return(param);
        }
Exemplo n.º 22
0
        public IActionResult GetData(DataTableDto dto)
        {
            int    loginStatus = RequestHelper.GetPostInt("loginStatus", -1);
            string loginName   = RequestHelper.GetPostString("loginName");
            string loginIP     = RequestHelper.GetPostString("loginIP");
            string loginDate   = RequestHelper.GetPostString("loginDate");

            var data = loginInfoApp.GetData(dto, loginStatus, loginName, loginIP, loginDate);

            return(Json(data));
        }
Exemplo n.º 23
0
        public DataTableDto GetList(DataTableDto param, int logType, string log_summary, DateTime logDate)
        {
            var query = Sqldb.Select <easy_log>()
                        .Where(s => s.log_time >= logDate)
                        .WhereIf(logType > 0, s => s.log_type == logType)
                        .WhereIf(!string.IsNullOrEmpty(log_summary), s => s.log_summary == log_summary)
                        .OrderByDescending(s => s.id).Count(out long total).Page(param.pageNumber, param.pageSize).ToList();

            param.total = total;
            param.rows  = query;
            return(param);
        }
Exemplo n.º 24
0
        /// <summary>
        /// 数据列表
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public DataTableDto GetData(DataTableDto dto)
        {
            var query = Sqldb.Select <cms_ad>()
                        .OrderByDescending(s => s.id)
                        .Count(out long total)
                        .Page(dto.pageNumber, dto.pageSize)
                        .ToList();

            dto.rows  = query;
            dto.total = total;
            return(dto);
        }
Exemplo n.º 25
0
        /// <summary>
        /// 获取表格
        /// </summary>
        /// <param name="param"></param>
        /// <param name="tableName"></param>
        /// <returns></returns>
        public DataTableDto GetList(DataTableDto param, string tableName)
        {
            var query = Sqldb.Select <code_table>()

                        .WhereIf(!string.IsNullOrEmpty(tableName), s => s.table_name == tableName)
                        .OrderByDescending(s => s.update_time)
                        .Count(out long total)
                        .Page(param.page, param.limit).ToList();

            param.total = total;
            param.rows  = query;
            return(param);
        }
Exemplo n.º 26
0
        /// <summary>
        /// 字典数据
        /// </summary>
        /// <param name="dto"></param>
        /// <param name="pid"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public DataTableDto GetSonList(DataTableDto dto, long pid, string name)
        {
            var query = Sqldb.Queryable <sys_dictionary>()
                        .Where(s => s.parent_id == pid)
                        .WhereIf(!name.IsEmpty(), s => s.dic_name == name)
                        .OrderBy(s => s.sort_num)
                        .Count(out long total)
                        .Page(dto.page, dto.limit).ToList();

            dto.rows  = query;
            dto.total = total;
            return(dto);
        }
Exemplo n.º 27
0
        /// <summary>
        ///获取数据列表
        /// </summary>
        /// <param name="param"></param>

        public DataTableDto GetData(DataTableDto param)
        {
            long total = 0;
            var  query = Sqldb.Select <sys_position>()
                         .OrderBy(s => s.id)
                         .Page(param.pageNumber, param.pageSize)
                         .Count(out total)
                         .ToList();

            param.total = total;
            param.rows  = query;
            return(param);
        }
Exemplo n.º 28
0
        public DataTableDto GetReplyList(DataTableDto param, int noticeId)
        {
            long total  = 0;
            var  replys = Sqldb.Select <work_notice_reply>().Where(s => s.notice_id == noticeId)
                          .OrderByDescending(s => s.reply_time)
                          .Count(out total)
                          .Page(param.page, param.limit)
                          .ToList();

            param.total = total;
            param.rows  = replys;

            return(param);
        }
Exemplo n.º 29
0
        public DataTableDto GetList(DataTableDto param, string name)
        {
            long total = 0;
            var  query = Sqldb.Select <work_address_book>()
                         .WhereIf(!string.IsNullOrEmpty(name), s => s.real_name == name)
                         .OrderByDescending(s => s.id).Count(out total)
                         .Page(param.page, param.limit)
                         .ToList();

            param.total = total;
            param.rows  = query;

            return(param);
        }
Exemplo n.º 30
0
        /// <summary>
        /// 角色表格
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public DataTableDto GetData(DataTableDto param, string roleName, string roleCode)
        {
            var query = Sqldb.Queryable <sys_role>()
                        .WhereIf(!roleName.IsEmpty(), s => s.role_name.Contains(roleName))
                        .WhereIf(!roleCode.IsEmpty(), s => s.role_code.Contains(roleCode))
                        .OrderBy(s => s.role_sort)
                        .Count(out long total)
                        .Page(param.page, param.limit).ToList();

            param.total = total;
            param.rows  = query;

            return(param);
        }