Пример #1
0
        public static CustomList <Acc_VoucherType> GetAllAcc_VoucherTypeForPurchase()
        {
            ConnectionManager            conManager = new ConnectionManager(ConnectionName.HR);
            CustomList <Acc_VoucherType> Acc_VoucherTypeCollection = new CustomList <Acc_VoucherType>();
            IDataReader  reader = null;
            const String sql    = "select VoucherTypeKey,VoucherTypeCode from Acc_VoucherType Where VoucherTypeKey in(1,3)";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    Acc_VoucherType newAcc_VoucherType = new Acc_VoucherType();
                    newAcc_VoucherType.SetDataVoucherType(reader);
                    Acc_VoucherTypeCollection.Add(newAcc_VoucherType);
                }
                return(Acc_VoucherTypeCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
Пример #2
0
 public static CustomList<Acc_VoucherType> GetAllAcc_VoucherType()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<Acc_VoucherType> Acc_VoucherTypeCollection = new CustomList<Acc_VoucherType>();
     IDataReader reader = null;
     const String sql = "select VoucherTypeKey,VoucherTypeCode from Acc_VoucherType";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             Acc_VoucherType newAcc_VoucherType = new Acc_VoucherType();
             newAcc_VoucherType.SetDataVoucherType(reader);
             Acc_VoucherTypeCollection.Add(newAcc_VoucherType);
         }
         return Acc_VoucherTypeCollection;
     }
     catch(Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }