Ejemplo n.º 1
0
        /// <summary>
        /// 获取项目列表页
        /// </summary>
        /// <param name="selProjectList"></param>
        /// <returns></returns>
        public JsonResult SelProjectListTable(SelProjectList selProjectList)
        {
            ResultModel result = new ResultModel();

            selProjectList.EndTime = selProjectList.EndTime.AddDays(1);
            TableHelper _TableHelper = selProjectList.ConvertToT <TableHelper>();

            try
            {
                PageHelper pageHelper    = new PageHelper(_TableHelper.PageIndex, _TableHelper.PageSize);
                var        queryUserList = SelIQProjectList(selProjectList);
                var        userList      = PagingFunction(queryUserList, ref pageHelper);
                _TableHelper.data = userList.ConvertToExpand();
                string tableHtml = RenderPartialViewToString(this, "_normalTable", _TableHelper);
                // string tableHtml = PartialView("_normalTable", _TableHelper);
                result.ResultCode = 1;
                result.ResultData = new { data = tableHtml, pageInfo = pageHelper };
                //_TableHelper.data = queryUserList.ConvertToExpand();
            }
            catch (Exception ex)
            {
                throw;
            }
            return(Json(result));
        }
Ejemplo n.º 2
0
        public IQueryable <tb_project> GetProjectListByQuery(SelProjectList selProjectList)
        {
            var query = GetAllProjectInfo();

            if (!String.IsNullOrEmpty(selProjectList.KeyWord))
            {
                query = query.Where(p => p.CompName.Contains(selProjectList.KeyWord));
            }
            if (!String.IsNullOrEmpty(selProjectList.ProPhaseId))
            {
                query = query.Where(p => p.ProPhaseId == selProjectList.ProPhaseId);
            }
            if (!String.IsNullOrEmpty(selProjectList.ProManager))
            {
                query = query.Where(p => p.ProManager == selProjectList.ProManager);
            }
            //if (String.IsNullOrEmpty(selProjectList.ProType.Trim()))
            //{
            //    query = query.Where(p => p.ProType == selProjectList.ProType);
            //}
            try
            {
                if ((int)selProjectList.AreaId != 0)
                {
                    query = query.Where(p => p.AreaId == selProjectList.AreaId);
                }
            }
            catch (Exception)
            {
            }
            if (selProjectList.BeginTime.Year != 1)
            {
                query = query.Where(p => p.InvestmentTime >= selProjectList.BeginTime && p.InvestmentTime < selProjectList.EndTime);
            }


            var count = query.Count();

            return(query);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取项目列表的查询接口
        /// </summary>
        /// <param name="selProjectList"></param>
        /// <returns></returns>
        private IQueryable <dynamic> SelIQProjectList(SelProjectList selProjectList)
        {
            var query = (from p in _ProjectBusiness.GetProjectListByQuery(selProjectList)
                         join a in _AreaBusiness.GetAllAreaInfo() on p.AreaId equals a.Id
                         join u in _userBusiness.GetAllUserInfo() on p.ProManager equals u.Id
                         join c in _constantBusiness.GetAllData() on p.ProPhaseId equals c.Id
                         orderby p.InsertTime descending
                         select new
            {
                p.Id,
                p.CompName,
                p.ProName,
                p.InvestmentAmount,
                p.ValueOfAssessment,
                p.InsertTime,
                AreaName = a.Name,
                u.UserName,
                ProPhase = c.ItemName
            });

            return(query);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取项目列表数据
        /// </summary>
        /// <param name="selProjectList">查询条件类</param>
        /// <returns></returns>
        public JsonResult SelProjectListData(SelProjectList selProjectList)
        {
            ResultModel result = new ResultModel();

            selProjectList.EndTime = selProjectList.EndTime.AddDays(1);
            TableHelper _TableHelper = selProjectList.ConvertToT <TableHelper>();

            try
            {
                PageHelper pageHelper    = new PageHelper(_TableHelper.PageIndex, _TableHelper.PageSize);
                var        queryUserList = SelIQProjectList(selProjectList);
                var        userList      = PagingFunction(queryUserList, ref pageHelper);
                result.ResultCode = 1;
                result.ResultData = new { data = userList, pageInfo = pageHelper };
                //_TableHelper.data = queryUserList.ConvertToExpand();
            }
            catch (Exception ex)
            {
                throw;
            }
            return(Json(result));
        }