增加数据穿透界面
This commit is contained in:
@@ -13,6 +13,93 @@ namespace BLL
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
#region 劳务人员列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count2
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.View_SitePerson_Person> getDataLists = from x in db.View_SitePerson_Person
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
/// 数据列表
|
||||
/// </summary>
|
||||
/// <param name="projetcId"></param>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="workPostId"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="idCard"></param>
|
||||
/// <param name="states"></param>
|
||||
/// <param name="Grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string projetcId, string unitId, string workPostId, string name, string idCard, string states, Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.View_SitePerson_Person> getDataList = getDataLists.OrderBy(x => x.ProjectId).ThenBy(x => x.UnitId);
|
||||
if (!string.IsNullOrEmpty(projetcId) && projetcId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.ProjectId == projetcId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitId) && unitId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.UnitId == unitId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(workPostId) && workPostId != Const._Null)
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.WorkPostId == workPostId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(states) && states != "-2")
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.IsUsed == Convert.ToBoolean(states));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.PersonName.Contains(name));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(idCard))
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.IdentityCard.Contains(idCard));
|
||||
}
|
||||
count2 = getDataList.Count();
|
||||
if (count2 == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in getDataList
|
||||
select new
|
||||
{
|
||||
x.PersonId,
|
||||
x.PersonName,
|
||||
x.CardNo,
|
||||
x.IdentityCard,
|
||||
x.Sex,
|
||||
x.SexName,
|
||||
x.UnitId,
|
||||
x.UnitName,
|
||||
x.WorkPostId,
|
||||
x.WorkPostName,
|
||||
x.ProjectId,
|
||||
ProjectName = db.Base_Project.First(u => u.ProjectId == x.ProjectId).ProjectName,
|
||||
ShortName = db.Base_Project.First(u => u.ProjectId == x.ProjectId).ShortName,
|
||||
NativePlace = x.CountryName ?? "" + x.ProvinceName ?? "",
|
||||
x.TeamGroupId,
|
||||
x.TeamGroupName,
|
||||
x.InTime,
|
||||
x.OutTime,
|
||||
x.IsUsed,
|
||||
OutName = (x.IsUsed == false ? "是" : "否"),
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
@@ -437,6 +524,7 @@ namespace BLL
|
||||
CountryCode = person.CountryCode,
|
||||
ProvinceCode = person.ProvinceCode,
|
||||
IsCardNoOK=IDCardValid.CheckIDCard(person.IdentityCard),
|
||||
IsSafetyMonitoring = person.IsSafetyMonitoring,
|
||||
};
|
||||
newPerson.RawPassword = Funs.getInitialPassword(person.UnitId, person.IdentityCard);
|
||||
newPerson.Password = Funs.EncryptionPassword(newPerson.RawPassword);
|
||||
@@ -502,6 +590,7 @@ namespace BLL
|
||||
newPerson.MaritalStatus = person.MaritalStatus;
|
||||
newPerson.DepartId = person.DepartId;
|
||||
newPerson.QRCodeAttachUrl = person.QRCodeAttachUrl;
|
||||
newPerson.IsSafetyMonitoring = person.IsSafetyMonitoring;
|
||||
newPerson.Password = GetPersonPassWord(person.IdentityCard);
|
||||
if (!newPerson.OutTime.HasValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user