private void ReLoad() { try { this.tlUserClient = new TLUSERClient(); this.branchClient = new BranchClient(); TLSYSROLEClient roleClient = new TLSYSROLEClient(); LoadBranch(); this.IsSingleData = true; roleClient.GetByTopTLSYSROLEAsync("", "", ""); roleClient.GetByTopTLSYSROLECompleted += (s, e) => { ObservableCollection <TL_SYSROLE> tempRole; if (e.Result != null && e.Result.Count > 0) { tempRole = e.Result; } else { tempRole = new ObservableCollection <TL_SYSROLE>(); } tempRole.Add(new TL_SYSROLE() { ROLE_ID = CommonResource.lblAll }); this.RoleData = tempRole; this.OnPropertyChanged("RoleData"); }; this.AuthData = new List <ItemYesNo>() { new ItemYesNo() { Id = "A", Name = CommonResource.lblApproved }, new ItemYesNo() { Id = "U", Name = CommonResource.lblDisApprove }, new ItemYesNo() { Id = "", Name = CommonResource.lblAll } }; this.tlUserClient.SearchTLUSERCompleted += new EventHandler <SearchTLUSERCompletedEventArgs>(searchTLUserCompleted); this.tlUserClient.DeleteTLUSERCompleted += new EventHandler <DeleteTLUSERCompletedEventArgs>(deletedCompleted); } catch (Exception ex) { this.messagePop.SetSingleError(ex.Message); } }
//reload data from database private void Reload() { try { this.roleClient = new TLSYSROLEClient(); this.currencyData = new ObservableCollection <TL_SYSROLE>(); //this.roleClient.GetByTopTLSYSROLEAsync("200", "", ""); this.currencyData = new ObservableCollection <TL_SYSROLE>(); this.roleClient.GetByTopTLSYSROLECompleted += new EventHandler <GetByTopTLSYSROLECompletedEventArgs>(searchCompleted); this.roleClient.DeleteTLSYSROLECompleted += new EventHandler <DeleteTLSYSROLECompletedEventArgs>(deleteCurrencyCompleted); } catch (Exception) { this.messagePop.SetSingleError(CommonResource.errorCannotConnectServer); } }
private void Reload() { try { this.tluserClient = new TLUSERClient(); this.branchClient = new BranchClient(); //CMBRANCHClient branchClient = new CMBRANCHClient(); TLSYSROLEClient roleClient = new TLSYSROLEClient(); this.IsAuto = Visibility.Collapsed.ToString(); this.IsCustomer = Visibility.Visible.ToString(); //LoadBranch(); this.branchClient.GetByParentBranchIDAsync(CurrentSystemLogin.CurrentUser.TLSUBBRID); roleClient.GetByTopTLSYSROLEAsync("", "", ""); roleClient.GetByTopTLSYSROLECompleted += (s, e) => { if (e.Result != null && e.Result.Count > 0) { this.RoleData = e.Result; } else { this.RoleData = new ObservableCollection <TL_SYSROLE>(); } }; this.tluserClient.InsertTLUSERCompleted += new EventHandler <InsertTLUSERCompletedEventArgs>(insertCompleted); this.tluserClient.UpdateTLUSERCompleted += new EventHandler <UpdateTLUSERCompletedEventArgs>(updateCompleted); this.tluserClient.InsertAllTLUSERCompleted += new EventHandler <InsertAllTLUSERCompletedEventArgs>(insertAllCompleted); this.branchClient.CM_BRANCH_LevelCompleted += new EventHandler <CM_BRANCH_LevelCompletedEventArgs>(getBranchCompleted); this.tluserClient.ApproveTLUSERCompleted += new EventHandler <ApproveTLUSERCompletedEventArgs>(approveComplete); this.branchClient.GetByParentBranchIDCompleted += new EventHandler <GetByParentBranchIDCompletedEventArgs>(getAllBranch); this.tluserClient.GetUserInfomationCompleted += new EventHandler <GetUserInfomationCompletedEventArgs>(getUserInfoComplete); this.IsError = Visibility.Collapsed.ToString(); this.IsOk = Visibility.Collapsed.ToString(); } catch (Exception ex) { this.messagePop.SetSingleError(ex.Message); } }
private void Load() { try { this.roleClient = new TLSYSROLEClient(); TLMENUClient menuClient = new TLMENUClient(); menuClient.GetByTopTLMENUAsync("", "", " MENU_PARENT, MENU_ORDER "); menuClient.GetByTopTLMENUCompleted += new EventHandler <GetByTopTLMENUCompletedEventArgs>(getMenuCompleted); this.roleClient.InsertTLSYSROLECompleted += new EventHandler <InsertTLSYSROLECompletedEventArgs>(insertCurrencyCompleted); this.roleClient.UpdateTLSYSROLECompleted += new EventHandler <UpdateTLSYSROLECompletedEventArgs>(updateCurrencyCompleted); //this.menuClient.ApproveCMAGENTCompleted += new EventHandler<ApproveCMAGENTCompletedEventArgs>(approveComplete); this.roleClient.GetByTopTLROLEDETAILCompleted += new EventHandler <GetByTopTLROLEDETAILCompletedEventArgs>(getRoleDetailCompleted); } catch (Exception) { this.messagePop.SetSingleError(CommonResource.errorCannotConnectServer); } }
private void ReLoad() { try { this.tlUserClient = new TLUSERClient(); this.branchClient = new BranchClient(); TLSYSROLEClient roleClient = new TLSYSROLEClient(); LoadBranch(); this.IsSingleData = true; roleClient.GetByTopTLSYSROLEAsync("", "", ""); roleClient.GetByTopTLSYSROLECompleted += (s, e) => { ObservableCollection<TL_SYSROLE> tempRole; if (e.Result != null && e.Result.Count > 0) tempRole = e.Result; else tempRole = new ObservableCollection<TL_SYSROLE>(); tempRole.Add(new TL_SYSROLE() { ROLE_ID = CommonResource.lblAll }); this.RoleData = tempRole; this.OnPropertyChanged("RoleData"); }; this.AuthData = new List<ItemYesNo>() { new ItemYesNo(){Id="A", Name=CommonResource.lblApproved}, new ItemYesNo(){Id="U", Name=CommonResource.lblDisApprove}, new ItemYesNo(){Id="", Name=CommonResource.lblAll} }; this.tlUserClient.SearchTLUSERCompleted += new EventHandler<SearchTLUSERCompletedEventArgs>(searchTLUserCompleted); this.tlUserClient.DeleteTLUSERCompleted += new EventHandler<DeleteTLUSERCompletedEventArgs>(deletedCompleted); } catch (Exception ex) { this.messagePop.SetSingleError(ex.Message); } }
private void Load() { try { this.roleClient = new TLSYSROLEClient(); TLMENUClient menuClient = new TLMENUClient(); menuClient.GetByTopTLMENUAsync("", "", " MENU_PARENT, MENU_ORDER "); menuClient.GetByTopTLMENUCompleted += new EventHandler<GetByTopTLMENUCompletedEventArgs>(getMenuCompleted); this.roleClient.InsertTLSYSROLECompleted += new EventHandler<InsertTLSYSROLECompletedEventArgs>(insertCurrencyCompleted); this.roleClient.UpdateTLSYSROLECompleted += new EventHandler<UpdateTLSYSROLECompletedEventArgs>(updateCurrencyCompleted); //this.menuClient.ApproveCMAGENTCompleted += new EventHandler<ApproveCMAGENTCompletedEventArgs>(approveComplete); this.roleClient.GetByTopTLROLEDETAILCompleted += new EventHandler<GetByTopTLROLEDETAILCompletedEventArgs>(getRoleDetailCompleted); } catch (Exception) { this.messagePop.SetSingleError(CommonResource.errorCannotConnectServer); } }