1、优化考勤记录导入,优化出入记录写实名制推送记录表。2、优化考试答题,交卷接口方法。3、优化写入培训记录。

This commit is contained in:
2022-06-16 17:34:24 +08:00
parent b913f49cd8
commit 85a8b510ac
29 changed files with 488 additions and 534 deletions
@@ -59,11 +59,24 @@ namespace BLL
/// <param name="companyTrainingId"></param>
public static void DeleteCompanyTraining(string companyTrainingId)
{
Model.Training_CompanyTraining companyTraining = db.Training_CompanyTraining.FirstOrDefault(e => e.CompanyTrainingId == companyTrainingId);
if (companyTraining!=null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
db.Training_CompanyTraining.DeleteOnSubmit(companyTraining);
db.SubmitChanges();
var companyTraining = db.Training_CompanyTraining.FirstOrDefault(e => e.CompanyTrainingId == companyTrainingId);
if (companyTraining != null)
{
var delItem = from x in db.Training_PlanItem where x.CompanyTrainingId == companyTrainingId select x;
if (delItem.Count() > 0)
{
db.Training_PlanItem.DeleteAllOnSubmit(delItem);
}
var delItemc = from x in db.Training_CompanyTrainingItem where x.CompanyTrainingId == companyTrainingId select x;
if (delItemc.Count() > 0)
{
db.Training_CompanyTrainingItem.DeleteAllOnSubmit(delItemc);
}
db.Training_CompanyTraining.DeleteOnSubmit(companyTraining);
db.SubmitChanges();
}
}
}
@@ -98,13 +98,12 @@ namespace BLL
/// </summary>
/// <param name="trainingId"></param>
public static void DeleteTrainDetailByTrainDetail(string trainDetailId)
{
Model.SGGLDB db = Funs.DB;
{
Model.EduTrain_TrainRecordDetail trainDetails = Funs.DB.EduTrain_TrainRecordDetail.FirstOrDefault(e => e.TrainDetailId == trainDetailId);
if (trainDetails != null)
{
db.EduTrain_TrainRecordDetail.DeleteOnSubmit(trainDetails);
db.SubmitChanges();
Funs.DB.EduTrain_TrainRecordDetail.DeleteOnSubmit(trainDetails);
Funs.DB.SubmitChanges();
var rainRecord = EduTrain_TrainRecordService.GetTrainingByTrainingId(trainDetails.TrainingId);
if (rainRecord != null)
@@ -77,8 +77,7 @@ namespace BLL
/// <param name="training">教育培训实体</param>
public static void UpdateTraining(Model.EduTrain_TrainRecord training)
{
Model.SGGLDB db = Funs.DB;
Model.EduTrain_TrainRecord newTraining = db.EduTrain_TrainRecord.FirstOrDefault(e => e.TrainingId == training.TrainingId);
Model.EduTrain_TrainRecord newTraining = Funs.DB.EduTrain_TrainRecord.FirstOrDefault(e => e.TrainingId == training.TrainingId);
if (newTraining != null)
{
newTraining.TrainingCode = training.TrainingCode;
@@ -107,7 +106,7 @@ namespace BLL
newTraining.TrainPersonNum = training.TrainPersonNum;
newTraining.FromRecordId = training.FromRecordId;
newTraining.WorkPostIds = training.WorkPostIds;
db.SubmitChanges();
Funs.DB.SubmitChanges();
}
}
+2 -7
View File
@@ -38,15 +38,10 @@ namespace BLL
if (string.IsNullOrEmpty(newTestRecord.TestType))
{
var getTrainTypeName = (from x in db.Training_TestPlan
join y in db.Training_Plan on x.PlanId equals y.PlanId
join z in db.Base_TrainType on y.TrainTypeId equals z.TrainTypeId
where x.TestPlanId == testRecord.TestPlanId
select z).FirstOrDefault();
var getTrainTypeName = db.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == testRecord.TestPlanId);
if (getTrainTypeName != null)
{
testRecord.TestType = getTrainTypeName.TrainTypeName;
newTestRecord.TestType = getTrainTypeName.PlanName;
}
}
+17 -9
View File
@@ -63,18 +63,26 @@ namespace BLL
/// <param name="TrainingId"></param>
public static void DeleteTestTrainingById(string TrainingId)
{
Model.SGGLDB db = Funs.DB;
Model.Training_TestTraining TestTraining = db.Training_TestTraining.FirstOrDefault(e => e.TrainingId == TrainingId);
if (TestTraining != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var TrainingItem = from x in db.Training_TestTrainingItem where x.TrainingId == TrainingId select x;
if (TrainingItem.Count() > 0)
var TestTraining = db.Training_TestTraining.FirstOrDefault(e => e.TrainingId == TrainingId);
if (TestTraining != null)
{
db.Training_TestTrainingItem.DeleteAllOnSubmit(TrainingItem);
}
var testPlanTraining = from x in db.Training_TestPlanTraining where x.TrainingId == TrainingId select x;
if (testPlanTraining.Count() > 0)
{
db.Training_TestPlanTraining.DeleteAllOnSubmit(testPlanTraining);
}
db.Training_TestTraining.DeleteOnSubmit(TestTraining);
db.SubmitChanges();
var TrainingItem = from x in db.Training_TestTrainingItem where x.TrainingId == TrainingId select x;
if (TrainingItem.Count() > 0)
{
db.Training_TestTrainingItem.DeleteAllOnSubmit(TrainingItem);
}
db.Training_TestTraining.DeleteOnSubmit(TestTraining);
db.SubmitChanges();
}
}
}
@@ -73,11 +73,11 @@ namespace BLL
/// <param name="taskId"></param>
public static void DeleteTaskById(string taskId)
{
Model.Training_Task task = db.Training_Task.FirstOrDefault(e => e.TaskId == taskId);
Model.Training_Task task = Funs.DB.Training_Task.FirstOrDefault(e => e.TaskId == taskId);
if (task != null)
{
db.Training_Task.DeleteOnSubmit(task);
db.SubmitChanges();
Funs.DB.Training_Task.DeleteOnSubmit(task);
Funs.DB.SubmitChanges();
}
}
@@ -86,18 +86,17 @@ namespace BLL
/// </summary>
/// <param name="planId"></param>
public static void DeleteTaskByPlanId(string planId)
{
Model.SGGLDB db = Funs.DB;
var tasks = from x in db.Training_Task where x.PlanId == planId select x;
{
var tasks = from x in Funs.DB.Training_Task where x.PlanId == planId select x;
if (tasks.Count() > 0)
{
var taskItems = from x in db.Training_TaskItem where x.PlanId == planId select x;
var taskItems = from x in Funs.DB.Training_TaskItem where x.PlanId == planId select x;
if (tasks.Count() > 0)
{
db.Training_TaskItem.DeleteAllOnSubmit(taskItems);
Funs.DB.Training_TaskItem.DeleteAllOnSubmit(taskItems);
}
db.Training_Task.DeleteAllOnSubmit(tasks);
Funs.DB.Training_Task.DeleteAllOnSubmit(tasks);
}
}
}
@@ -78,48 +78,50 @@ namespace BLL
/// <param name="hazardRegister">危险观察登记实体</param>
public static void UpdateHazardRegister(Model.HSSE_Hazard_HazardRegister hazardRegister)
{
Model.SGGLDB db = Funs.DB;
Model.HSSE_Hazard_HazardRegister newHazardRegister = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == hazardRegister.HazardRegisterId);
if (newHazardRegister != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
newHazardRegister.HazardCode = hazardRegister.HazardCode;
newHazardRegister.RegisterDef = hazardRegister.RegisterDef;
newHazardRegister.Rectification = hazardRegister.Rectification;
newHazardRegister.Place = hazardRegister.Place;
newHazardRegister.ResponsibleUnit = hazardRegister.ResponsibleUnit;
newHazardRegister.Observer = hazardRegister.Observer;
newHazardRegister.RectifiedDate = hazardRegister.RectifiedDate;
newHazardRegister.AttachUrl = hazardRegister.AttachUrl;
newHazardRegister.ProjectId = hazardRegister.ProjectId;
newHazardRegister.States = hazardRegister.States;
newHazardRegister.Requirements = hazardRegister.Requirements;
newHazardRegister.IsEffective = hazardRegister.IsEffective;
newHazardRegister.ResponsibleMan = hazardRegister.ResponsibleMan;
newHazardRegister.CheckManId = hazardRegister.CheckManId;
//newHazardRegister.CheckTime = hazardRegister.CheckTime;
newHazardRegister.RectificationPeriod = hazardRegister.RectificationPeriod;
newHazardRegister.ImageUrl = hazardRegister.ImageUrl;
newHazardRegister.RectificationImageUrl = hazardRegister.RectificationImageUrl;
newHazardRegister.RectificationTime = hazardRegister.RectificationTime;
newHazardRegister.ConfirmMan = hazardRegister.ConfirmMan;
newHazardRegister.ConfirmDate = hazardRegister.ConfirmDate;
newHazardRegister.HandleIdea = hazardRegister.HandleIdea;
newHazardRegister.CutPayment = hazardRegister.CutPayment;
newHazardRegister.ProblemTypes = hazardRegister.ProblemTypes;
newHazardRegister.DIC_ID = hazardRegister.DIC_ID;
//把附件表的路径复制过来
Model.AttachFile file = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId);
if (file != null)
Model.HSSE_Hazard_HazardRegister newHazardRegister = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == hazardRegister.HazardRegisterId);
if (newHazardRegister != null)
{
newHazardRegister.ImageUrl = file.AttachUrl;
}
Model.AttachFile fileR = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId + "-R", Const.HSSE_HiddenRectificationListMenuId);
if (fileR != null)
{
newHazardRegister.RectificationImageUrl = fileR.AttachUrl;
}
newHazardRegister.HazardCode = hazardRegister.HazardCode;
newHazardRegister.RegisterDef = hazardRegister.RegisterDef;
newHazardRegister.Rectification = hazardRegister.Rectification;
newHazardRegister.Place = hazardRegister.Place;
newHazardRegister.ResponsibleUnit = hazardRegister.ResponsibleUnit;
newHazardRegister.Observer = hazardRegister.Observer;
newHazardRegister.RectifiedDate = hazardRegister.RectifiedDate;
newHazardRegister.AttachUrl = hazardRegister.AttachUrl;
newHazardRegister.ProjectId = hazardRegister.ProjectId;
newHazardRegister.States = hazardRegister.States;
newHazardRegister.Requirements = hazardRegister.Requirements;
newHazardRegister.IsEffective = hazardRegister.IsEffective;
newHazardRegister.ResponsibleMan = hazardRegister.ResponsibleMan;
newHazardRegister.CheckManId = hazardRegister.CheckManId;
//newHazardRegister.CheckTime = hazardRegister.CheckTime;
newHazardRegister.RectificationPeriod = hazardRegister.RectificationPeriod;
newHazardRegister.ImageUrl = hazardRegister.ImageUrl;
newHazardRegister.RectificationImageUrl = hazardRegister.RectificationImageUrl;
newHazardRegister.RectificationTime = hazardRegister.RectificationTime;
newHazardRegister.ConfirmMan = hazardRegister.ConfirmMan;
newHazardRegister.ConfirmDate = hazardRegister.ConfirmDate;
newHazardRegister.HandleIdea = hazardRegister.HandleIdea;
newHazardRegister.CutPayment = hazardRegister.CutPayment;
newHazardRegister.ProblemTypes = hazardRegister.ProblemTypes;
newHazardRegister.DIC_ID = hazardRegister.DIC_ID;
//把附件表的路径复制过来
Model.AttachFile file = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId, Const.HSSE_HiddenRectificationListMenuId);
if (file != null)
{
newHazardRegister.ImageUrl = file.AttachUrl;
}
Model.AttachFile fileR = BLL.AttachFileService.GetAttachFile(hazardRegister.HazardRegisterId + "-R", Const.HSSE_HiddenRectificationListMenuId);
if (fileR != null)
{
newHazardRegister.RectificationImageUrl = fileR.AttachUrl;
}
db.SubmitChanges();
db.SubmitChanges();
}
}
}
@@ -129,8 +131,7 @@ namespace BLL
/// <param name="hazardRegisterId">危险观察登记主键</param>
public static void DeleteHazardRegisterByHazardRegisterId(string hazardRegisterId)
{
Model.SGGLDB db = Funs.DB;
var hazardRegister = db.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == hazardRegisterId);
var hazardRegister = Funs.DB.HSSE_Hazard_HazardRegister.FirstOrDefault(e => e.HazardRegisterId == hazardRegisterId);
if (hazardRegister != null)
{
try
@@ -141,8 +142,8 @@ namespace BLL
catch (Exception)
{
}
db.HSSE_Hazard_HazardRegister.DeleteOnSubmit(hazardRegister);
db.SubmitChanges();
Funs.DB.HSSE_Hazard_HazardRegister.DeleteOnSubmit(hazardRegister);
Funs.DB.SubmitChanges();
}
}
+47 -44
View File
@@ -100,51 +100,54 @@ namespace BLL
/// <param name="updateHSSELog"></param>
public static void UpdateHSSELog(Model.Manager_HSSELog updateHSSELog)
{
Model.Manager_HSSELog newHSSELog = Funs.DB.Manager_HSSELog.FirstOrDefault(e => e.HSSELogId == updateHSSELog.HSSELogId);
if (newHSSELog != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
newHSSELog.CompileDate = updateHSSELog.CompileDate;
newHSSELog.CompileMan = updateHSSELog.CompileMan;
newHSSELog.Weather = updateHSSELog.Weather;
newHSSELog.IsVisible = updateHSSELog.IsVisible;
newHSSELog.Num11 = updateHSSELog.Num11;
newHSSELog.Contents12 = updateHSSELog.Contents12;
newHSSELog.Contents13 = updateHSSELog.Contents13;
newHSSELog.Contents21 = updateHSSELog.Contents21;
newHSSELog.Num21 = updateHSSELog.Num21;
newHSSELog.Contents22 = updateHSSELog.Contents22;
newHSSELog.Num22 = updateHSSELog.Num22;
newHSSELog.Contents23 = updateHSSELog.Contents23;
newHSSELog.Num23 = updateHSSELog.Num23;
newHSSELog.Contents24 = updateHSSELog.Contents24;
newHSSELog.Num24 = updateHSSELog.Num24;
newHSSELog.Contents25 = updateHSSELog.Contents25;
newHSSELog.Num25 = updateHSSELog.Num25;
newHSSELog.Contents26 = updateHSSELog.Contents26;
newHSSELog.Num26 = updateHSSELog.Num26;
newHSSELog.Contents27 = updateHSSELog.Contents27;
newHSSELog.Num27 = updateHSSELog.Num27;
newHSSELog.Contents28 = updateHSSELog.Contents28;
newHSSELog.Num28 = updateHSSELog.Num28;
newHSSELog.Contents29 = updateHSSELog.Contents29;
newHSSELog.Num29 = updateHSSELog.Num29;
newHSSELog.Contents210 = updateHSSELog.Contents210;
newHSSELog.Num210 = updateHSSELog.Num210;
newHSSELog.Num211 = updateHSSELog.Num211;
newHSSELog.Contents31 = updateHSSELog.Contents31;
newHSSELog.Num31 = updateHSSELog.Num31;
newHSSELog.Contents32 = updateHSSELog.Contents32;
newHSSELog.Num32 = updateHSSELog.Num32;
newHSSELog.Contents33 = updateHSSELog.Contents33;
newHSSELog.Num33 = updateHSSELog.Num33;
newHSSELog.Contents34 = updateHSSELog.Contents34;
newHSSELog.Num34 = updateHSSELog.Num34;
newHSSELog.Contents41 = updateHSSELog.Contents41;
newHSSELog.Contents42 = updateHSSELog.Contents42;
newHSSELog.Contents43 = updateHSSELog.Contents43;
newHSSELog.Contents51 = updateHSSELog.Contents51;
newHSSELog.Contents52 = updateHSSELog.Contents52;
Funs.DB.SubmitChanges();
Model.Manager_HSSELog newHSSELog =db.Manager_HSSELog.FirstOrDefault(e => e.HSSELogId == updateHSSELog.HSSELogId);
if (newHSSELog != null)
{
newHSSELog.CompileDate = updateHSSELog.CompileDate;
newHSSELog.CompileMan = updateHSSELog.CompileMan;
newHSSELog.Weather = updateHSSELog.Weather;
newHSSELog.IsVisible = updateHSSELog.IsVisible;
newHSSELog.Num11 = updateHSSELog.Num11;
newHSSELog.Contents12 = updateHSSELog.Contents12;
newHSSELog.Contents13 = updateHSSELog.Contents13;
newHSSELog.Contents21 = updateHSSELog.Contents21;
newHSSELog.Num21 = updateHSSELog.Num21;
newHSSELog.Contents22 = updateHSSELog.Contents22;
newHSSELog.Num22 = updateHSSELog.Num22;
newHSSELog.Contents23 = updateHSSELog.Contents23;
newHSSELog.Num23 = updateHSSELog.Num23;
newHSSELog.Contents24 = updateHSSELog.Contents24;
newHSSELog.Num24 = updateHSSELog.Num24;
newHSSELog.Contents25 = updateHSSELog.Contents25;
newHSSELog.Num25 = updateHSSELog.Num25;
newHSSELog.Contents26 = updateHSSELog.Contents26;
newHSSELog.Num26 = updateHSSELog.Num26;
newHSSELog.Contents27 = updateHSSELog.Contents27;
newHSSELog.Num27 = updateHSSELog.Num27;
newHSSELog.Contents28 = updateHSSELog.Contents28;
newHSSELog.Num28 = updateHSSELog.Num28;
newHSSELog.Contents29 = updateHSSELog.Contents29;
newHSSELog.Num29 = updateHSSELog.Num29;
newHSSELog.Contents210 = updateHSSELog.Contents210;
newHSSELog.Num210 = updateHSSELog.Num210;
newHSSELog.Num211 = updateHSSELog.Num211;
newHSSELog.Contents31 = updateHSSELog.Contents31;
newHSSELog.Num31 = updateHSSELog.Num31;
newHSSELog.Contents32 = updateHSSELog.Contents32;
newHSSELog.Num32 = updateHSSELog.Num32;
newHSSELog.Contents33 = updateHSSELog.Contents33;
newHSSELog.Num33 = updateHSSELog.Num33;
newHSSELog.Contents34 = updateHSSELog.Contents34;
newHSSELog.Num34 = updateHSSELog.Num34;
newHSSELog.Contents41 = updateHSSELog.Contents41;
newHSSELog.Contents42 = updateHSSELog.Contents42;
newHSSELog.Contents43 = updateHSSELog.Contents43;
newHSSELog.Contents51 = updateHSSELog.Contents51;
newHSSELog.Contents52 = updateHSSELog.Contents52;
db.SubmitChanges();
}
}
}
+69 -72
View File
@@ -40,67 +40,60 @@ namespace BLL
/// <param name="PersonInOut"></param>
public static void InsertPersonInOutNowNow(Model.SitePerson_PersonInOutNow PersonInOut)
{
Model.SGGLDB db = Funs.DB;
var getNow = db.SitePerson_PersonInOutNow.FirstOrDefault(x => x.PersonInOutId == PersonInOut.PersonInOutId);
if (getNow == null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Model.SitePerson_PersonInOutNow newPersonInOut = new Model.SitePerson_PersonInOutNow
var getNow = db.SitePerson_PersonInOutNow.FirstOrDefault(x => x.PersonInOutId == PersonInOut.PersonInOutId);
if (getNow == null)
{
PersonInOutId = PersonInOut.PersonInOutId,
ProjectId = PersonInOut.ProjectId,
UnitId = PersonInOut.UnitId,
PersonId = PersonInOut.PersonId,
IsIn = PersonInOut.IsIn,
ChangeTime = PersonInOut.ChangeTime,
WorkPostId = PersonInOut.WorkPostId,
PostType = PersonInOut.PostType,
ProCode = PersonInOut.ProCode,
Name = PersonInOut.Name,
IdcardType = PersonInOut.IdcardType ?? "SHENFEN_ZHENGJIAN",
IdcardNumber = PersonInOut.IdcardNumber,
CheckType = "ZHENGCHANG_KAOQINLEIBIE",
CheckWay = "FACE_FANGSHI",
};
db.SitePerson_PersonInOutNow.InsertOnSubmit(newPersonInOut);
db.SubmitChanges();
/// 监理 业主 不进入
var getPUnit = db.Project_ProjectUnit.FirstOrDefault(x => x.ProjectId == newPersonInOut.ProjectId && x.UnitId == newPersonInOut.UnitId);
if (getPUnit.IsSynchro == true)
{
var getRealNameP = db.RealName_Project.FirstOrDefault(x => x.ProCode == newPersonInOut.ProCode);
if (getRealNameP != null)
Model.SitePerson_PersonInOutNow newPersonInOut = new Model.SitePerson_PersonInOutNow
{
Model.RealName_PersonInOutNow newR = new Model.RealName_PersonInOutNow
PersonInOutId = PersonInOut.PersonInOutId,
ProjectId = PersonInOut.ProjectId,
UnitId = PersonInOut.UnitId,
PersonId = PersonInOut.PersonId,
IsIn = PersonInOut.IsIn,
ChangeTime = PersonInOut.ChangeTime,
WorkPostId = PersonInOut.WorkPostId,
PostType = PersonInOut.PostType,
ProCode = PersonInOut.ProCode,
Name = PersonInOut.Name,
IdcardType = PersonInOut.IdcardType ?? "SHENFEN_ZHENGJIAN",
IdcardNumber = PersonInOut.IdcardNumber,
CheckType = "ZHENGCHANG_KAOQINLEIBIE",
CheckWay = "FACE_FANGSHI",
};
db.SitePerson_PersonInOutNow.InsertOnSubmit(newPersonInOut);
db.SubmitChanges();
/// 监理 业主 不进入
var getPUnit = db.Project_ProjectUnit.FirstOrDefault(x => x.ProjectId == newPersonInOut.ProjectId && x.UnitId == newPersonInOut.UnitId);
if (getPUnit.IsSynchro == true)
{
var getRealNameP = db.RealName_Project.FirstOrDefault(x => x.ProCode == newPersonInOut.ProCode);
if (getRealNameP != null)
{
PersonInOutId = newPersonInOut.PersonInOutId,
ProjectId = newPersonInOut.ProjectId,
UnitId = newPersonInOut.UnitId,
PersonId = newPersonInOut.PersonId,
IsIn = newPersonInOut.IsIn,
ChangeTime = newPersonInOut.ChangeTime,
WorkPostId = newPersonInOut.WorkPostId,
PostType = newPersonInOut.PostType,
ProCode = newPersonInOut.ProCode,
Name = newPersonInOut.Name,
IdcardType = newPersonInOut.IdcardType ?? "SHENFEN_ZHENGJIAN",
IdcardNumber = newPersonInOut.IdcardNumber,
CheckType = "ZHENGCHANG_KAOQINLEIBIE",
CheckWay = "FACE_FANGSHI",
};
db.RealName_PersonInOutNow.InsertOnSubmit(newR);
db.SubmitChanges();
Model.RealName_PersonInOutNow newR = new Model.RealName_PersonInOutNow
{
PersonInOutId = newPersonInOut.PersonInOutId,
ProjectId = newPersonInOut.ProjectId,
UnitId = newPersonInOut.UnitId,
PersonId = newPersonInOut.PersonId,
IsIn = newPersonInOut.IsIn,
ChangeTime = newPersonInOut.ChangeTime,
WorkPostId = newPersonInOut.WorkPostId,
PostType = newPersonInOut.PostType,
ProCode = newPersonInOut.ProCode,
Name = newPersonInOut.Name,
IdcardType = newPersonInOut.IdcardType ?? "SHENFEN_ZHENGJIAN",
IdcardNumber = newPersonInOut.IdcardNumber,
CheckType = "ZHENGCHANG_KAOQINLEIBIE",
CheckWay = "FACE_FANGSHI",
};
db.RealName_PersonInOutNow.InsertOnSubmit(newR);
db.SubmitChanges();
}
}
}
}
var getLastList = from x in db.SitePerson_PersonInOutNow
where x.ChangeTime <= PersonInOut.ChangeTime.Value.AddHours(-48)
select x;
if (getLastList.Count() > 0)
{
db.SitePerson_PersonInOutNow.DeleteAllOnSubmit(getLastList);
db.SubmitChanges();
}
}
/// <summary>
@@ -109,18 +102,20 @@ namespace BLL
/// <param name="personId"></param>
public static void DeletePersonInOutByPersonId(string personId)
{
Model.SGGLDB db = Funs.DB;
var personInOut = from x in db.SitePerson_PersonInOut where x.PersonId == personId select x;
if (personInOut.Count() > 0)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
db.SitePerson_PersonInOut.DeleteAllOnSubmit(personInOut);
db.SubmitChanges();
}
var rpersonInOut = from x in db.RealName_PersonInOutNow where x.PersonId == personId select x;
if (rpersonInOut.Count() > 0)
{
db.RealName_PersonInOutNow.DeleteAllOnSubmit(rpersonInOut);
db.SubmitChanges();
var personInOut = from x in db.SitePerson_PersonInOut where x.PersonId == personId select x;
if (personInOut.Count() > 0)
{
db.SitePerson_PersonInOut.DeleteAllOnSubmit(personInOut);
db.SubmitChanges();
}
var rpersonInOut = from x in db.RealName_PersonInOutNow where x.PersonId == personId select x;
if (rpersonInOut.Count() > 0)
{
db.RealName_PersonInOutNow.DeleteAllOnSubmit(rpersonInOut);
db.SubmitChanges();
}
}
}
@@ -130,16 +125,18 @@ namespace BLL
/// <param name="personId"></param>
public static void UpdateRealNameInOut(string personId, string oldCardNo, string newIdCardNo)
{
Model.SGGLDB db = Funs.DB;
var personInOuts = from x in db.RealName_PersonInOutNow
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
var personInOuts = from x in db.RealName_PersonInOutNow
where x.PersonId == personId && x.IdcardNumber == oldCardNo
select x;
if (personInOuts.Count() > 0)
{
foreach (var item in personInOuts)
if (personInOuts.Count() > 0)
{
item.IdcardNumber = newIdCardNo;
db.SubmitChanges();
foreach (var item in personInOuts)
{
item.IdcardNumber = newIdCardNo;
db.SubmitChanges();
}
}
}
}
@@ -93,27 +93,29 @@ namespace BLL
/// <param name="personInfo">人员考勤管理实体</param>
public static void AddPersonInfo(Model.SitePerson_Checking personInfo)
{
Model.SGGLDB db = Funs.DB;
Model.SitePerson_Checking newPersonInfo = new Model.SitePerson_Checking
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
CheckingId = personInfo.CheckingId,
ProjectId = personInfo.ProjectId,
UnitId = personInfo.UnitId,
UnitName = personInfo.UnitName,
PersonId = personInfo.PersonId,
PersonName = personInfo.PersonName,
IdentityCard = personInfo.IdentityCard,
CardNo = personInfo.CardNo,
WorkAreaId = personInfo.WorkAreaId,
WorkAreaName = personInfo.WorkAreaName,
IntoOutTime = personInfo.IntoOutTime,
IntoOut = personInfo.IntoOut,
Address = personInfo.Address,
States = BLL.Const.State_2
};
Model.SitePerson_Checking newPersonInfo = new Model.SitePerson_Checking
{
CheckingId = personInfo.CheckingId,
ProjectId = personInfo.ProjectId,
UnitId = personInfo.UnitId,
UnitName = personInfo.UnitName,
PersonId = personInfo.PersonId,
PersonName = personInfo.PersonName,
IdentityCard = personInfo.IdentityCard,
CardNo = personInfo.CardNo,
WorkAreaId = personInfo.WorkAreaId,
WorkAreaName = personInfo.WorkAreaName,
IntoOutTime = personInfo.IntoOutTime,
IntoOut = personInfo.IntoOut,
Address = personInfo.Address,
States = BLL.Const.State_2
};
db.SitePerson_Checking.InsertOnSubmit(newPersonInfo);
db.SubmitChanges();
db.SitePerson_Checking.InsertOnSubmit(newPersonInfo);
db.SubmitChanges();
}
if (!string.IsNullOrEmpty(personInfo.ProjectId) && !string.IsNullOrEmpty(personInfo.IdentityCard) && personInfo.IntoOutTime.HasValue)
{