89 lines
2.9 KiB
C#
89 lines
2.9 KiB
C#
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 获取专职安全管理人员信息统计表
|
|
/// <summary>
|
|
/// 记录数
|
|
/// </summary>
|
|
public static int count
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 定义变量
|
|
/// </summary>
|
|
private static IQueryable<Model.View_ProjectPersonStatistics> getDataLists = from x in db.View_ProjectPersonStatistics
|
|
orderby x.ProjectId, x.UnitType, x.UnitName,x.WorkPostName
|
|
select x;
|
|
|
|
/// <summary>
|
|
/// 数据列表
|
|
/// </summary>
|
|
/// <param name="unitId"></param>
|
|
/// <param name="Grid1"></param>
|
|
/// <returns></returns>
|
|
public static IEnumerable getListData(string projectId, string unitId, Grid Grid1)
|
|
{
|
|
IQueryable<Model.View_ProjectPersonStatistics> 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
|
|
}
|
|
} |