/// <summary> /// 选择已审核通过的请假单据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lkEmployeeLeave_FindClick(object sender, EventArgs e) { Dictionary <string, string> cols = new Dictionary <string, string>(); cols.Add("EMPLOYEENAME", "EMPLOYEENAME"); cols.Add("EMPLOYEECODE", "EMPLOYEECODE"); cols.Add("STARTDATETIME", "STARTDATETIME"); cols.Add("ENDDATETIME", "ENDDATETIME"); cols.Add("LEAVEDAYS", "LEAVEDAYS"); StringBuilder strfilter = new StringBuilder(); ObservableCollection <object> objArgs = new ObservableCollection <object>(); strfilter.Append(" EMPLOYEEID == @0"); strfilter.Append(" && CHECKSTATE == @1"); objArgs.Add(cancelLeave.EMPLOYEEID); objArgs.Add(Convert.ToInt32(SMT.SaaS.FrameworkUI.CheckStates.Approved).ToString()); LookupForm lookup = new LookupForm(SMT.Saas.Tools.OrganizationWS.EntityNames.EmployeeLeaveRecord, typeof(List <T_HR_EMPLOYEELEAVERECORD>), cols, strfilter.ToString(), objArgs); lookup.SelectedClick += (o, ev) => { T_HR_EMPLOYEELEAVERECORD ent = lookup.SelectedObj as T_HR_EMPLOYEELEAVERECORD; if (ent == null) { return; } lkEmployeeLeave.DataContext = ent; cancelLeave.T_HR_EMPLOYEELEAVERECORD = ent; this.GetTxtCancelRecord(ent.T_HR_EMPLOYEECANCELLEAVE); dpStartDate.Value = ent.STARTDATETIME; dpEndDate.Value = ent.ENDDATETIME; if (ent.LEAVEDAYS != null) { nudLeaveDay.Value = ent.LEAVEDAYS.Value.ToDouble(); } if (ent.LEAVEHOURS != null) { nudLeaveHours.Value = ent.LEAVEHOURS.Value.ToDouble(); } if (ent.TOTALHOURS != null) { nudTotalDays.Value = ent.TOTALHOURS.Value.ToDouble(); } }; lookup.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); }
public string EmployeeLeaveRecordUpdate(T_HR_EMPLOYEELEAVERECORD LeaveRecord, List<V_ADJUSTLEAVE> AdjustLeaves) { using (EmployeeLeaveRecordBLL bll = new EmployeeLeaveRecordBLL()) { return bll.EmployeeLeaveRecordUpdate(LeaveRecord, AdjustLeaves); } }
/// <summary> /// 初始化 /// </summary> private void InitParas() { if (FormType == FormTypes.New) { LeaveRecord = new T_HR_EMPLOYEELEAVERECORD(); string strEmployeeState = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeState; LeaveRecord.LEAVERECORDID = Guid.NewGuid().ToString(); LeaveRecord.EMPLOYEEID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; LeaveRecord.EMPLOYEECODE = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeCode; LeaveRecord.EMPLOYEENAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; LeaveRecord.CHECKSTATE = Convert.ToInt32(SMT.SaaS.FrameworkUI.CheckStates.UnSubmit).ToString(); //权限控制 LeaveRecord.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; LeaveRecord.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; LeaveRecord.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID; LeaveRecord.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; //2010年2月11日, 11:37:35,目前暂未实现登录部分,人员相关数据为假定值 LeaveRecord.CREATEDATE = DateTime.Now; LeaveRecord.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; LeaveRecord.UPDATEDATE = System.DateTime.Now; LeaveRecord.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; //赋初始值 tbOrgName.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostName + " - " + SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName + " - " + SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName; tbEmpName.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; if (!string.IsNullOrWhiteSpace(tbOrgName.Text)) { tbEmpName.Text = tbEmpName.Text + " - " + tbOrgName.Text; } tbEmpWorkAge.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.WorkingAge.ToString(); tbEmpSex.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.SexID; tbEmpLevel.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostLevel.ToString(); this.DataContext = LeaveRecord; if (strEmployeeState == Convert.ToInt32(EmployeeState.OnTrial).ToString() || strEmployeeState == Convert.ToInt32(EmployeeState.Regular).ToString() || strEmployeeState == Convert.ToInt32(EmployeeState.OnLeaving).ToString()) { SetToolBar(); } else { this.IsEnabled = false; } //隐藏7 8 9 三行 this.SecondGrid.RowDefinitions[7].Height = new GridLength(0); this.SecondGrid.RowDefinitions[8].Height = new GridLength(0); this.SecondGrid.RowDefinitions[9].Height = new GridLength(0); Utility.InitFileLoad("EmployeeLeaveRecord", LeaveRecord.LEAVERECORDID, FormType, uploadFile); } else { clientAtt.GetLeaveRecordByIDAsync(LeaveRecordID); if (FormType == FormTypes.Browse) { EnabledControl(); //this.IsEnabled = false; //uploadFile.IsEnabled = true; } Utility.InitFileLoad("EmployeeLeaveRecord", LeaveRecordID, FormType, uploadFile); } if (FormType != FormTypes.Browse) { //Load事件之后,加载完后获取到父控件 EntityBrowser entBrowser = this.FindParentByType<EntityBrowser>(); entBrowser.BtnSaveSubmit.Click -= new RoutedEventHandler(entBrowser.btnSubmit_Click); entBrowser.BtnSaveSubmit.Click += new RoutedEventHandler(BtnSaveSubmit_Click); perClient.GetEmployeeByIDAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); //Utility.InitFileLoad("EmployeeLeaveRecord", LeaveRecordID, FormType, uploadFile); } }
private string GetXmlString(string StrSource, T_HR_EMPLOYEELEAVERECORD Info) { //SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY LEFTOFFICECATEGORY = cbxEmployeeType.SelectedItem as SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY; 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; decimal? postlevelValue = Convert.ToDecimal(tbEmpLevel.Text.Trim()); 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 == postlevelValue).FirstOrDefault(); postLevelName = postLevelDict == null ? "" : postLevelDict.DICTIONARYNAME; 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_EMPLOYEELEAVERECORD", "CHECKSTATE", "1", checkState)); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "OWNERPOSTNAME", tbOrgName.Text.Trim(), tbOrgName.Text.Trim())); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "POSTLEVEL", tbEmpLevel.Text.Trim(), postLevelName)); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "EMPLOYEEORGNAME", Info.EMPLOYEENAME, tbEmpName.Text)); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "EMPLOYEENAME", Info.EMPLOYEENAME, Info.EMPLOYEENAME)); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "TOTALADJUSTLEAVEDAYS", nudTotalAdjustLeaveDays.Value.ToString(), nudTotalAdjustLeaveDays.Value.ToString())); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "DEDUCTDAYS", nudDeductDays.Value.ToString(), nudDeductDays.Value.ToString())); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "TOTALVACATIONDAYS", nudTotalVacationDays.Value.ToString(), nudTotalVacationDays.Value.ToString())); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "LEAVETYPESETID", Info.T_HR_LEAVETYPESET.LEAVETYPESETID, lkLeaveTypeName.TxtLookUp.Text)); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "OWNERCOMPANYID", Info.OWNERCOMPANYID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName)); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName)); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "OWNERPOSTID", Info.OWNERPOSTID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostName)); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "AttachMent", Info.LEAVERECORDID, Info.LEAVERECORDID)); string strStart = string.Empty; string strEnd = string.Empty; DateTime dt1 = (DateTime)Info.STARTDATETIME; DateTime dt2 = (DateTime)Info.ENDDATETIME; //strStart = string.Format("{0:f}",(DateTime)Info.STARTDATETIME); //((DateTime)Info.STARTDATETIME).ToString("yyyy-mm-dd "); //strEnd =string.Format("{0:f}",(DateTime)Info.ENDDATETIME); //((DateTime)Info.ENDDATETIME).ToString(""); //strStart = dt1.ToString("yyyy-mm-dd HH:mm"); //strEnd = dt2.ToString("yyyy-mm-dd HH:mm"); strStart = dt1.Year.ToString() + "-" + dt1.Month.ToString() + "-" + dt1.Day.ToString() + " " + dt1.Hour.ToString() + ":" + dt1.Minute.ToString(); strEnd = dt2.Year.ToString() + "-" + dt2.Month.ToString() + "-" + dt2.Day.ToString() + " " + dt2.Hour.ToString() + ":" + dt2.Minute.ToString(); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "STARTDATETIME", strStart, strStart)); AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "ENDDATETIME", strEnd, strEnd)); double totalDays = nudTotalAdjustLeaveDays.Value + nudDeductDays.Value; AutoList.Add(basedata("T_HR_EMPLOYEELEAVERECORD", "TOTALDAYS", Convert.ToString(totalDays), Convert.ToString(totalDays))); //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", LEFTOFFICECATEGORY != null ? LEFTOFFICECATEGORY.DICTIONARYVALUE.ToString() : "0", LEFTOFFICECATEGORY != null ? LEFTOFFICECATEGORY.DICTIONARYNAME : "")); string a = mx.TableToXml(Info, null, StrSource, AutoList); return a; }