/// <summary> /// 根据人员Id删除一个人员信息 /// </summary> /// <param name="personId">人员Id</param> public static void DeletePerson(string personId) { Model.SUBHSSEDB db = Funs.DB; Model.SitePerson_Person person = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == personId); if (person != null) { ///删除编码表记录 BLL.CodeRecordsService.DeleteCodeRecordsByDataId(personId); //删除管理人员资质 Model.QualityAudit_ManagePersonQuality managePersonQuality = db.QualityAudit_ManagePersonQuality.FirstOrDefault(e => e.PersonId == personId); if (managePersonQuality != null) { CodeRecordsService.DeleteCodeRecordsByDataId(managePersonQuality.ManagePersonQualityId); CommonService.DeleteAttachFileById(managePersonQuality.ManagePersonQualityId); db.QualityAudit_ManagePersonQuality.DeleteOnSubmit(managePersonQuality); db.SubmitChanges(); } //删除特岗人员资质 var personQuality = PersonQualityService.GetPersonQualityByPersonId(personId); if (personQuality != null) { CodeRecordsService.DeleteCodeRecordsByDataId(personQuality.PersonQualityId); //删除编号 CommonService.DeleteAttachFileById(personQuality.PersonQualityId); //删除附件 db.QualityAudit_PersonQuality.DeleteOnSubmit(personQuality); db.SubmitChanges(); } //删除安全人员资质 Model.QualityAudit_SafePersonQuality safePersonQuality = db.QualityAudit_SafePersonQuality.FirstOrDefault(e => e.PersonId == personId); if (safePersonQuality != null) { CodeRecordsService.DeleteCodeRecordsByDataId(safePersonQuality.SafePersonQualityId); CommonService.DeleteAttachFileById(safePersonQuality.SafePersonQualityId); db.QualityAudit_SafePersonQuality.DeleteOnSubmit(safePersonQuality); db.SubmitChanges(); } ///删除人员出入场记录 BLL.PersonInOutService.DeletePersonInOutByPersonId(person.PersonId); db.SitePerson_Person.DeleteOnSubmit(person); db.SubmitChanges(); } }
/// <summary> /// 修改管理人员资质 /// </summary> /// <param name="ManagePersonQuality"></param> public static void UpdateManagePersonQuality(Model.QualityAudit_ManagePersonQuality ManagePersonQuality) { Model.SUBHSSEDB db = Funs.DB; Model.QualityAudit_ManagePersonQuality newManagePersonQuality = db.QualityAudit_ManagePersonQuality.FirstOrDefault(e => e.ManagePersonQualityId == ManagePersonQuality.ManagePersonQualityId); if (newManagePersonQuality != null) { newManagePersonQuality.CertificateNo = ManagePersonQuality.CertificateNo; newManagePersonQuality.CertificateName = ManagePersonQuality.CertificateName; newManagePersonQuality.Grade = ManagePersonQuality.Grade; newManagePersonQuality.SendUnit = ManagePersonQuality.SendUnit; newManagePersonQuality.SendDate = ManagePersonQuality.SendDate; newManagePersonQuality.LimitDate = ManagePersonQuality.LimitDate; newManagePersonQuality.LateCheckDate = ManagePersonQuality.LateCheckDate; newManagePersonQuality.ApprovalPerson = ManagePersonQuality.ApprovalPerson; newManagePersonQuality.Remark = ManagePersonQuality.Remark; newManagePersonQuality.CompileMan = ManagePersonQuality.CompileMan; newManagePersonQuality.CompileDate = ManagePersonQuality.CompileDate; newManagePersonQuality.AuditDate = ManagePersonQuality.AuditDate; db.SubmitChanges(); } }
/// <summary> /// 添加管理人员资质 /// </summary> /// <param name="ManagePersonQuality"></param> public static void AddManagePersonQuality(Model.QualityAudit_ManagePersonQuality ManagePersonQuality) { Model.SUBHSSEDB db = Funs.DB; Model.QualityAudit_ManagePersonQuality newManagePersonQuality = new Model.QualityAudit_ManagePersonQuality { ManagePersonQualityId = ManagePersonQuality.ManagePersonQualityId, PersonId = ManagePersonQuality.PersonId, CertificateNo = ManagePersonQuality.CertificateNo, CertificateName = ManagePersonQuality.CertificateName, Grade = ManagePersonQuality.Grade, SendUnit = ManagePersonQuality.SendUnit, SendDate = ManagePersonQuality.SendDate, LimitDate = ManagePersonQuality.LimitDate, LateCheckDate = ManagePersonQuality.LateCheckDate, ApprovalPerson = ManagePersonQuality.ApprovalPerson, Remark = ManagePersonQuality.Remark, CompileMan = ManagePersonQuality.CompileMan, CompileDate = ManagePersonQuality.CompileDate, AuditDate = ManagePersonQuality.AuditDate }; db.QualityAudit_ManagePersonQuality.InsertOnSubmit(newManagePersonQuality); db.SubmitChanges(); }