20210816
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class LeavePostService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.RealName_LeavePost> getLeavePosts = from x in db.RealName_LeavePost select x;
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string states, string projectCode, string personName, string identityCard, Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.RealName_LeavePost> getLeavePostList = getLeavePosts;
|
||||
if (states == "1")
|
||||
{
|
||||
getLeavePostList = getLeavePostList.Where(x => x.OutTime.HasValue);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(personName))
|
||||
{
|
||||
getLeavePostList = getLeavePostList.Where(x => x.PersonName.Contains(personName));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(identityCard))
|
||||
{
|
||||
getLeavePostList = getLeavePostList.Where(x => x.IdentityCard.Contains(identityCard));
|
||||
}
|
||||
|
||||
count = getLeavePostList.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
getLeavePostList = SortConditionHelper.SortingAndPaging(getLeavePostList.OrderBy(x=>x.ProjectCode), Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in getLeavePostList
|
||||
select new
|
||||
{
|
||||
x.NewId,
|
||||
x.Id,
|
||||
x.PersonName,
|
||||
x.IdentityCard,
|
||||
x.ProjectId,
|
||||
x.ProjectCode,
|
||||
x.ProjectShortName,
|
||||
x.InTime,
|
||||
x.OutTime,
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 添加实名制人员信息
|
||||
/// </summary>
|
||||
/// <param name="LeavePost"></param>
|
||||
public static void AddLeavePost(Model.RealName_LeavePost LeavePost)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.RealName_LeavePost newLeavePost = new Model.RealName_LeavePost
|
||||
{
|
||||
NewId = SQLHelper.GetNewID(),
|
||||
Id = LeavePost.Id,
|
||||
PersonName = LeavePost.PersonName,
|
||||
IdentityCard = LeavePost.IdentityCard,
|
||||
ProjectId = LeavePost.ProjectId,
|
||||
ProjectCode = LeavePost.ProjectCode,
|
||||
ProjectShortName = LeavePost.ProjectShortName,
|
||||
InTime = LeavePost.InTime,
|
||||
OutTime = LeavePost.OutTime
|
||||
};
|
||||
db.RealName_LeavePost.InsertOnSubmit(newLeavePost);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改实名制人员信息
|
||||
/// </summary>
|
||||
/// <param name="LeavePost"></param>
|
||||
public static void UpdateLeavePost(Model.RealName_LeavePost LeavePost)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var getLeavePost = db.RealName_LeavePost.FirstOrDefault(e => e.NewId == LeavePost.NewId);
|
||||
if (getLeavePost != null)
|
||||
{
|
||||
getLeavePost.OutTime = LeavePost.OutTime;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="LeavePost"></param>
|
||||
public static void DeleteLeavePost()
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var getLeavePost = from x in db.RealName_LeavePost select x;
|
||||
if (getLeavePost.Count() > 0)
|
||||
{
|
||||
db.RealName_LeavePost.DeleteAllOnSubmit(getLeavePost);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -919,13 +919,12 @@ namespace BLL
|
||||
where ((x.IdentityCard != null && x.IdentityCard != "" && identityCard == null) || (identityCard != null && x.IdentityCard == identityCard))
|
||||
&& y.JTProjectCode == proCode
|
||||
&& v.TeamId.HasValue && x.HeadImage != null && x.HeadImage.Length > 0
|
||||
&& ((type == Const.BtnModify && !x.RealNameUpdateTime.HasValue) || (type != Const.BtnModify && !x.RealNameAddTime.HasValue))
|
||||
&& ((x.IdcardType == null || x.IdcardType == "SHENFEN_ZHENGJIAN")
|
||||
&& (x.IdentityCard.Length == 15 || x.IdentityCard.Length == 18))
|
||||
&& ((type == Const.BtnModify && !x.RealNameUpdateTime.HasValue) || (type != Const.BtnModify && !x.RealNameAddTime.HasValue))
|
||||
&& (x.IdentityCard.Length == 15 || x.IdentityCard.Length == 18)
|
||||
select new
|
||||
{
|
||||
name = x.PersonName,
|
||||
idcardType = x.IdcardType ?? "SHENFEN_ZHENGJIAN",
|
||||
idcardType = "SHENFEN_ZHENGJIAN",
|
||||
idcardNumber = x.IdentityCard,
|
||||
idcardStartDate = x.IdcardStartDate.HasValue ? string.Format("{0:yyyy-MM-dd}", x.IdcardStartDate) : null,
|
||||
idcardEndDate = x.IdcardEndDate.HasValue ? string.Format("{0:yyyy-MM-dd}", x.IdcardEndDate) : null,
|
||||
|
||||
Reference in New Issue
Block a user