Esempio n. 1
0
 private void _client_TL_MENU_LstCompleted(object sender, TL_MENU_LstCompletedEventArgs e)
  {
      try
      {
          DataItemParent.Clear();
          foreach (var item in e.Result)
              if (item.menuParentID == 0)
                  DataItemParent.Add(new MENU_PARENT_EX() { ItemContent = item });
          DataItemParent.Add(new MENU_PARENT_EX() { ItemContent = new TL_MENU_LstResult() { menuID = 0, menuName = CommonResource.None, menuNameEL = CommonResource.None } });
          OnPropertyChanged("CurrentItem");
      }
      catch { MessagePop.SetError(CommonResource.ServerConnectError); }
  }
Esempio n. 2
0
        private void _clientMenu_TL_MENU_LstCompleted(object sender, TL_MENU_LstCompletedEventArgs e)
        {
            if (e.Result != null && e.Result.Count > 0)
            {
                var MenuRootTEMP = new List<MenuItemData>();
                CurrentSystemInfo.AvailableLinks = new Dictionary<int, string>();

                foreach (var item in e.Result)
                {
                    if (CurrentSystemInfo.Roles.ContainsKey(item.menuID.ToString()))
                    {
                        if (item.menuParentID == 0)
                        {
                            var menuItem = new MenuItemData();
                            menuItem.MenuID = item.menuID;
                            menuItem.MenuName = _isVN ? item.menuName : item.menuNameEL;
                            menuItem.MenuLink = item.menuLink;
                            menuItem.Childs = new List<MenuItemData>();

                            MenuRootTEMP.Add(menuItem);
                        }
                        else
                        {
                            var menuItem = new MenuItemData();
                            menuItem.MenuID = item.menuID;
                            menuItem.MenuName = _isVN ? item.menuName : item.menuNameEL;
                            menuItem.MenuLink = item.menuLink;

                            MenuRootTEMP.Where(p => p.MenuID == item.menuParentID).FirstOrDefault().Childs.Add(menuItem);
                        }
                        // Save all menu name for navigation page tool
                        CurrentSystemInfo.AvailableLinks.Add(item.menuID, _isVN ? item.menuName : item.menuNameEL);
                    }
                }
                MenuRoot = MenuRootTEMP;
                OnPropertyChanged("MenuRoot");
            }
        }
Esempio n. 3
0
 private void _client_TL_MENU_LstCompleted(object sender, TL_MENU_LstCompletedEventArgs e)
 {
     try
     {
         DataItemParent.Clear();
         foreach (var item in e.Result)
             if (item.menuParentID == 0)
                 DataItemParent.Add(new MENU_PARENT_EX() { ItemContent = item });
     }
     catch (Exception ex) { MessagePop.SetError(ex.Message); }
 }
      private  void _clientMenu_TL_MENU_LstCompleted(object sender, TL_MENU_LstCompletedEventArgs e)
        {
            try
            {
                if (e.Result.Count > 0)
                {
                    foreach (var item in e.Result)
                    {
                        var treeItem = new TreeItem()
                        {
                            MenuID = item.menuID,
                            MenuName = App.AppSettings["currentCulture"].ToString().Equals("vi-VN") ? item.menuName : item.menuNameEL,
                            MenuLink = item.menuLink,
                            IsApprove = false,
                            IsDelete = false,
                            IsEdit = false,
                            IsInsert = false,
                            IsSearch = false,
                            IsUpdate = false,
                            IsView = false,
                        };
                        treeItem.Clicked += (s, ex) =>
                        {
                            var value = s as TreeItem;
                            value.IsSelected = true;
                            CurrentSelectedItem = value;
                        };
                        if (item.menuParentID.Value == 0)

                            DataItem.Add(treeItem);
                        else
                            DataItem.Where(p => p.MenuID == item.menuParentID).FirstOrDefault().Childs.Add(treeItem);
                        _client.TL_SYS_ROLE_DETAIL_LstOnRoleIDAsync(CurrentItem.roleID);
                    }
                }
            }
            catch (Exception ex) { MessagePop.SetError(ex.Message); }
        }