Exemplo n.º 1
0
        /// <summary>
        /// Load screen favorite by given user.
        /// </summary>
        /// <param name="username"></param>
        /// <returns>list of screen code.</returns>
        public List <string> LoadScreenFavorite(string username)
        {
            List <string> screens = new List <string>();
            IMenuDAO      daoMenu = DAOFactory.CreateMenuDAO(CommonLib.Common.CurrentDatabase);
            DataTable     dt      = daoMenu.GetScreenFavorite(username);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                screens.Add(dt.Rows[i][0].ToString());
            }
            return(screens);
        }
Exemplo n.º 2
0
        public List <MenuSub> LoadMenus(NZString userCD)
        {
            IMenuDAO dao = DAOFactory.CreateMenuDAO(CommonLib.Common.CurrentDatabase);

            List <MenuSub> menuSubList = dao.GetAllMenuSubFromUser(userCD, CommonLib.Common.SystemLanguage);

            for (int i = 0; i < menuSubList.Count; i++)
            {
                MenuSub menuSub = menuSubList[i];

                List <MenuSubItemDTO> menuSubItemList = dao.GetAllMenuSubItem(menuSub.MENU_SUB_CD.StrongValue, userCD.StrongValue);
                menuSub.MenuSubItemList = menuSubItemList;
            }


            return(menuSubList);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Remove screen favorite
        /// </summary>
        /// <param name="username"></param>
        /// <param name="screenCD"></param>
        public void RemoveScreenFavorite(string username, string screenCD)
        {
            IMenuDAO daoMenu = DAOFactory.CreateMenuDAO(CommonLib.Common.CurrentDatabase);

            daoMenu.DeleteFavorite(username, screenCD);
        }
Exemplo n.º 4
0
 public MenuServiceImpl(IMenuDAO menuDAO) => _menuDAO = menuDAO;