public LeftOfficeConfirmForm(FormTypes formType, T_HR_LEFTOFFICE leftOffice) { InitializeComponent(); FormType = formType; LeftOfficeConfirm = new T_HR_LEFTOFFICECONFIRM(); LeftOfficeConfirm.T_HR_LEFTOFFICE = new T_HR_LEFTOFFICE(); LeftOfficeConfirm.T_HR_LEFTOFFICE.DIMISSIONID = leftOffice.DIMISSIONID; LeftOfficeConfirm.CONFIRMID = Guid.NewGuid().ToString(); LeftOfficeConfirm.EMPLOYEEID = leftOffice.T_HR_EMPLOYEE.EMPLOYEEID; LeftOfficeConfirm.OWNERID = leftOffice.T_HR_EMPLOYEE.EMPLOYEEID; LeftOfficeConfirm.OWNERPOSTID = leftOffice.OWNERPOSTID; LeftOfficeConfirm.OWNERDEPARTMENTID = leftOffice.OWNERDEPARTMENTID; LeftOfficeConfirm.OWNERCOMPANYID = leftOffice.OWNERCOMPANYID; LeftOfficeConfirm.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; LeftOfficeConfirm.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString(); LeftOfficeConfirm.CREATEDATE = DateTime.Now; LeftOfficeConfirm.CONFIRMDATE = DateTime.Now; // this.dpConfirmDate.Text = DateTime.Now.ToString("yyyy/MM/dd");//奇怪 LeftOfficeConfirm.EMPLOYEECNAME = leftOffice.T_HR_EMPLOYEE.EMPLOYEECNAME; LeftOfficeConfirm.APPLYDATE = leftOffice.APPLYDATE; LeftOfficeConfirm.LEFTOFFICEDATE = leftOffice.LEFTOFFICEDATE; LeftOfficeConfirm.EMPLOYEEPOSTID = leftOffice.T_HR_EMPLOYEEPOST.EMPLOYEEPOSTID; LeftOfficeConfirm.LEFTOFFICECATEGORY = leftOffice.LEFTOFFICECATEGORY; LeftOfficeConfirm.LEFTOFFICEREASON = leftOffice.LEFTOFFICEREASON; LeftOfficeConfirm.REMARK = leftOffice.REMARK; List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY> listCompany = Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>; txtCompany.Text = (from ent in listCompany where ent.COMPANYID == leftOffice.OWNERCOMPANYID select ent).FirstOrDefault().CNAME; List<SMT.Saas.Tools.OrganizationWS.T_HR_POST> listPost = Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>; txtPost.Text = (from ent in listPost where ent.POSTID == leftOffice.OWNERPOSTID select ent).FirstOrDefault().T_HR_POSTDICTIONARY.POSTNAME; T_HR_EMPLOYEE ep = new T_HR_EMPLOYEE(); ep.EMPLOYEECNAME = LeftOfficeConfirm.EMPLOYEECNAME; ep.EMPLOYEEID = LeftOfficeConfirm.EMPLOYEEID; createUserName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; InitParas("fromLeftoffice"); conformID = "fromLeftoffice"; EnabledControl(); SetToolBar(); this.DataContext = LeftOfficeConfirm; lkEmployeeName.DataContext = ep; // fbClient.GetLeavingUserAsync(LeftOfficeConfirm.EMPLOYEEID); //oaClient.GetEmployeeNotReturnListByUserIdAsync(LeftOfficeConfirm.EMPLOYEEID); //获取员工借还款 client.GetAllPostByEmployeeIDAsync(LeftOfficeConfirm.EMPLOYEEID); GetPersonAccountData(); }
void btnCreate_Click(object sender, RoutedEventArgs e) { if (DtGrid.SelectedItems.Count > 0) { // T_HR_LEFTOFFICE temp = DtGrid.SelectedItems[0] as T_HR_LEFTOFFICE; V_LEFTOFFICEVIEW tempview = DtGrid.SelectedItems[0] as V_LEFTOFFICEVIEW; T_HR_LEFTOFFICE temp = new T_HR_LEFTOFFICE(); temp.DIMISSIONID = tempview.DIMISSIONID; temp.CREATEUSERID = tempview.CREATEUSERID; temp.CHECKSTATE = tempview.CHECKSTATE; temp.OWNERCOMPANYID = tempview.OWNERCOMPANYID; temp.OWNERDEPARTMENTID = tempview.OWNERDEPARTMENTID; temp.OWNERPOSTID = tempview.OWNERPOSTID; temp.OWNERID = tempview.EMPLOYEEID; temp.T_HR_EMPLOYEE = new T_HR_EMPLOYEE(); temp.T_HR_EMPLOYEE.EMPLOYEEID = tempview.EMPLOYEEID; temp.T_HR_EMPLOYEE.EMPLOYEECNAME = tempview.EMPLOYEECNAME; temp.APPLYDATE = tempview.APPLYDATE; temp.LEFTOFFICEDATE = tempview.LEFTOFFICEDATE; temp.LEFTOFFICECATEGORY = tempview.LEFTOFFICECATEGORY; temp.LEFTOFFICEREASON = tempview.LEFTOFFICEREASON; temp.REMARK = tempview.REMARK; temp.T_HR_EMPLOYEEPOST = new T_HR_EMPLOYEEPOST(); temp.T_HR_EMPLOYEEPOST.EMPLOYEEPOSTID = tempview.EMPLOYEEPOSTID; if (temp.CHECKSTATE == Convert.ToInt32(CheckStates.Approved).ToString()) { LeftOfficeConfirmForm form = new LeftOfficeConfirmForm(FormTypes.New, temp); EntityBrowser browser = new EntityBrowser(form); browser.FormType = FormTypes.New; // form.MinHeight = 350; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); } else { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("离职单未审核通过"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } } else { //ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRMBUTTON")); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } }
public void LeftOfficeUpdate(T_HR_LEFTOFFICE entity, ref string strMsg) { using (LeftOfficeBLL bll = new LeftOfficeBLL()) { bll.LeftOfficeUpdate(entity, ref strMsg); } }
private string GetXmlString(string StrSource, T_HR_LEFTOFFICE Info) { SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY ownerCompany = (Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(s => s.COMPANYID == Info.OWNERCOMPANYID).FirstOrDefault(); SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT ownerDepartment = (Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(s => s.DEPARTMENTID == Info.OWNERDEPARTMENTID).FirstOrDefault(); SMT.Saas.Tools.OrganizationWS.T_HR_POST ownerPost = (Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(s => s.POSTID == Info.OWNERPOSTID).FirstOrDefault(); string ownerCompanyName = string.Empty; string ownerDepartmentName = string.Empty; string ownerPostName = string.Empty; if (ownerCompany != null) { ownerCompanyName = ownerCompany.CNAME; } if (ownerDepartment != null) { ownerDepartmentName = ownerDepartment.T_HR_DEPARTMENTDICTIONARY == null ? "" : ownerDepartment.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME; } if (ownerPost != null) { ownerPostName = ownerPost.T_HR_POSTDICTIONARY == null ? "" : ownerPost.T_HR_POSTDICTIONARY.POSTNAME; } decimal? stateValue = Convert.ToDecimal("1"); string checkState = string.Empty; SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY checkStateDict = (Application.Current.Resources["SYS_DICTIONARY"] as List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "CHECKSTATE" && s.DICTIONARYVALUE == stateValue).FirstOrDefault(); checkState = checkStateDict == null ? "" : checkStateDict.DICTIONARYNAME; string postLevelName = string.Empty; SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY postLevelDict = (Application.Current.Resources["SYS_DICTIONARY"] as List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "POSTLEVEL" && s.DICTIONARYVALUE == employeePostSelcected.POSTLEVEL).FirstOrDefault(); postLevelName = postLevelDict == null ? "" : postLevelDict.DICTIONARYNAME; // SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY LEFTOFFICECATEGORY = cbxEmployeeType.SelectedItem as SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY; string postname = employeePostSelcected.T_HR_POST.T_HR_POSTDICTIONARY.POSTNAME + " - " + employeePostSelcected.T_HR_POST.T_HR_DEPARTMENT.T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME + " - " + employeePostSelcected.T_HR_POST.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME; SMT.SaaS.MobileXml.MobileXml mx = new SMT.SaaS.MobileXml.MobileXml(); List<SMT.SaaS.MobileXml.AutoDictionary> AutoList = new List<SMT.SaaS.MobileXml.AutoDictionary>(); AutoList.Add(basedata("T_HR_LEFTOFFICE", "CHECKSTATE", "1", checkState)); //AutoList.Add(basedata("T_OA_APPROVALINFO", "OWNERCOMPANYID", approvalInfo.OWNERCOMPANYID, StrCompanyName)); //AutoList.Add(basedata("T_OA_APPROVALINFO", "OWNERDEPARTMENTID", approvalInfo.OWNERDEPARTMENTID, StrDepartmentName)); //AutoList.Add(basedata("T_OA_APPROVALINFO", "OWNERPOSTID", approvalInfo.OWNERPOSTID, StrPostName)); //AutoList.Add(basedata("T_OA_APPROVALINFO", "TYPEAPPROVAL", approvalInfo.TYPEAPPROVAL, StrApprovalTypeName)); //AutoList.Add(basedata("T_OA_APPROVALINFO", "CONTENT", approvalInfo.APPROVALID, approvalInfo.APPROVALID)); //AutoList.Add(basedata("T_OA_APPROVALINFO", "AttachMent", approvalInfo.APPROVALID, approvalInfo.APPROVALID)); AutoList.Add(basedata("T_HR_LEFTOFFICE", "LEFTOFFICECATEGORY", "1", "辞职")); AutoList.Add(basedata("T_HR_LEFTOFFICE", "EMPLOYEEID", Info.T_HR_EMPLOYEE.EMPLOYEEID, Info.T_HR_EMPLOYEE.EMPLOYEECNAME)); AutoList.Add(basedata("T_HR_LEFTOFFICE", "POSTLEVEL", employeePostSelcected.POSTLEVEL.ToString(), postLevelName)); AutoList.Add(basedata("T_HR_LEFTOFFICE", "EMPLOYEECNAME", Info.T_HR_EMPLOYEE.EMPLOYEECNAME, Info.T_HR_EMPLOYEE.EMPLOYEECNAME)); AutoList.Add(basedata("T_HR_LEFTOFFICE", "OWNER", Info.T_HR_EMPLOYEE.EMPLOYEECNAME, Info.T_HR_EMPLOYEE.EMPLOYEECNAME)); AutoList.Add(basedata("T_HR_LEFTOFFICE", "CREATEUSERNAME", createUserName, createUserName)); AutoList.Add(basedata("T_HR_LEFTOFFICE", "POST", "", postname)); AutoList.Add(basedata("T_HR_LEFTOFFICE", "EMPLOYEEPOSTID", Info.T_HR_EMPLOYEEPOST.EMPLOYEEPOSTID, Info.T_HR_EMPLOYEEPOST.EMPLOYEEPOSTID)); AutoList.Add(basedata("T_HR_LEFTOFFICE", "OWNERCOMPANYID", Info.OWNERCOMPANYID, ownerCompanyName)); AutoList.Add(basedata("T_HR_LEFTOFFICE", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, ownerDepartmentName)); AutoList.Add(basedata("T_HR_LEFTOFFICE", "OWNERPOSTID", Info.OWNERPOSTID, ownerPostName)); string a = mx.TableToXml(Info, null, StrSource, AutoList); return a; }
void LeftOfficeForm_Loaded(object sender, RoutedEventArgs e) { //重载提交按钮-提交先保存 EntityBrowser entBrowser = this.FindParentByType<EntityBrowser>(); entBrowser.BtnSaveSubmit.Click -= new RoutedEventHandler(entBrowser.btnSubmit_Click); entBrowser.BtnSaveSubmit.Click += new RoutedEventHandler(BtnSaveSubmit_Click); #region 原来的 if (FormType == FormTypes.Browse || FormType == FormTypes.Audit) { this.IsEnabled = false; } #endregion if (FormType == FormTypes.New) { LeftOffice = new T_HR_LEFTOFFICE(); LeftOffice.DIMISSIONID = Guid.NewGuid().ToString(); LeftOffice.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; LeftOffice.CHECKSTATE = Convert.ToInt32(CheckStates.UnSubmit).ToString(); LeftOffice.CREATEDATE = DateTime.Now; leftOffice.APPLYDATE = DateTime.Now; LeftOffice.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; LeftOffice.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; LeftOffice.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID; LeftOffice.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; T_HR_EMPLOYEE employeeTmp = new T_HR_EMPLOYEE(); employeeTmp.EMPLOYEEID = Common.CurrentLoginUserInfo.EmployeeID; employeeTmp.EMPLOYEECNAME = Common.CurrentLoginUserInfo.EmployeeName; LeftOffice.T_HR_EMPLOYEE = employeeTmp; dpApplyDate.Text = System.DateTime.Now.ToShortDateString(); lkEmployeeName.DataContext = employeeTmp; createUserName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; client.GetPostsActivedByEmployeeIDAsync(employeeTmp.EMPLOYEEID); SetToolBar(); } else { RefreshUI(RefreshedTypes.ShowProgressBar); lkEmployeeName.IsEnabled = false; GetEmployeeViewsPaging(); client.GetLeftOfficeByIDAsync(leftofficeID); } //设置默认值:新建时,离职类型只有辞职,其他的都不要 //cbxEmployeeType.SelectedValue = "1"; //cbxEmployeeType.IsEnabled = false; }
/// <summary> /// 根据传回的xml生成员工离职确认 /// </summary> /// <param name="eGFunc"></param> /// <returns></returns> private static string AddLeftOfficeConfirm(IEnumerable <XElement> eGFunc) { try { if (eGFunc.Count() == 0) { return(""); } string strEmployeeID = string.Empty; string strOwnerID = string.Empty; string strOwnerPostID = string.Empty; string strOwnerDepartmentID = string.Empty; string strOwnerCompanyID = string.Empty; string strDimissionID = string.Empty; foreach (var q in eGFunc) { string strName = q.Attribute("Name").Value; switch (strName) { case "EMPLOYEEID": strEmployeeID = q.Attribute("Value").Value; break; case "OWNERID": strOwnerID = q.Attribute("Value").Value; break; case "OWNERPOSTID": strOwnerPostID = q.Attribute("Value").Value; break; case "OWNERDEPARTMENTID": strOwnerDepartmentID = q.Attribute("Value").Value; break; case "OWNERCOMPANYID": strOwnerCompanyID = q.Attribute("Value").Value; break; case "DIMISSIONID": strDimissionID = q.Attribute("Value").Value; break; } } PersonnelService ser = new PersonnelService(); T_HR_LEFTOFFICECONFIRM entity = new T_HR_LEFTOFFICECONFIRM(); entity.CONFIRMID = Guid.NewGuid().ToString(); entity.T_HR_LEFTOFFICE = new T_HR_LEFTOFFICE(); //entity.T_HR_LEFTOFFICE.DIMISSIONID = strDimissionID.Replace("{", "").Replace("}", ""); // entity.T_HR_PENSIONDETAIL = new T_HR_PENSIONDETAIL(); entity.CHECKSTATE = ((int)CheckStates.UnSubmit).ToString(); entity.CREATEDATE = DateTime.Now; entity.OWNERID = strEmployeeID; entity.OWNERPOSTID = strOwnerPostID; entity.OWNERDEPARTMENTID = strOwnerDepartmentID; entity.OWNERCOMPANYID = strOwnerCompanyID; entity.CREATEUSERID = strOwnerID; entity.CREATEPOSTID = strOwnerPostID; entity.CREATEDEPARTMENTID = strOwnerDepartmentID; entity.CREATECOMPANYID = strOwnerCompanyID; T_HR_LEFTOFFICE leftOffice = ser.GetLeftOfficeByEmployeeIDAndPostID(strEmployeeID, strOwnerPostID); if (leftOffice != null) { entity.LEFTOFFICECATEGORY = leftOffice.LEFTOFFICECATEGORY; entity.LEFTOFFICEDATE = leftOffice.LEFTOFFICEDATE; entity.LEFTOFFICEREASON = leftOffice.LEFTOFFICEREASON; entity.REMARK = leftOffice.REMARK; entity.T_HR_LEFTOFFICE.DIMISSIONID = leftOffice.DIMISSIONID; entity.EMPLOYEECNAME = leftOffice.T_HR_EMPLOYEE.EMPLOYEECNAME; entity.APPLYDATE = leftOffice.APPLYDATE; entity.EMPLOYEEPOSTID = leftOffice.T_HR_EMPLOYEEPOST.EMPLOYEEPOSTID; V_EMPLOYEEPOST eps = ser.GetEmployeeDetailByID(leftOffice.T_HR_EMPLOYEE.EMPLOYEEID); entity.EMPLOYEEID = leftOffice.T_HR_EMPLOYEE.EMPLOYEEID; entity.CREATEUSERID = leftOffice.T_HR_EMPLOYEE.CREATEUSERID; foreach (T_HR_EMPLOYEEPOST ep in eps.EMPLOYEEPOSTS) { if (ep.EMPLOYEEPOSTID == leftOffice.T_HR_EMPLOYEEPOST.EMPLOYEEPOSTID) { entity.OWNERID = leftOffice.T_HR_EMPLOYEE.EMPLOYEEID; entity.OWNERPOSTID = ep.T_HR_POST.POSTID; entity.OWNERDEPARTMENTID = ep.T_HR_POST.T_HR_DEPARTMENT.DEPARTMENTID; entity.OWNERCOMPANYID = ep.T_HR_POST.T_HR_DEPARTMENT.T_HR_COMPANY.COMPANYID; } } } ser.LeftOfficeConfirmAdd(entity); return(entity.CONFIRMID); } catch (Exception e) { string abc = "<HR>Message=[" + e.Message + "]" + "<HR>Source=[" + e.Source + "]<HR>StackTrace=[" + e.StackTrace + "]<HR>TargetSite=[" + e.TargetSite + "]"; Tracer.Debug(abc); return(abc); } }
void btnCreate_Click(object sender, RoutedEventArgs e) { if (DtGrid.SelectedItems.Count > 0) { // T_HR_LEFTOFFICE temp = DtGrid.SelectedItems[0] as T_HR_LEFTOFFICE; V_LEFTOFFICEVIEW tempview = DtGrid.SelectedItems[0] as V_LEFTOFFICEVIEW; T_HR_LEFTOFFICE temp = new T_HR_LEFTOFFICE(); temp.DIMISSIONID = tempview.DIMISSIONID; temp.CREATEUSERID = tempview.CREATEUSERID; temp.CHECKSTATE = tempview.CHECKSTATE; temp.OWNERCOMPANYID = tempview.OWNERCOMPANYID; temp.OWNERDEPARTMENTID = tempview.OWNERDEPARTMENTID; temp.OWNERPOSTID = tempview.OWNERPOSTID; temp.OWNERID = tempview.EMPLOYEEID; temp.T_HR_EMPLOYEE = new T_HR_EMPLOYEE(); temp.T_HR_EMPLOYEE.EMPLOYEEID = tempview.EMPLOYEEID; temp.T_HR_EMPLOYEE.EMPLOYEECNAME = tempview.EMPLOYEECNAME; temp.APPLYDATE = tempview.APPLYDATE; temp.LEFTOFFICEDATE = tempview.LEFTOFFICEDATE; temp.LEFTOFFICECATEGORY = tempview.LEFTOFFICECATEGORY; temp.LEFTOFFICEREASON = tempview.LEFTOFFICEREASON; temp.REMARK = tempview.REMARK; temp.T_HR_EMPLOYEEPOST = new T_HR_EMPLOYEEPOST(); temp.T_HR_EMPLOYEEPOST.EMPLOYEEPOSTID = tempview.EMPLOYEEPOSTID; if (temp.CHECKSTATE == Convert.ToInt32(CheckStates.Approved).ToString()) { LeftOfficeConfirmForm form = new LeftOfficeConfirmForm(FormTypes.New, temp); EntityBrowser browser = new EntityBrowser(form); browser.FormType = FormTypes.New; // form.MinHeight = 350; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); } else { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("离职单未审核通过"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } } else { //ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRMBUTTON")); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } }