Exemplo n.º 1
0
        public static CustomList <MenuSetup> GetMenuType()
        {
            ConnectionManager      conManager     = new ConnectionManager(ConnectionName.SysMan);
            CustomList <MenuSetup> MenuCollection = new CustomList <MenuSetup>();
            IDataReader            reader         = null;
            String sql = String.Format("Select distinct MenuType from Menu");

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    MenuSetup newMenu = new MenuSetup();
                    newMenu.SetDataForMenuType(reader);
                    MenuCollection.Add(newMenu);
                }
                return(MenuCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 2
0
        public static CustomList <MenuSetup> GetAllMenu()
        {
            ConnectionManager      conManager     = new ConnectionManager(ConnectionName.SysMan);
            CustomList <MenuSetup> MenuCollection = new CustomList <MenuSetup>();
            IDataReader            reader         = null;
            String sql = String.Format("Select * from Menu");

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    MenuSetup newMenu = new MenuSetup();
                    newMenu.SetData(reader);
                    MenuCollection.Add(newMenu);
                }
                MenuCollection.InsertSpName = "spInsertMenu";
                MenuCollection.UpdateSpName = "spUpdateMenu";
                MenuCollection.DeleteSpName = "spDeleteMenu";
                return(MenuCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 3
0
 public static CustomList<MenuSetup> GetMenuType()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<MenuSetup> MenuCollection = new CustomList<MenuSetup>();
     IDataReader reader = null;
     String sql = String.Format("Select distinct MenuType from Menu");
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             MenuSetup newMenu = new MenuSetup();
             newMenu.SetDataForMenuType(reader);
             MenuCollection.Add(newMenu);
         }
         return MenuCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 4
0
 public static CustomList<MenuSetup> GetAllMenu()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<MenuSetup> MenuCollection = new CustomList<MenuSetup>();
     IDataReader reader = null;
     String sql = String.Format("Select * from Menu");
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             MenuSetup newMenu = new MenuSetup();
             newMenu.SetData(reader);
             MenuCollection.Add(newMenu);
         }
         MenuCollection.InsertSpName = "spInsertMenu";
         MenuCollection.UpdateSpName = "spUpdateMenu";
         MenuCollection.DeleteSpName = "spDeleteMenu";
         return MenuCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }