/// <summary> /// 注册事件c /// </summary> private void RegisterEvents() { PARENT.Children.Add(loadbar); DateTime dtNow = DateTime.Now; int iMaxDay = DateTime.DaysInMonth(dtNow.Year, dtNow.Month); if (string.IsNullOrWhiteSpace(dpClockInRdStartDate.Text)) { dpClockInRdStartDate.Text = dtNow.ToString("yyyy-M") + "-1"; } if (string.IsNullOrWhiteSpace(dpClockInRdEndDate.Text)) { dpClockInRdEndDate.Text = dtNow.ToString("yyyy-M") + "-" + iMaxDay.ToString(); } //toolbar1.btnImport.Visibility = Visibility.Visible; toolbar1.btnOutExcel.Visibility = Visibility.Visible; toolbar1.btnOutExcel.Click += new RoutedEventHandler(btnOutExcel_Click); toolbar1.btnRefresh.Click += new RoutedEventHandler(btnRefresh_Click); toolbar1.btnImport.Click += new RoutedEventHandler(btnImport_Click); treeOrganization.SelectedClick += new EventHandler(treeOrganization_SelectedClick); clientAtt.GetClockInRdListByMultSearchCompleted += new EventHandler <GetClockInRdListByMultSearchCompletedEventArgs>(clientAtt_GetClockInRdListByMultSearchCompleted); clientAtt.OutClockInRdListByMultSearchCompleted += new EventHandler <OutClockInRdListByMultSearchCompletedEventArgs>(clientAtt_OutClockInRdListByMultSearchCompleted); PermClient.GetCustomerPermissionByUserIDAndEntityCodeCompleted += new EventHandler <GetCustomerPermissionByUserIDAndEntityCodeCompletedEventArgs>(PermClient_GetCustomerPermissionByUserIDAndEntityCodeCompleted); if (customerPermission == null) { PermClient.GetCustomerPermissionByUserIDAndEntityCodeAsync(Common.CurrentLoginUserInfo.SysUserID, "T_HR_EMPLOYEECLOCKINRECORD"); } }
/// <summary> /// 专用与待办里打开的情况 /// </summary> /// <param name="sendDocId"></param> public AddDistrbuteForm(string sendDocId,bool isExistDel) { InitializeComponent(); DocDistrbuteClient.GetBumfDocInfoCompleted += (o,e) => { if(e.Result!=null) { V_BumfCompanySendDoc bumfDoc=e.Result; InitialForm(bumfDoc); string LoginUserID = Common.CurrentLoginUserInfo.EmployeeID; if (bumfDoc.senddoc.ISDISTRIBUTE == "0" && isExistDel && (bumfDoc.senddoc.OWNERID == LoginUserID || bumfDoc.senddoc.CREATEUSERID==LoginUserID)) { PermissionServiceClient PermClient = new PermissionServiceClient(); PermClient.GetCustomerPermissionByUserIDAndEntityCodeCompleted += (to, te) => { if (te.Result != null) { CloseTask.Visibility = Visibility.Visible; } }; PermClient.GetCustomerPermissionByUserIDAndEntityCodeAsync(Common.CurrentLoginUserInfo.SysUserID, "T_OA_SENDDOC"); } GetCompanDocInfo(bumfDoc); } }; DocDistrbuteClient.GetBumfDocInfoAsync(sendDocId); }
//private void HideDistributeButton() //{ // if (tmpSendDocT.CHECKSTATE != "2" || tmpSendDocT.ISDISTRIBUTE != "0") // { // var toolbar = GetToolBarItems(); // int count = 0; // foreach (var t in toolbar) // { // if (t.Key == "3") toolbar.RemoveAt(count); // count++; // } // } // else // { // EntityBrowser entBrowser = this.FindParentByType<EntityBrowser>(); // } //} private void ShowDistributButton() { if (tmpSendDocT != null && tmpSendDocT.CHECKSTATE == "2" && tmpSendDocT.ISDISTRIBUTE == "0") { PermissionServiceClient PermClient = new PermissionServiceClient(); PermClient.GetCustomerPermissionByUserIDAndEntityCodeCompleted += (to, te) => { if (te.Result != null) { canShowDistButton = true; EntityBrowser entBrowser = this.FindParentByType<EntityBrowser>(); ToolBar bar = SMT.SaaS.FrameworkUI.Common.Utility.FindChildControl<ToolBar>(entBrowser, "toolBar1"); //bar.ButtonContainer.Children.Clear(); if (IsAudit && canShowDistButton) { if (tmpSendDocT != null && tmpSendDocT.CHECKSTATE == "2" && tmpSendDocT.ISDISTRIBUTE == "0") { ImageButton btn; string img; btn = new ImageButton(); btn.TextBlock.Text = "发布"; img = "/SMT.SaaS.FrameworkUI;Component/Images/ToolBar/mnu_actions.png"; btn.Image.Source = new BitmapImage(new Uri(img, UriKind.Relative)); btn.Style = (Style)Application.Current.Resources["ButtonToolBarStyle"]; btn.Click += new RoutedEventHandler(DistributeCompanyDoc); bar.ButtonContainer.Children.Add(btn); } } //GetToolBarItems(); } }; PermClient.GetCustomerPermissionByUserIDAndEntityCodeAsync(Common.CurrentLoginUserInfo.SysUserID, "T_OA_SENDDOC"); } }