using FineUIPro; using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; namespace BLL { public static class ProjectPersonStatisticsService { public static Model.SUBQHSEDB db = Funs.DB; #region 获取专职安全管理人员信息统计表 /// /// 记录数 /// public static int count { get; set; } /// /// 定义变量 /// private static IQueryable getDataLists = from x in db.View_ProjectPersonStatistics orderby x.ProjectId, x.UnitType, x.UnitName,x.WorkPostName select x; /// /// 数据列表 /// /// /// /// public static IEnumerable getListData(string projectId, string unitId, Grid Grid1) { IQueryable getDataList = getDataLists; if (!string.IsNullOrEmpty(projectId)) { getDataList = getDataList.Where(x => x.ProjectId == projectId); } else { getDataList = getDataList.Where(x => x.ProjectId == null || x.ProjectId == ""); } if (!string.IsNullOrEmpty(unitId)) { getDataList = getDataList.Where(x => x.UnitId == unitId); } count = getDataList.Count(); if (count == 0) { return null; } getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); return from x in getDataList select new { x.ID, x.ProjectName, x.ProjectId, x.UnitName, x.PersonCounts, x.ProvinceCity, x.UnitProvinceCity, x.DepartName, x.UnitType, x.UnitCode, x.WorkPostCode, x.WorkPostName, x.PersonName, x.IdentityCard, x.SexName, x.EduLevelName, x.PersonSpecialtyName, x.WorkingYears, x.SafeWorkingYears, x.PostTitleName, x.PersonQualityName, x.Telephone, }; } #endregion } }