Beispiel #1
0
        /// <summary>
        /// 操作日志数据列表
        /// </summary>
        /// <param name="search">查询搜索条件</param>
        /// <returns></returns>
        public ActionResult List(SearchHelperModel search)
        {
            Expression <Func <OperationLog, bool> > whereLambda = (l => true);

            if (!string.IsNullOrWhiteSpace(search.SearchItem1)) // 日志模块名称
            {
                whereLambda = whereLambda.And((l => l.LogModule == search.SearchItem1.Trim()));
            }
            if (!string.IsNullOrWhiteSpace(search.SearchItem2)) // 日志内容
            {
                whereLambda = whereLambda.And(l => l.LogContent.Contains(search.SearchItem2.Trim()));
            }
            try
            {
                var logList = operationLogHelper.Paged(search.PageIndex, search.PageSize,
                                                       whereLambda, l => l.OperTime, false);
                var dataList = logList.ToPagedList();
                return(View(dataList));
            }
            catch (Exception ex)
            {
                Logger.Error("ex");
                throw ex;
            }
        }
        /// <summary>
        /// 预约记录数据页
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public ActionResult ReservationList(SearchHelperModel search)
        {
            Expression <Func <Reservation, bool> > whereLambda = (m =>
                                                                  DbFunctions.DiffDays(DateTime.Today, m.ReservationForDate) <= 7 &&
                                                                  DbFunctions.DiffDays(DateTime.Today, m.ReservationForDate) >= 0);
            var rowsCount = 0;

            //补充查询条件
            //根据预约日期查询
            if (!String.IsNullOrEmpty(search.SearchItem0))
            {
                whereLambda = (m =>
                               DbFunctions.DiffDays(DateTime.Parse(search.SearchItem0), m.ReservationForDate) == 0);
            }
            //根据预约人联系方式查询
            if (!String.IsNullOrEmpty(search.SearchItem1))
            {
                whereLambda = (m => m.ReservationPersonPhone.Contains(search.SearchItem1));
            }
            //load data
            var list = new BLLReservation().GetReservationList(search.PageIndex, search.PageSize, out rowsCount,
                                                               whereLambda, m => m.ReservationForDate, m => m.ReservationTime, false, false);
            var dataList = list.ToPagedList(search.PageIndex, search.PageSize, rowsCount);

            return(View(dataList));
        }
        /// <summary>
        /// 加载系统设置数据
        /// </summary>
        /// <param name="search">分页信息,查询条件</param>
        /// <returns></returns>
        public ActionResult List(SearchHelperModel search)
        {
            //默认查询所有
            Expression <Func <SystemSettings, bool> > whereLambda = (s => true);

            if (!string.IsNullOrEmpty(search.SearchItem1))
            {
                whereLambda = (s => s.SettingName.Contains(search.SearchItem1));
            }
            var settingsList = _systemSettingHelper.Paged(search.PageIndex, search.PageSize,
                                                          whereLambda, s => s.SettingName);
            var data = settingsList.ToPagedList();

            return(View(data));
        }
        public ActionResult UserListTable(SearchHelperModel search)
        {
            //默认查询所有
            Expression <Func <User, bool> > whereLambda = (u => u.IsSuper == false);

            if (!string.IsNullOrEmpty(search.SearchItem1))
            {
                whereLambda = (u => u.UserName.Contains(search.SearchItem1) && u.IsSuper == false);
            }
            var pageList = _bLLUser.Paged(search.PageIndex, search.PageSize,
                                          whereLambda, u => u.AddTime, false);
            var data = pageList.ToPagedList();

            return(View(data));
        }
        public ActionResult UserListTable(SearchHelperModel search)
        {
            //默认查询所有
            Expression <Func <User, bool> > whereLambda = (u => u.IsSuper == false);

            if (!String.IsNullOrEmpty(search.SearchItem1))
            {
                whereLambda = (u => u.UserName.Contains(search.SearchItem1) && u.IsSuper == false);
            }
            var rowsCount = 0;
            var userList  = BusinessHelper.UserHelper.GetPagedList(search.PageIndex, search.PageSize, out rowsCount,
                                                                   whereLambda, u => u.AddTime, false);
            var data = userList.ToPagedList(search.PageIndex, search.PageSize, rowsCount);

            return(View(data));
        }
