示例#1
0
        private static void AddBlankRecord(CustomList <CompanyEntity> companyEntityCollection)
        {
            CompanyEntity newCompanyEntityCollection = new CompanyEntity();

            newCompanyEntityCollection._CompanyID = String.Empty;
            companyEntityCollection.Add(newCompanyEntityCollection);
        }
示例#2
0
        public static CustomList <CompanyEntity> GetAllCompanyEntityWithBlankRecode()
        {
            ConnectionManager          conManager = new ConnectionManager(ConnectionName.SysMan);
            CustomList <CompanyEntity> companyEntityCollection = new CustomList <CompanyEntity>();
            IDataReader  reader = null;
            const String sql    = "Select * From Company_Entity";

            AddBlankRecord(companyEntityCollection);
            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    CompanyEntity newCompanyEntity = new CompanyEntity();
                    newCompanyEntity.SetData(reader);
                    companyEntityCollection.Add(newCompanyEntity);
                }
                reader.Close();
                return(companyEntityCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
示例#3
0
 private static void AddBlankRecord(CustomList<CompanyEntity> companyEntityCollection)
 {
     CompanyEntity newCompanyEntityCollection = new CompanyEntity();
     newCompanyEntityCollection._CompanyID = String.Empty;
     companyEntityCollection.Add(newCompanyEntityCollection);
 }
示例#4
0
 public static CustomList<CompanyEntity> GetAllCompanyEntityWithBlankRecode()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<CompanyEntity> companyEntityCollection = new CustomList<CompanyEntity>();
     IDataReader reader = null;
     const String sql = "Select * From Company_Entity";
     AddBlankRecord(companyEntityCollection);
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             CompanyEntity newCompanyEntity = new CompanyEntity();
             newCompanyEntity.SetData(reader);
             companyEntityCollection.Add(newCompanyEntity);
         }
         reader.Close();
         return companyEntityCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }