/// <summary> /// 审核通过 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnAudit_Click(object sender, RoutedEventArgs e) { string strSignInID = string.Empty; if (dgSignInList.SelectedItems == null) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "APPOVALBUTTON")); return; } if (dgSignInList.SelectedItems.Count == 0) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "APPOVALBUTTON")); return; } T_HR_EMPLOYEESIGNINRECORD entSignInRd = dgSignInList.SelectedItems[0] as T_HR_EMPLOYEESIGNINRECORD; strSignInID = entSignInRd.SIGNINID; SignInRdForm formSignInRd = new SignInRdForm(FormTypes.Audit, strSignInID); EntityBrowser browser = new EntityBrowser(formSignInRd); browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.FormType = FormTypes.Audit; browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); }
/// <summary> /// 导出单条员工异常签卡明细 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnOutExcel_Click(object sender, RoutedEventArgs e) { //ExportToCSV.ExportDataGridSaveAs(dgSignInList); //return; try { string strSignInID = string.Empty; if (dgSignInList.SelectedItems == null) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("PLEASESELECTONE")); return; } if (dgSignInList.SelectedItems.Count == 0) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("PLEASESELECTONE")); return; } T_HR_EMPLOYEESIGNINRECORD entSignInRd = dgSignInList.SelectedItems[0] as T_HR_EMPLOYEESIGNINRECORD; strSignInID = entSignInRd.SIGNINID; dialog.Filter = "MS Excel Files|*.xls"; dialog.FilterIndex = 1; result = dialog.ShowDialog(); clientAtt.ExportEmployeeSignInAsync(strSignInID); } catch (Exception ex) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), ex.ToString(), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); } }
/// <summary> /// 导出员工签卡明细 /// </summary> /// <param name="signinID">签卡单ID</param> /// <returns></returns> public byte[] ExportEmployeeSignIn(string signinID) { try { EmployeeSignInRecordBLL bll = new EmployeeSignInRecordBLL(); T_HR_EMPLOYEESIGNINRECORD record = bll.GetEmployeeSigninRecordByID(signinID); string empName = string.Empty; if (record != null) { empName = record.EMPLOYEENAME; } var ent = this.GetEmployeeSignInDetailBySigninID(signinID); byte[] result; DataTable dt = TableToExportInit(); if (ent != null && ent.Any()) { DataTable dttoExport = GetDataConversion(dt, ent); result = Utility.OutFileStream(empName + Utility.GetResourceStr(" 异常签卡明细"), dttoExport); return(result); } else { return(null); } } catch (Exception ex) { SMT.Foundation.Log.Tracer.Debug("ExportEmployeeSignIn导出员工签卡信息:" + ex.Message); return(null); } }
/// <summary> /// 删除指定的签卡记录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnDelete_Click(object sender, RoutedEventArgs e) { if (dgSignInList.SelectedItems == null) { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON")); return; } if (dgSignInList.SelectedItems.Count == 0) { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON")); return; } ObservableCollection <string> ids = new ObservableCollection <string>(); foreach (object ovj in dgSignInList.SelectedItems) { T_HR_EMPLOYEESIGNINRECORD ent = ovj as T_HR_EMPLOYEESIGNINRECORD; if (ent == null) { continue; } if (ent.CHECKSTATE != Convert.ToInt32(CheckStates.UnSubmit).ToString()) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("DELETEAUDITERROR")); break; } ids.Add(ent.SIGNINID); } string Result = ""; ComfirmWindow delComfirm = new ComfirmWindow(); delComfirm.OnSelectionBoxClosed += (obj, result) => { clientAtt.EmployeeSigninRecordDeleteAsync(ids); }; delComfirm.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result); }
/// <summary> /// 弹出表单子窗口,以便编辑签卡记录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnEdit_Click(object sender, RoutedEventArgs e) { string strSignInID = string.Empty; if (dgSignInList.SelectedItems == null) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "EDIT")); return; } if (dgSignInList.SelectedItems.Count == 0) { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "EDIT")); return; } T_HR_EMPLOYEESIGNINRECORD entSignInRd = dgSignInList.SelectedItems[0] as T_HR_EMPLOYEESIGNINRECORD; //if (entSignInRd.OWNERID != SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID) //{ // Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), "只能修改自己的单据."); // return; //} if (entSignInRd.CHECKSTATE != "0") { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), "只能修改未提交的单据."); return; } strSignInID = entSignInRd.SIGNINID; SignInRdForm formSignInRd = new SignInRdForm(FormTypes.Edit, strSignInID); EntityBrowser entBrowser = new EntityBrowser(formSignInRd); entBrowser.FormType = FormTypes.Edit; entBrowser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); entBrowser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); }
public void EmployeeSigninRecordUpdate(T_HR_EMPLOYEESIGNINRECORD entity, List<T_HR_EMPLOYEESIGNINDETAIL> entityList) { using (EmployeeSignInRecordBLL bll = new EmployeeSignInRecordBLL()) { bll.EmployeeSigninRecordUpdate(entity, entityList); } }
/// <summary> /// 页面数据初始化 /// </summary> private void InitParas() { if (FormType == FormTypes.New) { SignInRecord = new T_HR_EMPLOYEESIGNINRECORD(); SignInRecord.SIGNINID = Guid.NewGuid().ToString(); SignInRecord.SIGNINTIME = DateTime.Now; SignInRecord.SIGNINCATEGORY = string.Empty; SignInRecord.EMPLOYEEID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; SignInRecord.EMPLOYEECODE = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeCode; SignInRecord.EMPLOYEENAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; SignInRecord.CHECKSTATE = Convert.ToInt32(SMT.SaaS.FrameworkUI.CheckStates.UnSubmit).ToString(); //权限控制 SignInRecord.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; SignInRecord.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; SignInRecord.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID; SignInRecord.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; //2010年2月11日, 11:37:35,目前暂未实现登录部分,人员相关数据为假定值 SignInRecord.CREATEDATE = DateTime.Now; SignInRecord.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; SignInRecord.UPDATEDATE = System.DateTime.Now; SignInRecord.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; SignInRecord.CREATECOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; SignInRecord.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; SignInRecord.CREATEPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID; //赋初始值 //SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE; //lkEmpName. //tbEmpName.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; 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; tbPostLevel.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostLevel.ToString(); ; if (!string.IsNullOrWhiteSpace(tbOrgName.Text)) { //tbEmpName.Text = tbEmpName.Text + "-" + tbOrgName.Text; lkEmployeeName.TxtLookUp.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName + "-" + tbOrgName.Text; ; } RefreshUI(RefreshedTypes.ShowProgressBar); clientAtt.GetAbnormRecordByEmployeeIDAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); //psClient.GetEmployeePostBriefByEmployeeIDAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); this.DataContext = SignInRecord; SetToolBar(); } else { RefreshUI(RefreshedTypes.ShowProgressBar); clientAtt.GetEmployeeSigninRecordByIDAsync(SignInID); if (FormType == FormTypes.Browse) { dgSignInDetailList.IsReadOnly = true; txtRemark.IsEnabled = false; } } #region 工具栏初始化 ToolBar.txtOtherName.Visibility = Visibility.Collapsed; ToolBar.txtOtherName.Text = string.Empty; ToolBar.btnImport.Visibility = Visibility.Collapsed; ToolBar.btnEdit.Visibility = Visibility.Collapsed; ToolBar.btnNew.Visibility = Visibility.Collapsed; ToolBar.btnDelete.Visibility = Visibility.Visible; ToolBar.btnSumbitAudit.Visibility = Visibility.Collapsed; ToolBar.btnAudit.Visibility = Visibility.Collapsed; ToolBar.btnRefresh.Visibility = Visibility.Collapsed; ToolBar.cbxCheckState.Visibility = Visibility.Collapsed; ToolBar.txtCheckStateName.Visibility = Visibility.Collapsed; ToolBar.btnEdit.Visibility = Visibility.Collapsed; ToolBar.btnAduitNoTPass.Visibility = Visibility.Collapsed; ToolBar.BtnView.Visibility = Visibility.Collapsed; ToolBar.retNew.Visibility = Visibility.Collapsed; ToolBar.retEdit.Visibility = Visibility.Collapsed; ToolBar.retAudit.Visibility = Visibility.Collapsed; ToolBar.retAuditNoPass.Visibility = Visibility.Collapsed; ToolBar.retRead.Visibility = Visibility.Collapsed; ToolBar.retPDF.Visibility = Visibility.Collapsed; ToolBar.retDelete.Visibility = Visibility.Collapsed; ToolBar.retRefresh.Visibility = Visibility.Collapsed; ToolBar.btnDelete.Click += new RoutedEventHandler(btnDelete_Click); #endregion }
private string GetXmlString(string StrSource, T_HR_EMPLOYEESIGNINRECORD Info) { //异常类型 var abnormcategoryDicts = (Application.Current.Resources["SYS_DICTIONARY"] as List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "ABNORMCATEGORY"); Dictionary<string, string> abnormcategory = new Dictionary<string, string>(); foreach (var abnorm in abnormcategoryDicts) { abnormcategory.Add(abnorm.DICTIONARYVALUE.ToString(), abnorm.DICTIONARYNAME); } //异常原因 var reasoncategoryDicts = (Application.Current.Resources["SYS_DICTIONARY"] as List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "REASONCATEGORY"); Dictionary<string, string> reson = new Dictionary<string, string>(); foreach (var reason in reasoncategoryDicts) { reson.Add(reason.DICTIONARYVALUE.ToString(), reason.DICTIONARYNAME); } //异常时间段 var dperiodDicts = (Application.Current.Resources["SYS_DICTIONARY"] as List<SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "ATTENDPERIOD"); Dictionary<string, string> dperiod = new Dictionary<string, string>(); foreach (var item in dperiodDicts) { dperiod.Add(item.DICTIONARYVALUE.ToString(), item.DICTIONARYNAME); } //审核状态 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(tbPostLevel.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_EMPLOYEESIGNINRECORD", "CHECKSTATE", "1", checkState)); AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "POSTLEVEL", tbPostLevel.Text, postLevelName)); AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "OWNERCOMPANYID", Info.OWNERCOMPANYID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName)); AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName)); AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "OWNERPOSTID", Info.OWNERPOSTID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostName)); AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "EMPLOYEEFULLNAME", Info.EMPLOYEENAME, lkEmployeeName.TxtLookUp.Text)); if (SignInDetailList.Count > 0) { //漏打 var entForgot = from ent in SignInDetailList where ent.REASONCATEGORY == "1" select ent; //因公外出 var entOuts = from ent in SignInDetailList where ent.REASONCATEGORY == "3" select ent; //没有因公外出则填充因公外出 if ( entOuts.Count() ==0) { AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "SIGNINCATEGORY", "1", "漏打")); } else { AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "SIGNINCATEGORY", "3", "因公外出")); } } foreach (var v in SignInDetailList) { AutoList.Add(basedataForChild("T_HR_EMPLOYEESIGNINDETAIL", "ABNORMCATEGORY", v.ABNORMCATEGORY, abnormcategory[v.ABNORMCATEGORY.ToString()], v.SIGNINDETAILID)); AutoList.Add(basedataForChild("T_HR_EMPLOYEESIGNINDETAIL", "REASONCATEGORY", v.REASONCATEGORY, reson[v.REASONCATEGORY.ToString()], v.SIGNINDETAILID)); AutoList.Add(basedataForChild("T_HR_EMPLOYEESIGNINDETAIL", "ATTENDPERIOD", v.ATTENDPERIOD, dperiod[v.ATTENDPERIOD.ToString()], v.SIGNINDETAILID)); AutoList.Add(basedataForChild("T_HR_EMPLOYEESIGNINDETAIL", "SIGNINID", Info.SIGNINID, "", v.SIGNINDETAILID)); if (v.ABNORMALDATE!=null) { //日期格式tostring的时候程序会根据本机电脑设置的事情格式去生成,所以这里要加和格式设置(很奇怪吧,很多情况都会这样,例如我把我电脑日期设置后面加上中文"哈哈",那么日期格式tostring的时候就会变成"2013-8-1 哈哈") AutoList.Add(basedataForChild("T_HR_EMPLOYEESIGNINDETAIL", "ABNORMALDATE", v.ABNORMALDATE.Value.ToString("yyyy-MM-dd"), v.ABNORMALDATE.Value.ToString("yyyy-MM-dd"), v.SIGNINDETAILID)); } } string a = mx.TableToXml(Info, SignInDetailList, StrSource, AutoList); return a; }
public string EmployeeSignInRecordAdd(T_HR_EMPLOYEESIGNINRECORD entity, List<T_HR_EMPLOYEESIGNINDETAIL> entityList) { using (EmployeeSignInRecordBLL bll = new EmployeeSignInRecordBLL()) { return bll.EmployeeSignInRecordAdd(entity, entityList); } }
private string GetXmlString(string StrSource, T_HR_EMPLOYEESIGNINRECORD Info) { return(""); }
/// <summary> /// 页面数据初始化 /// </summary> private void InitParas() { if (FormType == FormTypes.New) { SignInRecord = new T_HR_EMPLOYEESIGNINRECORD(); SignInRecord.SIGNINID = Guid.NewGuid().ToString(); SignInRecord.SIGNINTIME = DateTime.Now; SignInRecord.SIGNINCATEGORY = string.Empty; SignInRecord.EMPLOYEEID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; SignInRecord.EMPLOYEECODE = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeCode; SignInRecord.EMPLOYEENAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; SignInRecord.CHECKSTATE = Convert.ToInt32(SMT.SaaS.FrameworkUI.CheckStates.UnSubmit).ToString(); //权限控制 SignInRecord.OWNERCOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; SignInRecord.OWNERDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; SignInRecord.OWNERPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID; SignInRecord.OWNERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; //2010年2月11日, 11:37:35,目前暂未实现登录部分,人员相关数据为假定值 SignInRecord.CREATEDATE = DateTime.Now; SignInRecord.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; SignInRecord.UPDATEDATE = System.DateTime.Now; SignInRecord.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; SignInRecord.CREATECOMPANYID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; SignInRecord.CREATEDEPARTMENTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; SignInRecord.CREATEPOSTID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostID; //赋初始值 //SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE ent = lkEmpName.SelectedObj[0].ObjectInstance as SMT.Saas.Tools.PersonnelWS.T_HR_EMPLOYEE; //lkEmpName. //tbEmpName.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; 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; tbPostLevel.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostLevel.ToString();; if (!string.IsNullOrWhiteSpace(tbOrgName.Text)) { //tbEmpName.Text = tbEmpName.Text + "-" + tbOrgName.Text; lkEmployeeName.TxtLookUp.Text = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName + "-" + tbOrgName.Text;; } RefreshUI(RefreshedTypes.ShowProgressBar); clientAtt.GetAbnormRecordByEmployeeIDAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); //psClient.GetEmployeePostBriefByEmployeeIDAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); this.DataContext = SignInRecord; SetToolBar(); } else { RefreshUI(RefreshedTypes.ShowProgressBar); clientAtt.GetEmployeeSigninRecordByIDAsync(SignInID); if (FormType == FormTypes.Browse) { dgSignInDetailList.IsReadOnly = true; txtRemark.IsEnabled = false; } } #region 工具栏初始化 ToolBar.txtOtherName.Visibility = Visibility.Collapsed; ToolBar.txtOtherName.Text = string.Empty; ToolBar.btnImport.Visibility = Visibility.Collapsed; ToolBar.btnEdit.Visibility = Visibility.Collapsed; ToolBar.btnNew.Visibility = Visibility.Collapsed; ToolBar.btnDelete.Visibility = Visibility.Visible; ToolBar.btnSumbitAudit.Visibility = Visibility.Collapsed; ToolBar.btnAudit.Visibility = Visibility.Collapsed; ToolBar.btnRefresh.Visibility = Visibility.Collapsed; ToolBar.cbxCheckState.Visibility = Visibility.Collapsed; ToolBar.txtCheckStateName.Visibility = Visibility.Collapsed; ToolBar.btnEdit.Visibility = Visibility.Collapsed; ToolBar.btnAduitNoTPass.Visibility = Visibility.Collapsed; ToolBar.BtnView.Visibility = Visibility.Collapsed; ToolBar.retNew.Visibility = Visibility.Collapsed; ToolBar.retEdit.Visibility = Visibility.Collapsed; ToolBar.retAudit.Visibility = Visibility.Collapsed; ToolBar.retAuditNoPass.Visibility = Visibility.Collapsed; ToolBar.retRead.Visibility = Visibility.Collapsed; ToolBar.retPDF.Visibility = Visibility.Collapsed; ToolBar.retDelete.Visibility = Visibility.Collapsed; ToolBar.retRefresh.Visibility = Visibility.Collapsed; ToolBar.btnDelete.Click += new RoutedEventHandler(btnDelete_Click); #endregion }
private string GetXmlString(string StrSource, T_HR_EMPLOYEESIGNINRECORD Info) { //异常类型 var abnormcategoryDicts = (Application.Current.Resources["SYS_DICTIONARY"] as List <SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "ABNORMCATEGORY"); Dictionary <string, string> abnormcategory = new Dictionary <string, string>(); foreach (var abnorm in abnormcategoryDicts) { abnormcategory.Add(abnorm.DICTIONARYVALUE.ToString(), abnorm.DICTIONARYNAME); } //异常原因 var reasoncategoryDicts = (Application.Current.Resources["SYS_DICTIONARY"] as List <SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "REASONCATEGORY"); Dictionary <string, string> reson = new Dictionary <string, string>(); foreach (var reason in reasoncategoryDicts) { reson.Add(reason.DICTIONARYVALUE.ToString(), reason.DICTIONARYNAME); } //异常时间段 var dperiodDicts = (Application.Current.Resources["SYS_DICTIONARY"] as List <SMT.Saas.Tools.PermissionWS.T_SYS_DICTIONARY>).Where(s => s.DICTIONCATEGORY == "ATTENDPERIOD"); Dictionary <string, string> dperiod = new Dictionary <string, string>(); foreach (var item in dperiodDicts) { dperiod.Add(item.DICTIONARYVALUE.ToString(), item.DICTIONARYNAME); } //审核状态 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(tbPostLevel.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_EMPLOYEESIGNINRECORD", "CHECKSTATE", "1", checkState)); AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "POSTLEVEL", tbPostLevel.Text, postLevelName)); AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "OWNERCOMPANYID", Info.OWNERCOMPANYID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName)); AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "OWNERDEPARTMENTID", Info.OWNERDEPARTMENTID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName)); AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "OWNERPOSTID", Info.OWNERPOSTID, SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostName)); AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "EMPLOYEEFULLNAME", Info.EMPLOYEENAME, lkEmployeeName.TxtLookUp.Text)); if (SignInDetailList.Count > 0) { //签卡类型 AutoList.Add(basedata("T_HR_EMPLOYEESIGNINRECORD", "SIGNINCATEGORY", SignInDetailList[0].REASONCATEGORY, reson[SignInDetailList[0].REASONCATEGORY.ToString()])); } foreach (var v in SignInDetailList) { AutoList.Add(basedataForChild("T_HR_EMPLOYEESIGNINDETAIL", "ABNORMCATEGORY", v.ABNORMCATEGORY, abnormcategory[v.ABNORMCATEGORY.ToString()], v.SIGNINDETAILID)); AutoList.Add(basedataForChild("T_HR_EMPLOYEESIGNINDETAIL", "REASONCATEGORY", v.REASONCATEGORY, reson[v.REASONCATEGORY.ToString()], v.SIGNINDETAILID)); AutoList.Add(basedataForChild("T_HR_EMPLOYEESIGNINDETAIL", "ATTENDPERIOD", v.ATTENDPERIOD, dperiod[v.ATTENDPERIOD.ToString()], v.SIGNINDETAILID)); AutoList.Add(basedataForChild("T_HR_EMPLOYEESIGNINDETAIL", "SIGNINID", Info.SIGNINID, "", v.SIGNINDETAILID)); if (v.ABNORMALDATE != null) { //日期格式tostring的时候程序会根据本机电脑设置的事情格式去生成,所以这里要加和格式设置(很奇怪吧,很多情况都会这样,例如我把我电脑日期设置后面加上中文"哈哈",那么日期格式tostring的时候就会变成"2013-8-1 哈哈") AutoList.Add(basedataForChild("T_HR_EMPLOYEESIGNINDETAIL", "ABNORMALDATE", v.ABNORMALDATE.Value.ToString("yyyy-MM-dd"), v.ABNORMALDATE.Value.ToString("yyyy-MM-dd"), v.SIGNINDETAILID)); } } string a = mx.TableToXml(Info, SignInDetailList, StrSource, AutoList); return(a); }
private void DeleteSigFromAbnormal(T_HR_EMPLOYEEABNORMRECORD AbnormRecorditem) { try { int i = 0; var sigs = from sig in dal.GetObjects <T_HR_EMPLOYEESIGNINDETAIL>().Include("T_HR_EMPLOYEESIGNINRECORD") where sig.T_HR_EMPLOYEEABNORMRECORD.ABNORMRECORDID == AbnormRecorditem.ABNORMRECORDID select sig; if (sigs.Count() > 0) { string sigMasterId = string.Empty; if (sigs.FirstOrDefault().T_HR_EMPLOYEESIGNINRECORD != null) { sigMasterId = sigs.FirstOrDefault().T_HR_EMPLOYEESIGNINRECORD.SIGNINID; } foreach (var sig in sigs.ToList()) { try { i = dal.Delete(sig); Tracer.Debug("删除签卡明细,员工id:" + sig.OWNERID + " 异常日期:" + sig.ABNORMALDATE + "异常时长" + sig.ABNORMALTIME + " 异常时段:" + sig.ATTENDPERIOD + "异常类型" + sig.ABNORMCATEGORY + "异常签卡状态为:" + AbnormRecorditem.SINGINSTATE + " 删除的签卡明细记录: " + i + " 条"); } catch (Exception ex) { Tracer.Debug("删除签卡明细异常,员工id:" + sig.OWNERID + " 异常日期:" + sig.ABNORMALDATE + "异常时长" + sig.ABNORMALTIME + " 异常时段:" + sig.ATTENDPERIOD + "异常类型" + sig.ABNORMCATEGORY + " 异常信息:" + ex.ToString()); } } if (!string.IsNullOrEmpty(sigMasterId)) { var sigMaster = from sigM in dal.GetObjects <T_HR_EMPLOYEESIGNINRECORD>().Include("T_HR_EMPLOYEESIGNINDETAIL") where sigM.SIGNINID == sigMasterId select sigM; if (sigMaster.Count() > 0) { if (sigMaster.FirstOrDefault().T_HR_EMPLOYEESIGNINDETAIL.Count() < 1) { T_HR_EMPLOYEESIGNINRECORD record = sigMaster.FirstOrDefault(); //如果当天异常时间已全部被请假时间涵盖,删除签卡提醒并标记考勤为请假 try { SMT.SaaS.BLLCommonServices.Utility.RemoveMyRecord <T_HR_EMPLOYEESIGNINRECORD>(record); Tracer.Debug("关闭签卡我的单据,员工名:" + record.EMPLOYEENAME + " 员工id:" + record.EMPLOYEEID + " 创建日期:" + record.CREATEDATE + " 签卡备注" + record.REMARK + " 签卡时间:" + record.SIGNINTIME); List <string> list = new List <string>() { record.SIGNINID }; if (CloseAttendAbnormAlarmMsg(list, "T_HR_EMPLOYEESIGNINRECORD", "")) { Tracer.Debug("关闭签卡待办成功,员工名:" + record.EMPLOYEENAME + " 员工id:" + record.EMPLOYEEID + "员工id为空关闭所有代办,包括审核中的。 创建日期:" + record.CREATEDATE + " 签卡备注" + record.REMARK + " 签卡时间:" + record.SIGNINTIME); } } catch (Exception ex) { SMT.Foundation.Log.Tracer.Debug("删除我的单据或关闭待办出现错误" + ex.ToString()); } try { i = dal.Delete(record); Tracer.Debug("删除签卡主表,员工名:" + record.EMPLOYEENAME + " 员工id:" + record.EMPLOYEEID + " 创建日期:" + record.CREATEDATE + " 签卡备注" + record.REMARK + " 签卡时间:" + record.SIGNINTIME); } catch (Exception ex) { Tracer.Debug("删除签卡主表异常,员工名:" + record.EMPLOYEENAME + " 员工id:" + record.EMPLOYEEID + " 创建日期:" + record.CREATEDATE + " 签卡备注" + record.REMARK + " 签卡时间:" + record.SIGNINTIME + " 异常信息:" + ex.ToString()); } } } } } } catch (Exception ex) { Tracer.Debug("DeleteSigFromAbnormal异常:" + ex.ToString()); } }
private string GetXmlString(string StrSource, T_HR_EMPLOYEESIGNINRECORD Info) { return ""; }