Beispiel #6
0
        /// <summary>
        /// 加载系统设置数据
        /// </summary>
        /// <param name="search">分页信息,查询条件</param>
        /// <returns></returns>
        public ActionResult List(SearchHelperModel search)
        {
            //默认查询所有
            Expression <Func <SystemSettings, bool> > whereLambda = (s => 1 == 1);
            var rowsCount = 0;

            if (!String.IsNullOrEmpty(search.SearchItem1))
            {
                whereLambda = (s => s.SettingName.Contains(search.SearchItem1));
            }
            var settingsList = BusinessHelper.SystemSettingsHelper.GetPagedList(search.PageIndex, search.PageSize,
                                                                                out rowsCount, whereLambda, s => s.SettingName);
            var data = settingsList.ToPagedList(search.PageIndex, search.PageSize, rowsCount);

            return(View(data));
        }
Beispiel #7
0
        /// <summary>
        /// 预约记录数据页
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public ActionResult ReservationList(SearchHelperModel search)
        {
            Expression <Func <Reservation, bool> > whereLambda = (m => true);

            //补充查询条件
            //根据预约日期查询
            if (!string.IsNullOrWhiteSpace(search.SearchItem0))
            {
                whereLambda = m =>
                              EF.Functions.DateDiffDay(DateTime.Parse(search.SearchItem0), m.ReservationForDate) == 0;
            }
            //根据预约人联系方式查询
            if (!string.IsNullOrWhiteSpace(search.SearchItem1))
            {
                whereLambda = m => m.ReservationPersonPhone == search.SearchItem1.Trim();
            }
            //load data
            var list = _reservationBLL.GetPagedListResult(
                x => new ReservationListViewModel
            {
                ReservationForDate         = x.ReservationForDate,
                ReservationForTime         = x.ReservationForTime,
                ReservationId              = x.ReservationId,
                ReservationUnit            = x.ReservationUnit,
                ReservationTime            = x.ReservationTime,
                ReservationPlaceName       = x.Place.PlaceName,
                ReservationActivityContent = x.ReservationActivityContent,
                ReservationPersonName      = x.ReservationPersonName,
                ReservationPersonPhone     = x.ReservationPersonPhone,
                ReservationStatus          = x.ReservationStatus,
            },
                queryBuilder => queryBuilder
                .WithPredict(whereLambda)
                .WithOrderBy(query =>
                             query.OrderByDescending(r => r.ReservationForDate).ThenByDescending(r => r.ReservationTime))
                .WithInclude(query => query.Include(r => r.Place))
                , search.PageIndex, search.PageSize);

            var dataList = list.ToPagedList();

            return(View(dataList));
        }
Beispiel #8
0
        /// <summary>
        /// 公告列表
        /// </summary>
        /// <param name="search">查询信息</param>
        /// <returns></returns>
        public ActionResult List([FromQuery] SearchHelperModel search)
        {
            Expression <Func <Notice, bool> > whereExpression = (n => true);

            if (!string.IsNullOrEmpty(search.SearchItem1))
            {
                whereExpression = n => n.NoticeTitle.Contains(search.SearchItem1);
            }
            try
            {
                var list = _bLLNotice.Paged(search.PageIndex, search.PageSize,
                                            whereExpression, n => n.NoticePublishTime, false);
                return(View(list.ToPagedList()));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw;
            }
        }
        /// <summary>
        /// 公告列表
        /// </summary>
        /// <param name="search">查询信息</param>
        /// <returns></returns>
        public ActionResult List(SearchHelperModel search)
        {
            Expression <Func <Notice, bool> > whereLamdba = (n => n.IsDeleted == false);

            if (!string.IsNullOrEmpty(search.SearchItem1))
            {
                whereLamdba = n => n.IsDeleted == false && n.NoticeTitle.Contains(search.SearchItem1);
            }
            try
            {
                var list = _bLLNotice.Paged(search.PageIndex, search.PageSize,
                                            whereLamdba, n => n.NoticePublishTime, false);
                return(View(list.Data.ToPagedList(search.PageIndex, search.PageSize, list.TotalCount)));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw;
            }
        }
        /// <summary>
        /// 预约信息列表
        /// </summary>
        /// <param name="search">搜索查询条件</param>
        /// <returns></returns>
        public ActionResult List(SearchHelperModel search)
        {
            Expression <Func <Reservation, bool> > whereLambda = (m => true);

            //根据预约人联系方式查询
            if (!string.IsNullOrEmpty(search.SearchItem1))
            {
                whereLambda = (m => m.ReservationPersonPhone.Contains(search.SearchItem1));
            }
            //类别,加载全部还是只加载待审核列表
            if (!string.IsNullOrEmpty(search.SearchItem2) && search.SearchItem2.Equals("1"))
            {
                //
            }
            else
            {
                whereLambda = whereLambda.And(m => m.ReservationStatus == 0);
            }
            //load data
            var list = _reservationHelper.GetPagedListResult(
                x => new ReservationListViewModel
            {
                ReservationForDate         = x.ReservationForDate,
                ReservationForTime         = x.ReservationForTime,
                ReservationId              = x.ReservationId,
                ReservationUnit            = x.ReservationUnit,
                ReservationTime            = x.ReservationTime,
                ReservationPlaceName       = x.Place.PlaceName,
                ReservationActivityContent = x.ReservationActivityContent,
                ReservationPersonName      = x.ReservationPersonName,
                ReservationPersonPhone     = x.ReservationPersonPhone,
                ReservationStatus          = x.ReservationStatus,
            }, queryBuilder => queryBuilder
                .WithPredict(whereLambda)
                .WithOrderBy(query => query.OrderByDescending(r => r.ReservationForDate).ThenByDescending(r => r.ReservationTime))
                .WithInclude(query => query.Include(r => r.Place))
                , search.PageIndex, search.PageSize);
            var dataList = list.ToPagedList();

            return(View(dataList));
        }
Beispiel #11
0
        /// <summary>
        /// 公告列表
        /// </summary>
        /// <returns></returns>
        public ActionResult NoticeList(SearchHelperModel search)
        {
            Expression <Func <Notice, bool> > whereLamdba = (n => !n.IsDeleted && n.CheckStatus);

            if (!string.IsNullOrEmpty(search.SearchItem1))
            {
                whereLamdba = whereLamdba.And(n => n.NoticeTitle.Contains(search.SearchItem1.Trim()));
            }
            try
            {
                var noticeList = HttpContext.RequestServices.GetService <IBLLNotice>().Paged(search.PageIndex, search.PageSize, whereLamdba,
                                                                                             n => n.NoticePublishTime, false);
                var data = noticeList.ToPagedList();
                return(View(data));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw;
            }
        }
        /// <summary>
        /// 数据视图
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public ActionResult List(SearchHelperModel search)
        {
            //默认查询全部
            Expression <Func <BlockEntity, bool> > whereLambda = (b => true);

            //判断查询条件
            if (!string.IsNullOrEmpty(search.SearchItem1) && !("0".Equals(search.SearchItem1)))
            {
                var id = Guid.Parse(search.SearchItem1);
                if (!string.IsNullOrEmpty(search.SearchItem2))
                {
                    whereLambda = (b => b.BlockTypeId == id && b.BlockValue.Contains(search.SearchItem2));
                }
                else
                {
                    whereLambda = (b => b.BlockTypeId == id);
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(search.SearchItem2))
                {
                    whereLambda = (b => b.BlockValue.Contains(search.SearchItem2));
                }
            }
            var rowsCount = 0;

            try
            {
                var blockList = BusinessHelper.BlockEntityHelper.GetPagedList(search.PageIndex, search.PageSize,
                                                                              out rowsCount, whereLambda, b => b.BlockTime, false);
                var dataList = blockList.ToPagedList(search.PageIndex, search.PageSize, rowsCount);
                return(View(dataList));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw;
            }
        }
        /// <summary>
        /// 操作日志数据列表
        /// </summary>
        /// <param name="search">查询搜索条件</param>
        /// <returns></returns>
        public ActionResult List(SearchHelperModel search)
        {
            Expression <Func <OperationLog, bool> > whereLambda = (l => 1 == 1);

            //日志模块名称
            if (!string.IsNullOrEmpty(search.SearchItem1))
            {
                //日志内容
                if (!string.IsNullOrEmpty(search.SearchItem2))
                {
                    whereLambda = (l =>
                                   l.LogContent.Contains(search.SearchItem2) && l.LogModule.Contains(search.SearchItem1));
                }
                else
                {
                    whereLambda = (l => l.LogModule.Contains(search.SearchItem1));
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(search.SearchItem2))
                {
                    whereLambda = (l => l.LogContent.Contains(search.SearchItem2));
                }
            }
            var rowsCount = 0;

            try
            {
                var logList = BusinessHelper.OperationLogHelper.GetPagedList(search.PageIndex, search.PageSize,
                                                                             out rowsCount, whereLambda, l => l.OperTime, false);
                var dataList = logList.ToPagedList(search.PageIndex, search.PageSize, rowsCount);
                return(View(dataList));
            }
            catch (Exception ex)
            {
                Logger.Error("ex");
                throw ex;
            }
        }
Beispiel #14
0
        /// <summary>
        /// 数据视图
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public ActionResult List(SearchHelperModel search)
        {
            //默认查询全部
            Expression <Func <BlockEntity, bool> > whereLambda = (b => true);

            //判断查询条件
            if (!string.IsNullOrEmpty(search.SearchItem1) && !("0".Equals(search.SearchItem1)))
            {
                var id = Guid.Parse(search.SearchItem1);
                if (!string.IsNullOrEmpty(search.SearchItem2))
                {
                    whereLambda = (b => b.BlockTypeId == id && b.BlockValue.Contains(search.SearchItem2));
                }
                else
                {
                    whereLambda = (b => b.BlockTypeId == id);
                }
            }
            else
            {
                if (!string.IsNullOrEmpty(search.SearchItem2))
                {
                    whereLambda = (b => b.BlockValue.Contains(search.SearchItem2));
                }
            }
            try
            {
                var blockList = _blockEntityHelper.GetPagedList(queryBuilder => queryBuilder
                                                                .WithPredict(whereLambda)
                                                                .WithInclude(q => q.Include(b => b.BlockType))
                                                                .WithOrderBy(q => q.OrderByDescending(b => b.BlockTime)), search.PageIndex, search.PageSize);
                var dataList = blockList.ToPagedList();
                return(View(dataList));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw;
            }
        }
Beispiel #15
0
        /// <summary>
        /// 公告列表
        /// </summary>
        /// <returns></returns>
        public async Task <ActionResult> NoticeList(SearchHelperModel search, [FromServices] IBLLNotice noticeService)
        {
            Expression <Func <Notice, bool> > whereExpression = (n => !n.IsDeleted && n.CheckStatus);

            if (!string.IsNullOrEmpty(search.SearchItem1))
            {
                whereExpression = whereExpression.And(n => n.NoticeTitle.Contains(search.SearchItem1.Trim()));
            }
            try
            {
                var noticeList = await noticeService.PagedAsync(search.PageIndex, search.PageSize, whereExpression,
                                                                n => n.NoticePublishTime, false);

                var data = noticeList.ToPagedList();
                return(View(data));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                return(View(PagedListResult <Notice> .Empty.ToPagedList()));
            }
        }
        /// <summary>
        /// 公告列表
        /// </summary>
        /// <returns></returns>
        public ActionResult NoticeList(SearchHelperModel search)
        {
            Expression <Func <Notice, bool> > whereLamdba = (n => !n.IsDeleted && n.CheckStatus);

            if (!String.IsNullOrEmpty(search.SearchItem1))
            {
                whereLamdba = n => n.NoticeTitle.Contains(search.SearchItem1) && n.CheckStatus;
            }
            try
            {
                int count;
                var noticeList = new BLLNotice().GetPagedList(search.PageIndex, search.PageSize, out count, whereLamdba,
                                                              n => n.NoticePublishTime, false);
                var data = noticeList.ToPagedList(search.PageIndex, search.PageSize, count);
                return(View(data));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
                throw;
            }
        }
        /// <summary>
        /// 预约信息列表
        /// </summary>
        /// <param name="search">搜索查询条件</param>
        /// <returns></returns>
        public ActionResult List(SearchHelperModel search)
        {
            Action <WeihanLi.EntityFramework.EFRepositoryQueryBuilder <Reservation> > queryBuilderAction = queryBuilder =>
            {
                if (!string.IsNullOrEmpty(search.SearchItem1))
                {
                    queryBuilder.WithPredict(m => m.ReservationPersonPhone.Contains(search.SearchItem1));
                }
                if (!string.IsNullOrEmpty(search.SearchItem2) && search.SearchItem2.Equals("1"))
                {
                    //
                }
                else
                {
                    queryBuilder.WithPredict(m => m.ReservationStatus == ReservationStatus.UnReviewed);
                }
                queryBuilder.WithOrderBy(query => query.OrderByDescending(r => r.ReservationForDate).ThenByDescending(r => r.ReservationTime))
                .WithInclude(query => query.Include(r => r.Place));
            };
            //load data
            var list = _reservationHelper.GetPagedListResult(
                x => new ReservationListViewModel
            {
                ReservationForDate         = x.ReservationForDate,
                ReservationForTime         = x.ReservationForTime,
                ReservationId              = x.ReservationId,
                ReservationUnit            = x.ReservationUnit,
                ReservationTime            = x.ReservationTime,
                ReservationPlaceName       = x.Place.PlaceName,
                ReservationActivityContent = x.ReservationActivityContent,
                ReservationPersonName      = x.ReservationPersonName,
                ReservationPersonPhone     = x.ReservationPersonPhone,
                ReservationStatus          = x.ReservationStatus,
            }, queryBuilderAction, search.PageIndex, search.PageSize);
            var dataList = list.ToPagedList();

            return(View(dataList));
        }
Beispiel #18
0
        /// <summary>
        /// 预约记录数据页
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public async Task <ActionResult> ReservationList(SearchHelperModel search)
        {
            Expression <Func <Reservation, bool> > whereLambda = (m => m.ReservationStatus != ReservationStatus.Canceled);

            if (!string.IsNullOrWhiteSpace(search.SearchItem0) && DateTime.TryParse(search.SearchItem0, out var date))
            {
                whereLambda = whereLambda.And(m => m.ReservationForDate == date.Date);
            }
            if (!string.IsNullOrWhiteSpace(search.SearchItem1))
            {
                whereLambda = whereLambda.And(m => m.ReservationPersonPhone == search.SearchItem1.Trim());
            }
            //load data
            var list = await _reservationBLL.GetPagedListResultAsync(
                x => new ReservationListViewModel
            {
                ReservationForDate         = x.ReservationForDate,
                ReservationForTime         = x.ReservationForTime,
                ReservationId              = x.ReservationId,
                ReservationUnit            = x.ReservationUnit,
                ReservationTime            = x.ReservationTime,
                ReservationPlaceName       = x.Place.PlaceName,
                ReservationActivityContent = x.ReservationActivityContent,
                ReservationPersonName      = x.ReservationPersonName,
                ReservationPersonPhone     = x.ReservationPersonPhone,
                ReservationStatus          = x.ReservationStatus,
            },
                queryBuilder => queryBuilder
                .WithPredict(whereLambda)
                .WithOrderBy(query =>
                             query.OrderByDescending(r => r.ReservationForDate).ThenByDescending(r => r.ReservationTime))
                .WithInclude(query => query.Include(r => r.Place))
                , search.PageIndex, search.PageSize);

            var dataList = list.ToPagedList();

            return(View(dataList));
        }
Beispiel #19
0
        /// <summary>
        /// 预约信息列表
        /// </summary>
        /// <param name="search">搜索查询条件</param>
        /// <returns></returns>
        public ActionResult List(SearchHelperModel search)
        {
            Expression <Func <Reservation, bool> > whereLambda = (m =>
                                                                  DbFunctions.DiffDays(DateTime.Today, m.ReservationForDate) <= 7 &&
                                                                  DbFunctions.DiffDays(DateTime.Today, m.ReservationForDate) >= 0 && m.ReservationStatus == 0);
            var rowsCount = 0;

            //类别,加载全部还是只加载待审核列表
            if (!String.IsNullOrEmpty(search.SearchItem2) && search.SearchItem2.Equals("1"))
            {
                //根据预约人联系方式查询
                if (!String.IsNullOrEmpty(search.SearchItem1))
                {
                    whereLambda = (m => m.ReservationPersonPhone.Contains(search.SearchItem1));
                }
                else
                {
                    whereLambda = (m =>
                                   DbFunctions.DiffDays(DateTime.Today, m.ReservationForDate) <= 7 &&
                                   DbFunctions.DiffDays(DateTime.Today, m.ReservationForDate) >= 0);
                }
            }
            else
            {
                if (!String.IsNullOrEmpty(search.SearchItem1))
                {
                    whereLambda = (m =>
                                   m.ReservationPersonPhone.Contains(search.SearchItem1) && m.ReservationStatus == 0);
                }
            }
            //load data
            var list = BusinessHelper.ReservationHelper.GetReservationList(search.PageIndex, search.PageSize,
                                                                           out rowsCount, whereLambda, m => m.ReservationForDate, m => m.ReservationTime, false, false);
            var dataList = list.ToPagedList(search.PageIndex, search.PageSize, rowsCount);

            return(View(dataList));
        }