コード例 #1
0
        public static CustomList <ItemStructure> GetAllItemStructure(Int32 itemGroupID)
        {
            ConnectionManager          conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <ItemStructure> ItemStructureCollection = new CustomList <ItemStructure>();
            IDataReader reader = null;
            String      sql    = "select *from ItemStructure Where GroupItemID=" + itemGroupID;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    ItemStructure newItemStructure = new ItemStructure();
                    newItemStructure.SetData(reader);
                    ItemStructureCollection.Add(newItemStructure);
                }
                return(ItemStructureCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
コード例 #2
0
ファイル: ItemStructure.cs プロジェクト: samnuriu13/APIXERP
 public static CustomList<ItemStructure> GetAllItemStructure(Int32 itemGroupID)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<ItemStructure> ItemStructureCollection = new CustomList<ItemStructure>();
     IDataReader reader = null;
     String sql = "select *from ItemStructure Where GroupItemID=" + itemGroupID;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             ItemStructure newItemStructure = new ItemStructure();
             newItemStructure.SetData(reader);
             ItemStructureCollection.Add(newItemStructure);
         }
         return ItemStructureCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }