private void myBtn_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; btn.IsEnabled = false; if (DaGr.SelectedItems == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "OPERATION"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } if (DaGr.SelectedItems.Count == 0) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "OPERATION"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } ///luojie 20120808 ///未报销按钮的权限控制,同修改按钮 V_Travelmanagement entrb = new V_Travelmanagement(); entrb = DaGr.SelectedItems[0] as V_Travelmanagement; if (SMT.SaaS.FrameworkUI.Common.Utility.ToolBarButtonOperationPermission(entrb, "T_OA_BUSINESSTRIP", OperationType.Edit, Common.CurrentLoginUserInfo.EmployeeID)) { for (int i = 0; i < DaGr.SelectedItems.Count; i++) { V_Travelmanagement ent = new V_Travelmanagement(); ent = (DaGr.SelectedItems[i] as V_Travelmanagement); reportid = ent.ReportId; businesstrID = ent.Travelmanagement.BUSINESSTRIPID; travelreimbursementId = ent.TrId; Tdetail = ent.Tdetail; } if (!string.IsNullOrEmpty(travelreimbursementId) && travelreimbursementId != "空" && Tdetail > 0)//如果已生成报销单,直接打开表单提交 { WhetherReimbursement = false; BusinessApplicationsForm AddWin = new BusinessApplicationsForm(FormTypes.Edit, businesstrID, WhetherReimbursement); EntityBrowser browser = new EntityBrowser(AddWin); browser.RemoveSMTLoading(); browser.FormType = FormTypes.Edit; browser.EntityBrowseToolBar.MaxHeight = 0; browser.MinWidth = 980; browser.MinHeight = 445; browser.TitleContent = "出差申请"; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); } else { ReimbursementSwitch = true;//出差报销开关 Travelmanagement.GetTravelmanagementByIdAsync(businesstrID, btn); } } else { Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("对不起,您没有修改该用户报销的权限")); } }
private void ReportBtn_Click(object sender, RoutedEventArgs e) { try { V_Travelmanagement ent = new V_Travelmanagement(); ent = (DaGr.SelectedItems[0] as V_Travelmanagement); ///增加重新提交的判断,审核通过的不允许重新提交 if (ent.TraveAppCheckState != "1" && ent.Travelmanagement.ISALTERTRAVE == "1" && (ent.TrCheckState == "0" || string.IsNullOrEmpty(ent.TrCheckState))) { alterTravelBusiness(ent); } else { if (ent.TraveAppCheckState == "2" && ent.TrCheckState == "2") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("已审核通过的出差报销不能修改行程"), Utility.GetResourceStr("确定"), MessageIcon.Exclamation); return; } if (ent.TraveAppCheckState == "2" && (ent.TrCheckState == "0" || string.IsNullOrEmpty(ent.TrCheckState))) { alterTravelBusiness(ent); } else { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "出差申请终审后出差报销未提交之前方可修改行程。" , Utility.GetResourceStr("CONFIRM"), MessageIcon.Information); } } } catch (Exception ex) { Utility.SetLogAndShowLog(ex.ToString()); } }
void btnAudit_Click(object sender, RoutedEventArgs e) { if (DaGr.SelectedItems == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "AUDIT"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } if (DaGr.SelectedItems.Count == 0) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "AUDIT"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } V_Travelmanagement ent = new V_Travelmanagement(); ent = (DaGr.SelectedItems[0] as V_Travelmanagement); BusinessApplicationsForm AddWin = new BusinessApplicationsForm(FormTypes.Audit, ent.Travelmanagement.BUSINESSTRIPID); EntityBrowser browser = new EntityBrowser(AddWin); browser.RemoveSMTLoading(); browser.EntityBrowseToolBar.MaxHeight = 0; browser.FormType = FormTypes.Audit; browser.MinWidth = 728; browser.MinHeight = 445; browser.TitleContent = "出差申请"; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); }
private void ReportBtn_Click(object sender, RoutedEventArgs e) { try { V_Travelmanagement ent = new V_Travelmanagement(); ent = (DaGr.SelectedItems[0] as V_Travelmanagement); ///增加重新提交的判断,审核通过的不允许重新提交 if (ent.TraveAppCheckState!="1" && ent.Travelmanagement.ISALTERTRAVE == "1" && (ent.TrCheckState == "0" || string.IsNullOrEmpty(ent.TrCheckState))) { alterTravelBusiness(ent); } else { if (ent.TraveAppCheckState == "2" && ent.TrCheckState == "2") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("已审核通过的出差报销不能修改行程"), Utility.GetResourceStr("确定"), MessageIcon.Exclamation); return; } if (ent.TraveAppCheckState == "2" && (ent.TrCheckState == "0" || string.IsNullOrEmpty(ent.TrCheckState))) { alterTravelBusiness(ent); } else { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "出差申请终审后出差报销未提交之前方可修改行程。" , Utility.GetResourceStr("CONFIRM"), MessageIcon.Information); } } } catch (Exception ex) { Utility.SetLogAndShowLog(ex.ToString()); } }
public V_Travelmanagement GetAccordingToBusinesstripIdCheck(string businesstripId) { using (TravelmanagementBLL TL = new TravelmanagementBLL()) { V_Travelmanagement TravelmanagementById = TL.GetAccordingToBusinesstripIdCheck(businesstripId); return(TravelmanagementById == null ? null : TravelmanagementById); } }
private void myBtn_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; btn.IsEnabled = false; if (DaGr.SelectedItems == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "OPERATION"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } if (DaGr.SelectedItems.Count == 0) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "OPERATION"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } ///luojie 20120808 ///未报销按钮的权限控制,同修改按钮 V_Travelmanagement entrb = new V_Travelmanagement(); entrb = DaGr.SelectedItems[0] as V_Travelmanagement; if (SMT.SaaS.FrameworkUI.Common.Utility.ToolBarButtonOperationPermission(entrb, "T_OA_BUSINESSTRIP", OperationType.Edit, Common.CurrentLoginUserInfo.EmployeeID)) { for (int i = 0; i < DaGr.SelectedItems.Count; i++) { V_Travelmanagement ent = new V_Travelmanagement(); ent = (DaGr.SelectedItems[i] as V_Travelmanagement); reportid = ent.ReportId; businesstrID = ent.Travelmanagement.BUSINESSTRIPID; travelreimbursementId = ent.TrId; Tdetail = ent.Tdetail; } if (!string.IsNullOrEmpty(travelreimbursementId) && travelreimbursementId != "空" && Tdetail > 0)//如果已生成报销单,直接打开表单提交 { WhetherReimbursement = false; BusinessApplicationsForm AddWin = new BusinessApplicationsForm(FormTypes.Edit, businesstrID, WhetherReimbursement); EntityBrowser browser = new EntityBrowser(AddWin); browser.RemoveSMTLoading(); browser.FormType = FormTypes.Edit; browser.EntityBrowseToolBar.MaxHeight = 0; browser.MinWidth = 980; browser.MinHeight = 445; browser.TitleContent = "出差申请"; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); } else { ReimbursementSwitch = true;//出差报销开关 Travelmanagement.GetTravelmanagementByIdAsync(businesstrID, btn); } } else { Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("对不起,您没有修改该用户报销的权限")); } }
private void alterTravelBusiness(V_Travelmanagement ent) { BusinessApplicationsForm AddWin = new BusinessApplicationsForm(FormTypes.Resubmit, ent.Travelmanagement.BUSINESSTRIPID); AddWin.isAlterTrave = true; EntityBrowser browser = new EntityBrowser(AddWin); browser.RemoveSMTLoading(); browser.EntityBrowseToolBar.MaxHeight = 0; browser.FormType = FormTypes.Resubmit; browser.MinWidth = 980; browser.MinHeight = 445; browser.TitleContent = "出差申请修改行程"; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.EntityEditor = AddWin; browser.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); }
private void alterTravelBusiness(V_Travelmanagement ent) { BusinessApplicationsForm AddWin = new BusinessApplicationsForm(FormTypes.Resubmit, ent.Travelmanagement.BUSINESSTRIPID); AddWin.isAlterTrave = true; EntityBrowser browser = new EntityBrowser(AddWin); browser.RemoveSMTLoading(); browser.EntityBrowseToolBar.MaxHeight = 0; browser.FormType = FormTypes.Resubmit; browser.MinWidth = 980; browser.MinHeight = 445; browser.TitleContent = "出差申请修改行程"; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.EntityEditor = AddWin; browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); }
///// <summary> ///// 加载字典 ///// </summary> ///// <param name="sender"></param> ///// <param name="e"></param> //void DictManager_OnDictionaryLoadCompleted(object sender, OnDictionaryLoadArgs e) //{ // if (e.Error == null && e.Result) // { // SearchUserID = Common.CurrentLoginUserInfo.EmployeeID; // string Name = ""; // Name = Common.CurrentLoginUserInfo.EmployeeName + "-" + Common.CurrentLoginUserInfo.UserPosts[0].PostName + "-" + Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName + "-" + Common.CurrentLoginUserInfo.UserPosts[0].CompanyName; // txtSearchID.Text = Name; // ToolTipService.SetToolTip(txtSearchID, Name); // } // else // { // ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "字典加载错误,请联系管理员", // Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); // return; // } //} #endregion #region 重新提交 void btnReSubmit_Click(object sender, RoutedEventArgs e) { if (DaGr.SelectedItems == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "ReSubmit"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } if (DaGr.SelectedItems.Count == 0) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "ReSubmit"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } V_Travelmanagement ent = new V_Travelmanagement(); ent = (DaGr.SelectedItems[0] as V_Travelmanagement); ///luojie ///增加重新提交的判断,审核通过的不允许重新提交 if (ent.TraveAppCheckState == "2" && ent.TrCheckState == "2") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("已审核通过的出差报销不能重新提交"), Utility.GetResourceStr("确定"), MessageIcon.Exclamation); return; } if (ent.TraveAppCheckState == "2" && ent.TrCheckState != "3") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("已审核通过的出差申请不能重新提交"), Utility.GetResourceStr("确定"), MessageIcon.Exclamation); return; } BusinessApplicationsForm AddWin = new BusinessApplicationsForm(FormTypes.Resubmit, ent.Travelmanagement.BUSINESSTRIPID); EntityBrowser browser = new EntityBrowser(AddWin); browser.RemoveSMTLoading(); browser.EntityBrowseToolBar.MaxHeight = 0; browser.FormType = FormTypes.Resubmit; browser.MinWidth = 980; browser.MinHeight = 445; browser.TitleContent = "出差申请"; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.EntityEditor = AddWin; browser.Show <string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); }
void btnEdit_Click(object sender, RoutedEventArgs e) { if (DaGr.SelectedItems == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } if (DaGr.SelectedItems.Count == 0) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } V_Travelmanagement ent = new V_Travelmanagement(); ent = (DaGr.SelectedItems[0] as V_Travelmanagement); if (SMT.SaaS.FrameworkUI.Common.Utility.ToolBarButtonOperationPermission(ent, "T_OA_BUSINESSTRIP", OperationType.Edit, Common.CurrentLoginUserInfo.EmployeeID)) { BusinessApplicationsForm AddWin = new BusinessApplicationsForm(FormTypes.Edit, ent.Travelmanagement.BUSINESSTRIPID); EntityBrowser browser = new EntityBrowser(AddWin); AddWin.ParentEntityBrowser = browser; browser.RemoveSMTLoading(); browser.EntityBrowseToolBar.MaxHeight = 0; browser.FormType = FormTypes.Edit; browser.MinWidth = 980; browser.MinHeight = 445; browser.TitleContent = "出差申请"; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show <string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); } else { Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("YOUDONOTHAVEPERMISSIONTOOPERATETHEDATA")); } }
void btnAudit_Click(object sender, RoutedEventArgs e) { if (DaGr.SelectedItems == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "AUDIT"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } if (DaGr.SelectedItems.Count == 0) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "AUDIT"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } V_Travelmanagement ent = new V_Travelmanagement(); ent = (DaGr.SelectedItems[0] as V_Travelmanagement); BusinessApplicationsForm AddWin = new BusinessApplicationsForm(FormTypes.Audit, ent.Travelmanagement.BUSINESSTRIPID); EntityBrowser browser = new EntityBrowser(AddWin); browser.RemoveSMTLoading(); browser.EntityBrowseToolBar.MaxHeight = 0; browser.FormType = FormTypes.Audit; browser.MinWidth = 728; browser.MinHeight = 445; browser.TitleContent = "出差申请"; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); }
void btnEdit_Click(object sender, RoutedEventArgs e) { if (DaGr.SelectedItems == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } if (DaGr.SelectedItems.Count == 0) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTDATAALERT"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } V_Travelmanagement ent = new V_Travelmanagement(); ent = (DaGr.SelectedItems[0] as V_Travelmanagement); if (SMT.SaaS.FrameworkUI.Common.Utility.ToolBarButtonOperationPermission(ent, "T_OA_BUSINESSTRIP", OperationType.Edit, Common.CurrentLoginUserInfo.EmployeeID)) { BusinessApplicationsForm AddWin = new BusinessApplicationsForm(FormTypes.Edit, ent.Travelmanagement.BUSINESSTRIPID); EntityBrowser browser = new EntityBrowser(AddWin); AddWin.ParentEntityBrowser = browser; browser.RemoveSMTLoading(); browser.EntityBrowseToolBar.MaxHeight = 0; browser.FormType = FormTypes.Edit; browser.MinWidth = 980; browser.MinHeight = 445; browser.TitleContent = "出差申请"; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.Show<string>(DialogMode.Default, Common.ParentLayoutRoot, "", (result) => { }); } else { Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("YOUDONOTHAVEPERMISSIONTOOPERATETHEDATA")); } }
///// <summary> ///// 加载字典 ///// </summary> ///// <param name="sender"></param> ///// <param name="e"></param> //void DictManager_OnDictionaryLoadCompleted(object sender, OnDictionaryLoadArgs e) //{ // if (e.Error == null && e.Result) // { // SearchUserID = Common.CurrentLoginUserInfo.EmployeeID; // string Name = ""; // Name = Common.CurrentLoginUserInfo.EmployeeName + "-" + Common.CurrentLoginUserInfo.UserPosts[0].PostName + "-" + Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName + "-" + Common.CurrentLoginUserInfo.UserPosts[0].CompanyName; // txtSearchID.Text = Name; // ToolTipService.SetToolTip(txtSearchID, Name); // } // else // { // ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "字典加载错误,请联系管理员", // Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); // return; // } //} #endregion #region 重新提交 void btnReSubmit_Click(object sender, RoutedEventArgs e) { if (DaGr.SelectedItems == null) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "ReSubmit"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } if (DaGr.SelectedItems.Count == 0) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("SELECTERROR", "ReSubmit"), Utility.GetResourceStr("CONFIRMBUTTON"), MessageIcon.Exclamation); return; } V_Travelmanagement ent = new V_Travelmanagement(); ent = (DaGr.SelectedItems[0] as V_Travelmanagement); ///luojie ///增加重新提交的判断,审核通过的不允许重新提交 if (ent.TraveAppCheckState == "2" && ent.TrCheckState == "2") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("已审核通过的出差报销不能重新提交"), Utility.GetResourceStr("确定"), MessageIcon.Exclamation); return; } if (ent.TraveAppCheckState == "2" && ent.TrCheckState != "3") { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("已审核通过的出差申请不能重新提交"), Utility.GetResourceStr("确定"), MessageIcon.Exclamation); return; } BusinessApplicationsForm AddWin = new BusinessApplicationsForm(FormTypes.Resubmit, ent.Travelmanagement.BUSINESSTRIPID); EntityBrowser browser = new EntityBrowser(AddWin); browser.RemoveSMTLoading(); browser.EntityBrowseToolBar.MaxHeight = 0; browser.FormType = FormTypes.Resubmit; browser.MinWidth = 980; browser.MinHeight = 445; browser.TitleContent = "出差申请"; browser.ReloadDataEvent += new EntityBrowser.refreshGridView(browser_ReloadDataEvent); browser.EntityEditor = AddWin; browser.Show<string>(DialogMode.Default, SMT.SAAS.Main.CurrentContext.Common.ParentLayoutRoot, "", (result) => { }); }
void Travelmanagement_GetAccordingToBusinesstripIdCheckCompleted(object sender, GetAccordingToBusinesstripIdCheckCompletedEventArgs e) { try { if (e.Result != null) { TraveView = e.Result; //missionReportsID = TraveView.ReportId; travelReimbursementID = TraveView.TrId; traverlCheck = TraveView.TraveAppCheckState; //reportCheckState = TraveView.ReportCheckState; trCheckState = TraveView.TrCheckState; SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("打开出差form获取到的出差报销id:" + TraveView.TrId); } else { SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("GetAccordingToBusinesstripId返回结果为空"); } //判断出差报销是否存在 bool BoolReimID = !string.IsNullOrEmpty(travelReimbursementID) && travelReimbursementID != "空"; if (false == BoolReimID) { traveformFather.Visibility = Visibility.Collapsed; //出差报销Tab } if (traverlCheck != Convert.ToInt32(CheckStates.Approved).ToString()) { traveformFather.Visibility = Visibility.Collapsed;//出差报销Tab } else { if ((trCheckState == "0" || trCheckState == "1" || trCheckState == "3") && !isAlterTrave) { TabTravel.SelectedIndex = 2; if (actions != FormTypes.Browse && actions != FormTypes.Edit) { tbbTravelapplication.Visibility = Visibility.Collapsed;//隐藏出差申请Tab //TabReport.Visibility = Visibility.Collapsed;//隐藏出差报告Tab } } } if (actions == FormTypes.New)//新增 { //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈 TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.New, ""); //TravelapplicationForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; TravelapplicationForm.ParentEntityBrowser = this.ParentEntityBrowser; EntityBrowser TravelBrowser = new EntityBrowser(TravelapplicationForm); TravelBrowser.FormType = FormTypes.New; TravelBrowser.MinWidth = 980; TravelBrowser.MinHeight = 445; TravelapplicationGd.Children.Add(TravelBrowser); } else if (actions == FormTypes.Edit) { //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈 //TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.Edit, businesstrID); //2012-9-21 ljx TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.Edit, TraveView.Travelmanagement.BUSINESSTRIPID); //TravelapplicationForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; TravelapplicationForm.ParentEntityBrowser = this.ParentEntityBrowser; EntityBrowser TravelBrowser = new EntityBrowser(TravelapplicationForm); TravelBrowser.FormType = FormTypes.Edit; //TravelBrowser.MinWidth = 980; TravelBrowser.MinHeight = 445; TravelapplicationGd.Children.Add(TravelBrowser); if (BoolReimID && traverlCheck == Convert.ToInt32(CheckStates.Approved).ToString()) { //出差报销 TravelReimbursementControl TravelReimbursementForm = new TravelReimbursementControl(FrameworkUI.FormTypes.Edit, travelReimbursementID, businesstrID); //TravelReimbursementForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; TravelReimbursementForm.ParentEntityBrowser = this.ParentEntityBrowser; TravelReimbursementForm.OpenFrom = OpenFrom; EntityBrowser TravelReimbursementBrowser = new EntityBrowser(TravelReimbursementForm); TravelReimbursementBrowser.FormType = FormTypes.Edit; //Canvas can = new Canvas(); //TravelReimbursementBrowser.MinWidth = 980; TravelReimbursementBrowser.MinHeight = 445; TravelReimbursementGd.Children.Add(TravelReimbursementBrowser); } } else if (actions == FormTypes.Browse) { //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈 TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.Browse, businesstrID); //TravelapplicationForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelBrowser = new EntityBrowser(TravelapplicationForm); TravelBrowser.FormType = FormTypes.Browse; TravelBrowser.MinWidth = 728; TravelBrowser.MinHeight = 445; TravelapplicationGd.Children.Add(TravelBrowser); if (BoolReimID && traverlCheck == Convert.ToInt32(CheckStates.Approved).ToString()) { //出差报销 TravelReimbursementControl TravelReimbursementForm = new TravelReimbursementControl(FrameworkUI.FormTypes.Browse, travelReimbursementID, businesstrID); //TravelReimbursementForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelReimbursementBrowser = new EntityBrowser(TravelReimbursementForm); TravelReimbursementBrowser.FormType = FormTypes.Browse; //Canvas can = new Canvas(); TravelReimbursementBrowser.MinWidth = 728; TravelReimbursementBrowser.MinHeight = 445; TravelReimbursementGd.Children.Add(TravelReimbursementBrowser); } } else if (actions == FormTypes.Audit) { //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈 TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.Audit, businesstrID); //TravelapplicationForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelBrowser = new EntityBrowser(TravelapplicationForm); TravelBrowser.FormType = FormTypes.Audit; TravelBrowser.MinWidth = 728; TravelBrowser.MinHeight = 445; TravelapplicationGd.Children.Add(TravelBrowser); if (BoolReimID && traverlCheck == Convert.ToInt32(CheckStates.Approved).ToString()) { //出差报销 TravelReimbursementControl TravelReimbursementForm = new TravelReimbursementControl(FrameworkUI.FormTypes.Audit, travelReimbursementID, businesstrID); //TravelReimbursementForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelReimbursementBrowser = new EntityBrowser(TravelReimbursementForm); TravelReimbursementBrowser.FormType = FormTypes.Audit; //Canvas can = new Canvas(); TravelReimbursementBrowser.MinWidth = 728; TravelReimbursementBrowser.MinHeight = 445; TravelReimbursementGd.Children.Add(TravelReimbursementBrowser); } } else { //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈 if (traverlCheck != "3" && !isAlterTrave) { tbbTravelapplication.Visibility = Visibility.Collapsed;//出差申请Tab } else { //重新提交(或修改行程) TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.Resubmit, businesstrID); //TravelapplicationForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelBrowser = new EntityBrowser(TravelapplicationForm); TravelBrowser.FormType = FormTypes.Resubmit; TravelBrowser.MinWidth = 980; TravelBrowser.MinHeight = 445; TravelapplicationGd.Children.Add(TravelBrowser); if (isAlterTrave) { //traveformFather.Visibility = Visibility.Collapsed; //TravelapplicationGd.Visibility = Visibility.Visible; //tbbTravelapplication.Visibility = Visibility.Visible; //TabTravel.SelectedIndex = 1; TravelapplicationForm.isAlterTrave = true; } } if (trCheckState != "3") { traveformFather.Visibility = Visibility.Collapsed;//出差报销Tab } else { if (BoolReimID && traverlCheck == Convert.ToInt32(CheckStates.Approved).ToString()) { //出差报销 TravelReimbursementControl TravelReimbursementForm = new TravelReimbursementControl(FrameworkUI.FormTypes.Resubmit, travelReimbursementID, businesstrID); //TravelReimbursementForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelReimbursementBrowser = new EntityBrowser(TravelReimbursementForm); TravelReimbursementBrowser.FormType = FormTypes.Resubmit; TravelReimbursementBrowser.MinWidth = 980; TravelReimbursementBrowser.MinHeight = 445; TravelReimbursementGd.Children.Add(TravelReimbursementBrowser); } } } } catch (Exception ex) { RefreshUI(RefreshedTypes.HideProgressBar); SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("打开出差form,获取出差异常:" + ex.ToString()); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "打开出差form,获取出差异常:" + ex.ToString(), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } }
private void DaGr_LoadingRow(object sender, DataGridRowEventArgs e) { V_Travelmanagement tmp = (V_Travelmanagement)e.Row.DataContext; string reportId = tmp.ReportId; //报告ID string bursementId = tmp.TrId; //报销ID string reportCheckS = tmp.ReportCheckState; //出差报告审核状态 string AppCheckS = tmp.Travelmanagement.CHECKSTATE; //出差申请审核状态 string trCheckS = tmp.TrCheckState; //报销审核状态 SetRowLogo(DaGr, e.Row, "T_OA_BUSINESSTRIP"); Button ReportButton_Addbaodao = DaGr.Columns[11].GetCellContent(e.Row).FindName("ReportBtn") as Button; Button MyButton_Addbaodao = DaGr.Columns[12].GetCellContent(e.Row).FindName("myBtn") as Button; MyButton_Addbaodao.Margin = new Thickness(0); ReportButton_Addbaodao.Margin = new Thickness(0); MyButton_Addbaodao.IsEnabled = false;//默认将是否已报销的Button禁用 //luojie 20120808 if (!string.IsNullOrEmpty(bursementId) && bursementId != "空")//如果自动生成了报销 { MyButton_Addbaodao.Content = "未报销"; MyButton_Addbaodao.IsEnabled = true; if (trCheckS == "2") { MyButton_Addbaodao.Content = "已报销"; MyButton_Addbaodao.IsEnabled = false; } else if (trCheckS == "1") { MyButton_Addbaodao.Content = "报销中"; MyButton_Addbaodao.IsEnabled = true; } } else { if (AppCheckS == "2") { MyButton_Addbaodao.IsEnabled = true;//启用弹出Form的Button } MyButton_Addbaodao.Content = "未报销"; } //出差申请没有审核通过则报销按钮不可用 if (AppCheckS != "2") { MyButton_Addbaodao.Content = "未报销"; MyButton_Addbaodao.IsEnabled = false; } ////报告判断 //if (!string.IsNullOrEmpty(reportId) && reportId != "空")//如果自动生成了报告 //{ // ReportButton_Addbaodao.Content = "未报告"; // ReportButton_Addbaodao.IsEnabled = true; // if (reportCheckS == "2") // { // ReportButton_Addbaodao.Content = "已报告"; // ReportButton_Addbaodao.IsEnabled = false; // } //} //else //{ // if (AppCheckS == "2") // { // ReportButton_Addbaodao.IsEnabled = true;//启用弹出Form的Button // } // ReportButton_Addbaodao.Content = "未报告"; //} MyButton_Addbaodao.Tag = tmp; ReportButton_Addbaodao.Tag = tmp; }
void Travelmanagement_GetAccordingToBusinesstripIdCheckCompleted(object sender, GetAccordingToBusinesstripIdCheckCompletedEventArgs e) { try { if (e.Result != null) { TraveView = e.Result; //missionReportsID = TraveView.ReportId; travelReimbursementID = TraveView.TrId; traverlCheck = TraveView.TraveAppCheckState; //reportCheckState = TraveView.ReportCheckState; trCheckState = TraveView.TrCheckState; SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("打开出差form获取到的出差报销id:" + TraveView.TrId); } else { SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("GetAccordingToBusinesstripId返回结果为空"); } //判断出差报销是否存在 bool BoolReimID = !string.IsNullOrEmpty(travelReimbursementID) && travelReimbursementID != "空"; if (false == BoolReimID) traveformFather.Visibility = Visibility.Collapsed;//出差报销Tab if (traverlCheck != Convert.ToInt32(CheckStates.Approved).ToString()) { traveformFather.Visibility = Visibility.Collapsed;//出差报销Tab } else { if ((trCheckState == "0" || trCheckState == "1" || trCheckState == "3") && !isAlterTrave) { TabTravel.SelectedIndex = 2; if (actions != FormTypes.Browse && actions != FormTypes.Edit) { tbbTravelapplication.Visibility = Visibility.Collapsed;//隐藏出差申请Tab //TabReport.Visibility = Visibility.Collapsed;//隐藏出差报告Tab } } } if (actions == FormTypes.New)//新增 { //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈 TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.New, ""); //TravelapplicationForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; TravelapplicationForm.ParentEntityBrowser = this.ParentEntityBrowser; EntityBrowser TravelBrowser = new EntityBrowser(TravelapplicationForm); TravelBrowser.FormType = FormTypes.New; TravelBrowser.MinWidth = 980; TravelBrowser.MinHeight = 445; TravelapplicationGd.Children.Add(TravelBrowser); } else if (actions == FormTypes.Edit) { //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈 //TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.Edit, businesstrID); //2012-9-21 ljx TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.Edit, TraveView.Travelmanagement.BUSINESSTRIPID); //TravelapplicationForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; TravelapplicationForm.ParentEntityBrowser = this.ParentEntityBrowser; EntityBrowser TravelBrowser = new EntityBrowser(TravelapplicationForm); TravelBrowser.FormType = FormTypes.Edit; //TravelBrowser.MinWidth = 980; TravelBrowser.MinHeight = 445; TravelapplicationGd.Children.Add(TravelBrowser); if (BoolReimID && traverlCheck == Convert.ToInt32(CheckStates.Approved).ToString()) { //出差报销 TravelReimbursementControl TravelReimbursementForm = new TravelReimbursementControl(FrameworkUI.FormTypes.Edit, travelReimbursementID, businesstrID); //TravelReimbursementForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; TravelReimbursementForm.ParentEntityBrowser = this.ParentEntityBrowser; TravelReimbursementForm.OpenFrom = OpenFrom; EntityBrowser TravelReimbursementBrowser = new EntityBrowser(TravelReimbursementForm); TravelReimbursementBrowser.FormType = FormTypes.Edit; //Canvas can = new Canvas(); //TravelReimbursementBrowser.MinWidth = 980; TravelReimbursementBrowser.MinHeight = 445; TravelReimbursementGd.Children.Add(TravelReimbursementBrowser); } } else if (actions == FormTypes.Browse) { //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈 TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.Browse, businesstrID); //TravelapplicationForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelBrowser = new EntityBrowser(TravelapplicationForm); TravelBrowser.FormType = FormTypes.Browse; TravelBrowser.MinWidth = 728; TravelBrowser.MinHeight = 445; TravelapplicationGd.Children.Add(TravelBrowser); if (BoolReimID && traverlCheck == Convert.ToInt32(CheckStates.Approved).ToString()) { //出差报销 TravelReimbursementControl TravelReimbursementForm = new TravelReimbursementControl(FrameworkUI.FormTypes.Browse, travelReimbursementID, businesstrID); //TravelReimbursementForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelReimbursementBrowser = new EntityBrowser(TravelReimbursementForm); TravelReimbursementBrowser.FormType = FormTypes.Browse; //Canvas can = new Canvas(); TravelReimbursementBrowser.MinWidth = 728; TravelReimbursementBrowser.MinHeight = 445; TravelReimbursementGd.Children.Add(TravelReimbursementBrowser); } } else if (actions == FormTypes.Audit) { //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈 TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.Audit, businesstrID); //TravelapplicationForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelBrowser = new EntityBrowser(TravelapplicationForm); TravelBrowser.FormType = FormTypes.Audit; TravelBrowser.MinWidth = 728; TravelBrowser.MinHeight = 445; TravelapplicationGd.Children.Add(TravelBrowser); if (BoolReimID && traverlCheck == Convert.ToInt32(CheckStates.Approved).ToString()) { //出差报销 TravelReimbursementControl TravelReimbursementForm = new TravelReimbursementControl(FrameworkUI.FormTypes.Audit, travelReimbursementID, businesstrID); //TravelReimbursementForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelReimbursementBrowser = new EntityBrowser(TravelReimbursementForm); TravelReimbursementBrowser.FormType = FormTypes.Audit; //Canvas can = new Canvas(); TravelReimbursementBrowser.MinWidth = 728; TravelReimbursementBrowser.MinHeight = 445; TravelReimbursementGd.Children.Add(TravelReimbursementBrowser); } } else { //RefreshUI(RefreshedTypes.HideProgressBar);//停止进度圈 if (traverlCheck != "3"&& !isAlterTrave) { tbbTravelapplication.Visibility = Visibility.Collapsed;//出差申请Tab } else { //重新提交(或修改行程) TravelRequestForm TravelapplicationForm = new TravelRequestForm(FormTypes.Resubmit, businesstrID); //TravelapplicationForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelBrowser = new EntityBrowser(TravelapplicationForm); TravelBrowser.FormType = FormTypes.Resubmit; TravelBrowser.MinWidth = 980; TravelBrowser.MinHeight = 445; TravelapplicationGd.Children.Add(TravelBrowser); if (isAlterTrave) { //traveformFather.Visibility = Visibility.Collapsed; //TravelapplicationGd.Visibility = Visibility.Visible; //tbbTravelapplication.Visibility = Visibility.Visible; //TabTravel.SelectedIndex = 1; TravelapplicationForm.isAlterTrave = true; } } if (trCheckState != "3") { traveformFather.Visibility = Visibility.Collapsed;//出差报销Tab } else { if (BoolReimID && traverlCheck == Convert.ToInt32(CheckStates.Approved).ToString()) { //出差报销 TravelReimbursementControl TravelReimbursementForm = new TravelReimbursementControl(FrameworkUI.FormTypes.Resubmit, travelReimbursementID, businesstrID); //TravelReimbursementForm.OnUIRefreshed += TravelapplicationForm_OnUIRefreshed; EntityBrowser TravelReimbursementBrowser = new EntityBrowser(TravelReimbursementForm); TravelReimbursementBrowser.FormType = FormTypes.Resubmit; TravelReimbursementBrowser.MinWidth = 980; TravelReimbursementBrowser.MinHeight = 445; TravelReimbursementGd.Children.Add(TravelReimbursementBrowser); } } } } catch (Exception ex) { RefreshUI(RefreshedTypes.HideProgressBar); SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("打开出差form,获取出差异常:" + ex.ToString()); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "打开出差form,获取出差异常:" + ex.ToString(), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); } }