/// <summary> /// 是否转正标志 /// </summary> //bool m_flag; public 员工档案明细(AuthorityFlag authFlag, HR_PersonnelArchiveChange personnelChange, HR_PersonnelArchive personnelArchive, IQueryResult result) { InitializeComponent(); m_personnelArchive = personnelArchive; m_personnelChange = personnelChange; m_queryResult = result; m_authFlag = authFlag; }
public FormPersonnelArchiveList(AuthorityFlag authFlag, HR_PersonnelArchiveChange personnelChange, HR_PersonnelArchive personnelArchive, string allowTime, string starTime, string endTime, IQueryResult result) { InitializeComponent(); if (personnelChange != null) { m_personnelArchive = personnelArchive; m_personnelChange = personnelChange; m_queryResult = result; m_authFlag = authFlag; AuthorityControl(m_authFlag); 添加toolStripButton1.Visible = false; 新建toolStripButton1.Visible = false; toolStripSeparator4.Visible = false; toolStripSeparator1.Visible = false; txtAllowTime.Text = allowTime; txtStarTime.Text = starTime; txtEndTime.Text = endTime; BindControl(); FaceAuthoritySetting.SetVisibly(this.Controls, result.HideFields); } else { 修改toolStripButton1.Visible = false; toolStripSeparator1.Visible = false; txtCard.ReadOnly = false; txtName.ReadOnly = false; txtWorkID.ReadOnly = false; txtPostAmount.ReadOnly = false; txtTrainingAmount.ReadOnly = false; txtChangeAmount.ReadOnly = false; dtpBirthday.Value = ServerTime.Time; dtpJoinDate.Value = ServerTime.Time; dtpBecomeDate.Value = ServerTime.Time; dtpTakeJobDate.Value = ServerTime.Time; dtpDimissionDate.Value = ServerTime.Time; } toolStrip1.Visible = true; }
/// <summary> /// 获得人员档案数据集 /// </summary> /// <returns>返回人员档案集合</returns> HR_PersonnelArchive GetPersonnelArchiveData() { HR_PersonnelArchive personnel = m_personnerServer.GetPersonnelInfo(dataGridView1.CurrentRow.Cells["员工编号"].Value.ToString()); if (dataGridView1.CurrentRow.Cells["离职时间"].Value.ToString() != "") { if (Convert.ToDateTime(dataGridView1.CurrentRow.Cells["离职时间"].Value).Year > 2000) { allowDate = Convert.ToDateTime(dataGridView1.CurrentRow.Cells["离职时间"].Value).ToString(); } } else { allowDate = ""; } //if (dataGridView1.CurrentRow.Cells["合同起始时间"].Value.ToString() != "") //{ // if (Convert.ToDateTime(dataGridView1.CurrentRow.Cells["合同起始时间"].Value).Year > 2000) // { // starTime = Convert.ToDateTime(dataGridView1.CurrentRow.Cells["合同起始时间"].Value).ToString(); // } //} //else //{ //starTime = ""; //} if (dataGridView1.CurrentRow.Cells["合同到期日"].Value.ToString() != "") { if (Convert.ToDateTime(dataGridView1.CurrentRow.Cells["合同到期日"].Value).Year > 2000) { endTime = Convert.ToDateTime(dataGridView1.CurrentRow.Cells["合同到期日"].Value).ToString(); } } else { endTime = ""; } return(personnel); }
/// <summary> /// 获得人员对应的车间信息 /// </summary> /// <param name="info">人员工号或者人员名称</param> /// <returns>返回数据集</returns> public WS_WorkShopCode GetPersonnelWorkShop(DepotManagementDataContext ctx, string info) { var varData = from a in ctx.HR_PersonnelArchive where a.WorkID == info || a.Name == info select a; if (varData.Count() > 0) { HR_PersonnelArchive temp = varData.First(); var varData1 = (from a in ctx.WS_WorkShopCode select a).Where(k => k.DeptCode.Length <= temp.Dept.Length && k.DeptCode == temp.Dept.Substring(0, k.DeptCode.Length)); if (varData1.Count() > 0) { return(varData1.First()); } } return(null); }
public FormPersonnelArchiveList(AuthorityFlag authFlag, string cardID) { InitializeComponent(); m_authFlag = authFlag; AuthorityControl(m_authFlag); m_personnelArchive = m_personnerServer.GetPersonnelArchiveByCardID(cardID); if (m_personnelArchive != null) { BindControl(); 新建toolStripButton1.Visible = true; } else { MessageDialog.ShowPromptMessage("没有身份证为【" + cardID + "】的员工档案信息!"); this.Close(); return; } }
/// <summary> /// 获得人员档案数据集 /// </summary> /// <returns>返回人员档案集合</returns> HR_PersonnelArchive GetPersonnelArchiveData() { HR_PersonnelArchive personnel = new HR_PersonnelArchive(); personnel.WorkID = txtWorkID.Text; personnel.Name = txtName.Text; personnel.Sex = cmbSex.Text; personnel.JoinDate = dtpJoinDate.Value; personnel.Birthday = dtpBirthday.Value; personnel.Nationality = txtNationality.Text; personnel.Race = txtRace.Text; personnel.Birthplace = txtBirthplace.Text; personnel.Party = txtParty.Text; personnel.ID_Card = txtCard.Text; personnel.College = txtCollege.Text; personnel.EducatedDegree = cmbEducatedDegree.Text; personnel.EducatedMajor = txtEducatedMajor.Text; personnel.FamilyAddress = txtFamilyAddress.Text; personnel.Phone = txtPhone.Text; personnel.Speciality = txtSpeciality.Text; personnel.MobilePhone = txtMobilePhone.Text; personnel.Hobby = txtHobby.Text; personnel.QQ = txtQQ.Text; personnel.Email = txtEmail.Text; personnel.JobNature = txtJobNature.Text; personnel.LengthOfSchooling = cmbLengthOfSchooling.Text; personnel.MaritalStatus = cmbMaritalStatus.Text; personnel.IsRelation = cbIsRelation.Checked; personnel.Relation = txtRelation.Text; personnel.RelationName = txtRelationName.Text; if (dtpBecomeDate.Checked) { personnel.BecomeRegularEmployeeDate = dtpBecomeDate.Value; //m_flag = true; } if (dtpTakeJobDate.Checked) { personnel.TakeJobDate = dtpTakeJobDate.Value; } personnel.ArchivePosition = txtArchivePosition.Text; personnel.PersonnelStatus = m_personnerServer.GetStatusByName(cmbStatus.Text); personnel.Dept = m_departmentServer.GetDeptCode(cmbDept.Text); personnel.WorkPost = m_PostServer.GetOperatingPostByPostName(cmbWorkPost.Text).岗位编号; personnel.JobTitleID = m_JobServer.GetJobTitleByJobName(cmbJobTitle.Text); if (dtpDimissionDate.Checked) { personnel.DimissionDate = dtpDimissionDate.Value; personnel.PersonnelStatus = m_personnerServer.GetStatusByName("离职"); } personnel.IsCore = cbCore.Checked; personnel.JobLevelID = m_JobServer.GetJobTitleByJobName(cmbLevel.Text); if (txtGraduationYear.Text.Trim() == "") { personnel.GraduationYear = 0; } else { personnel.GraduationYear = Convert.ToInt32(txtGraduationYear.Text); } if (picbPhoto.Image != null) { personnel.Photo = GetPicToBinary(picbPhoto.Image); } if (m_picbyte != null) { personnel.Annex = m_picbyte; personnel.AnnexName = m_pathName; } if (txtResume.Text.Trim() != "") { personnel.ResumeID = Convert.ToInt32(txtResume.Text); } personnel.Recorder = BasicInfo.LoginID; personnel.RecordTime = ServerTime.Time; personnel.Remark = txtRemark.Text; personnel.PY = UniversalFunction.GetPYWBCode(txtName.Text, "PY"); personnel.WB = UniversalFunction.GetPYWBCode(txtName.Text, "WB"); return(personnel); }
/// <summary> /// 移交确认修改 /// </summary> /// <param name="id">申请编号</param> /// <param name="flag">工作是否移交</param> /// <param name="name">员工姓名</param> /// <param name="workID">员工编号</param> /// <param name="personnelChange">档案历史数据集</param> /// <param name="dept">调入部门</param> /// <param name="postID">调入岗位编号</param> /// <param name="error">错误信息</param> /// <returns>成功返回True,失败返回false</returns> public bool UpdateWorkTurnOver(int id, bool flag, string name, string workID, HR_PersonnelArchiveChange personnelChange, string dept, int postID, out string error) { error = ""; bool isfinish = false; try { DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext; var result = from a in dataContxt.HR_PostChange where a.ID == id select a; if (result.Count() != 1) { error = "信息有误,请检查!"; return(false); } HR_PostChange postChange = result.Single(); if (postChange.BillStatus == PostChangeStatus.等待原工作移交.ToString()) { postChange.TurnOverPeople = BasicInfo.LoginID; postChange.TurnOverDate = ServerTime.Time; postChange.IsWorkTurnOver = flag; if (flag) { postChange.BillStatus = PostChangeStatus.等待人事档案调动.ToString(); } } else if (postChange.BillStatus == PostChangeStatus.等待人事档案调动.ToString()) { postChange.FilesPeople = BasicInfo.LoginID; postChange.FilesDate = ServerTime.Time; postChange.IsPersonnelFiles = flag; if (flag) { postChange.BillStatus = PostChangeStatus.等待信息化人员确认.ToString(); } } else if (postChange.BillStatus == PostChangeStatus.等待信息化人员确认.ToString()) { postChange.ITPeople = BasicInfo.LoginID; postChange.ITDate = ServerTime.Time; postChange.IsIT = flag; if (flag) { postChange.BillStatus = PostChangeStatus.等待固定资产人员确认.ToString(); } } else if (postChange.BillStatus == PostChangeStatus.等待固定资产人员确认.ToString()) { postChange.DormPeople = BasicInfo.LoginID; postChange.DormDate = ServerTime.Time; postChange.IsDorm = flag; if (flag) { postChange.BillStatus = PostChangeStatus.已完成.ToString(); isfinish = true; } } dataContxt.SubmitChanges(); if (isfinish) { var resultArchive = from c in dataContxt.HR_PersonnelArchive where c.Name == name && c.WorkID == workID select c; if (resultArchive.Count() == 1) { HR_PersonnelArchive personnel = resultArchive.Single(); personnel.Dept = dept; personnel.WorkPost = postID; //personnel.Remark = ServerTime.Time + personnel.Name + " 从 " + personnelChange.DeptName + personnelChange.WorkPost + //" 调到 " + new OrganizationServer().GetDeptByDeptCode(personnel.Dept).部门名称 + " " + //new OperatingPostServer().GetOperatingPostByPostCode(personnel.WorkPost); if (!new PersonnelArchiveServer().UpdatePersonnelArchiveByChangPost(personnelChange, personnel, out error)) { error = "信息有误!"; return(false); } } } return(true); } catch (Exception ex) { error = ex.Message; return(false); } }
/// <summary> /// 新增或修改员工离职申请信息 /// </summary> /// <param name="dimission">员工离职数据集</param> /// <param name="type">进行步骤(提交申请/部门负责人审批/人力资源部审批/分管领导审批/总经理批准)</param> /// <param name="error">错误信息</param> /// <returns>返回单据编号,失败返回0</returns> public string AddAndUpdateDimission(HR_DimissionBill dimission, string type, out string error) { error = ""; try { DepotManagementDataContext dataContxt = CommentParameter.DepotDataContext; var result = from a in dataContxt.HR_DimissionBill where a.WorkID == dimission.WorkID && a.Date.Month == dimission.Date.Month && a.Date.Day == dimission.Date.Day select a; switch (type) { case "提交申请": if (result.Count() > 0) { error = "不能重复提交离职申请!"; return("0"); } dataContxt.HR_DimissionBill.InsertOnSubmit(dimission); break; case "部门负责人审批": if (result.Count() == 1) { HR_DimissionBill dimiList = result.Single(); dimiList.DeptAuthorize = dimission.DeptAuthorize; dimiList.DeptOpinion = dimission.DeptOpinion; dimiList.DeptSignature = dimission.DeptSignature; dimiList.DeptSignatureDate = dimission.DeptSignatureDate; dimiList.AllowDimissionDate = dimission.AllowDimissionDate; if (!dimission.DeptAuthorize) { dimiList.BillStatus = DimissionBillStatus.已完成.ToString(); } else { dimiList.BillStatus = DimissionBillStatus.等待人力资源审阅.ToString(); } } break; case "人力资源部审批": if (result.Count() == 1) { HR_DimissionBill dimiList = result.Single(); dimiList.HR_Opinion = dimission.HR_Opinion; dimiList.HR_Signature = dimission.HR_Signature; dimiList.HR_SignatureDate = dimission.HR_SignatureDate; dimiList.BillStatus = DimissionBillStatus.等待分管领导审核.ToString(); } break; case "分管领导审批": if (result.Count() == 1) { HR_DimissionBill dimiList = result.Single(); dimiList.LeaderAuthorize = dimission.LeaderAuthorize; dimiList.LeaderOpinion = dimission.LeaderOpinion; dimiList.LeaderSignature = dimission.LeaderSignature; dimiList.LeaderSignatureDate = dimission.LeaderSignatureDate; if (!dimission.LeaderAuthorize) { dimiList.BillStatus = DimissionBillStatus.已完成.ToString(); } else { dimiList.BillStatus = DimissionBillStatus.等待总经理批准.ToString(); } } break; case "总经理批准": if (result.Count() == 1) { HR_DimissionBill dimiList = result.Single(); dimiList.GM_Authorize = dimission.GM_Authorize; dimiList.GM_Opinion = dimission.GM_Opinion; dimiList.GM_Signature = dimission.GM_Signature; dimiList.GM_SignatureDate = dimission.GM_SignatureDate; dimiList.BillStatus = DimissionBillStatus.已完成.ToString(); if (dimission.GM_Authorize) { if (!new OperatingPostServer().UpdateLessDeptPost(dimiList.Dept, new OperatingPostServer().GetOperatingPostByPostName(dimiList.WorkPost).岗位编号, out error)) { error = "信息有误!"; return("0"); } var resultManager = from c in dataContxt.HR_DeptManager where c.ManagerWorkID == dimission.WorkID select c; if (resultManager.Count() > 0) { dataContxt.HR_DeptManager.DeleteAllOnSubmit(resultManager); } var resultStatus = from e in dataContxt.HR_PersonnelArchive where e.WorkID == dimission.WorkID select e; if (resultStatus.Count() > 0) { HR_PersonnelArchive personnel = resultStatus.Single(); personnel.PersonnelStatus = 3; personnel.Remark = dimiList.AllowDimissionDate + "离职"; } var resultLaborTemp = from j in dataContxt.View_HR_PersonnelLaborContract where j.员工编号 == dimission.WorkID && j.类别 == "合同类" select j; if (resultLaborTemp.Count() > 0) { int billID = resultLaborTemp.Single().编号; var resultLabor = from j in dataContxt.HR_PersonnelLaborContract where j.ID == billID select j; HR_PersonnelLaborContract labor = resultLabor.Single(); if (resultLabor.Single().EndTime > dimission.AllowDimissionDate) { labor.LaborContractStatusID = 8; } else { labor.LaborContractStatusID = 7; } } } } break; default: break; } dataContxt.SubmitChanges(); var resultList = from a in dataContxt.HR_DimissionBill where a.WorkID == dimission.WorkID && a.Date == dimission.Date && a.Reason == dimission.Reason select a; if (resultList.Count() > 0) { return(resultList.Single().ID.ToString()); } else { error = "未知编号!"; return("0"); } } catch (Exception ex) { error = ex.Message; return("0"); } }