Exemplo n.º 1
0
        public static CustomList <ItemSubGroup> GetAllItemSubGroup(String itemGroupID)
        {
            ConnectionManager         conManager             = new ConnectionManager(ConnectionName.HR);
            CustomList <ItemSubGroup> ItemSubGroupCollection = new CustomList <ItemSubGroup>();
            IDataReader reader = null;
            String      sql    = "select *from ItemSubGroup Where ItemGroupID=" + itemGroupID;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    ItemSubGroup newItemSubGroup = new ItemSubGroup();
                    newItemSubGroup.SetData(reader);
                    ItemSubGroupCollection.Add(newItemSubGroup);
                }
                return(ItemSubGroupCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 2
0
        public static CustomList <ItemSubGroup> GetAllItemSubGroup()
        {
            ConnectionManager         conManager             = new ConnectionManager(ConnectionName.HR);
            CustomList <ItemSubGroup> ItemSubGroupCollection = new CustomList <ItemSubGroup>();
            IDataReader  reader = null;
            const String sql    = "select S.ItemGroupID, S.ItemSubGroupID, S.SubGroupName from ItemGroup I inner join ItemSubGroup S on S.ItemGroupID=I.ItemGroupID order by I.GroupName desc";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    ItemSubGroup newItemSubGroup = new ItemSubGroup();
                    newItemSubGroup.SetData(reader);
                    ItemSubGroupCollection.Add(newItemSubGroup);
                }
                ItemSubGroupCollection.InsertSpName = "spInsertItemSubGroup";
                ItemSubGroupCollection.UpdateSpName = "spUpdateItemSubGroup";
                ItemSubGroupCollection.DeleteSpName = "spDeleteItemSubGroup";
                return(ItemSubGroupCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Exemplo n.º 3
0
 public static CustomList<ItemSubGroup> GetAllItemSubGroup()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<ItemSubGroup> ItemSubGroupCollection = new CustomList<ItemSubGroup>();
     IDataReader reader = null;
     const String sql = "select S.ItemGroupID, S.ItemSubGroupID, S.SubGroupName from ItemGroup I inner join ItemSubGroup S on S.ItemGroupID=I.ItemGroupID order by I.GroupName desc";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             ItemSubGroup newItemSubGroup = new ItemSubGroup();
             newItemSubGroup.SetData(reader);
             ItemSubGroupCollection.Add(newItemSubGroup);
         }
         ItemSubGroupCollection.InsertSpName = "spInsertItemSubGroup";
         ItemSubGroupCollection.UpdateSpName = "spUpdateItemSubGroup";
         ItemSubGroupCollection.DeleteSpName = "spDeleteItemSubGroup";
         return ItemSubGroupCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 4
0
 public static CustomList<ItemSubGroup> GetAllItemSubGroup(String itemGroupID)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<ItemSubGroup> ItemSubGroupCollection = new CustomList<ItemSubGroup>();
     IDataReader reader = null;
     String sql = "select *from ItemSubGroup Where ItemGroupID=" + itemGroupID;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             ItemSubGroup newItemSubGroup = new ItemSubGroup();
             newItemSubGroup.SetData(reader);
             ItemSubGroupCollection.Add(newItemSubGroup);
         }
         return ItemSubGroupCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }