public LeftMenuViewModel() { if (!IsolatedStorageSettings.ApplicationSettings["currentCulture"].ToString().Equals("vi-VN")) this.isVN = false; TLMENUClient menuClient = new TLMENUClient(); menuClient.GetByTopTLMENUAsync("", "", " MENU_PARENT, MENU_ORDER "); menuClient.GetByTopTLMENUCompleted += new EventHandler<GetByTopTLMENUCompletedEventArgs>(getMenuCompleted); }
public LeftMenuViewModel() { if (!IsolatedStorageSettings.ApplicationSettings["currentCulture"].ToString().Equals("vi-VN")) { this.isVN = false; } TLMENUClient menuClient = new TLMENUClient(); menuClient.GetByTopTLMENUAsync("", "", " MENU_PARENT, MENU_ORDER "); menuClient.GetByTopTLMENUCompleted += new EventHandler <GetByTopTLMENUCompletedEventArgs>(getMenuCompleted); }
//reload data from database private void Reload() { try { this.menuClient = new TLMENUClient(); this.parentData = new ObservableCollection <TL_MENU>(); //this.menuClient.GetByTopTLMENUAsync("200", "", ""); this.currencyData = new ObservableCollection <TL_MENU>(); //this.menuParent = new TL_MENU() { MENU_ID = -1, MENU_NAME = CommonResource.lblAll }; this.menuClient.GetParentTLMENUAsync(); this.menuClient.GetParentTLMENUCompleted += (s, e) => { this.parentData = new ObservableCollection <TL_MENU>(); this.parentData.Add(new TL_MENU() { MENU_PARENT = "", MENU_NAME = " " + CommonResource.lblAll }); this.parentData.Add(new TL_MENU() { MENU_PARENT = " ", MENU_NAME = "---NULL---" }); if (e.Result != null && e.Result.Count > 0) { foreach (var item in e.Result) { this.parentData.Add(new TL_MENU() { MENU_PARENT = item.MENU_ID.ToString(), MENU_NAME = item.MENU_NAME }); } } this.OnPropertyChanged("ParentData"); }; this.menuClient.GetByTopTLMENUCompleted += new EventHandler <GetByTopTLMENUCompletedEventArgs>(searchCompleted); this.menuClient.DeleteTLMENUCompleted += new EventHandler <DeleteTLMENUCompletedEventArgs>(deleteCurrencyCompleted); } catch (Exception) { this.messagePop.SetSingleError(CommonResource.errorCannotConnectServer); } }
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 Load() { try { this.menuClient = new TLMENUClient(); this.menuClient.GetParentTLMENUAsync(); this.menuClient.GetParentTLMENUCompleted += (s, e) => { this.parentData = new ObservableCollection <TL_MENU>(); this.parentData.Add(new TL_MENU() { MENU_PARENT = "", MENU_NAME = "---NULL---" }); if (e.Result != null && e.Result.Count > 0) { foreach (var item in e.Result) { this.parentData.Add(new TL_MENU() { MENU_PARENT = item.MENU_ID.ToString(), MENU_NAME = item.MENU_NAME }); } } this.OnPropertyChanged("ParentData"); }; this.menuClient.InsertTLMENUCompleted += new EventHandler <InsertTLMENUCompletedEventArgs>(insertCurrencyCompleted); this.menuClient.UpdateTLMENUCompleted += new EventHandler <UpdateTLMENUCompletedEventArgs>(updateCurrencyCompleted); //this.menuClient.ApproveCMAGENTCompleted += new EventHandler<ApproveCMAGENTCompletedEventArgs>(approveComplete); } catch (Exception) { this.messagePop.SetSingleError(CommonResource.errorCannotConnectServer); } }
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 Load() { try { this.menuClient = new TLMENUClient(); this.menuClient.GetParentTLMENUAsync(); this.menuClient.GetParentTLMENUCompleted += (s, e) => { this.parentData = new ObservableCollection<TL_MENU>(); this.parentData.Add(new TL_MENU() { MENU_PARENT = "", MENU_NAME = "---NULL---" }); if (e.Result != null && e.Result.Count > 0) { foreach (var item in e.Result) this.parentData.Add(new TL_MENU() { MENU_PARENT = item.MENU_ID.ToString(), MENU_NAME = item.MENU_NAME }); } this.OnPropertyChanged("ParentData"); }; this.menuClient.InsertTLMENUCompleted += new EventHandler<InsertTLMENUCompletedEventArgs>(insertCurrencyCompleted); this.menuClient.UpdateTLMENUCompleted += new EventHandler<UpdateTLMENUCompletedEventArgs>(updateCurrencyCompleted); //this.menuClient.ApproveCMAGENTCompleted += new EventHandler<ApproveCMAGENTCompletedEventArgs>(approveComplete); } catch (Exception) { this.messagePop.SetSingleError(CommonResource.errorCannotConnectServer); } }
//reload data from database private void Reload() { try { this.menuClient = new TLMENUClient(); this.parentData = new ObservableCollection<TL_MENU>(); //this.menuClient.GetByTopTLMENUAsync("200", "", ""); this.currencyData = new ObservableCollection<TL_MENU>(); //this.menuParent = new TL_MENU() { MENU_ID = -1, MENU_NAME = CommonResource.lblAll }; this.menuClient.GetParentTLMENUAsync(); this.menuClient.GetParentTLMENUCompleted += (s, e) => { this.parentData = new ObservableCollection<TL_MENU>(); this.parentData.Add(new TL_MENU() { MENU_PARENT = "", MENU_NAME = " " + CommonResource.lblAll }); this.parentData.Add(new TL_MENU() { MENU_PARENT = " ", MENU_NAME = "---NULL---" }); if (e.Result != null && e.Result.Count > 0) { foreach (var item in e.Result) this.parentData.Add(new TL_MENU() { MENU_PARENT = item.MENU_ID.ToString(), MENU_NAME = item.MENU_NAME }); } this.OnPropertyChanged("ParentData"); }; this.menuClient.GetByTopTLMENUCompleted += new EventHandler<GetByTopTLMENUCompletedEventArgs>(searchCompleted); this.menuClient.DeleteTLMENUCompleted += new EventHandler<DeleteTLMENUCompletedEventArgs>(deleteCurrencyCompleted); } catch (Exception) { this.messagePop.SetSingleError(CommonResource.errorCannotConnectServer); } }