コード例 #1
0
        public static CustomList <UnitSetup> GetAllUnitSetup()
        {
            ConnectionManager      conManager          = new ConnectionManager(ConnectionName.HR);
            CustomList <UnitSetup> UnitSetupCollection = new CustomList <UnitSetup>();
            IDataReader            reader = null;
            const String           sql    = "select *from UnitSetup";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    UnitSetup newUnitSetup = new UnitSetup();
                    newUnitSetup.SetData(reader);
                    UnitSetupCollection.Add(newUnitSetup);
                }
                UnitSetupCollection.InsertSpName = "spInsertUnitSetup";
                UnitSetupCollection.UpdateSpName = "spUpdateUnitSetup";
                UnitSetupCollection.DeleteSpName = "spDeleteUnitSetup";
                return(UnitSetupCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
コード例 #2
0
ファイル: UnitSetup.cs プロジェクト: samnuriu13/APIXERP
 public static CustomList<UnitSetup> GetAllUnitSetup()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<UnitSetup> UnitSetupCollection = new CustomList<UnitSetup>();
     IDataReader reader = null;
     const String sql = "select *from UnitSetup";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             UnitSetup newUnitSetup = new UnitSetup();
             newUnitSetup.SetData(reader);
             UnitSetupCollection.Add(newUnitSetup);
         }
         UnitSetupCollection.InsertSpName = "spInsertUnitSetup";
         UnitSetupCollection.UpdateSpName = "spUpdateUnitSetup";
         UnitSetupCollection.DeleteSpName = "spDeleteUnitSetup";
         return UnitSetupCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }