コード例 #1
0
        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("对不起,您没有修改该用户报销的权限"));
            }
        }