Esempio n. 1
0
 public IDomainObject VratiObjekat(SqlDataReader reader)
 {
     try
     {
         Kompanija company = new Kompanija();
         while (reader.Read())
         {
             company.Id             = (long)reader[0];
             company.NazivKompanije = reader[1].ToString();
             break;
         }
         return(company);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Esempio n. 2
0
 public List <IDomainObject> VratiListu(SqlDataReader reader)
 {
     try
     {
         List <IDomainObject> companies = new List <IDomainObject>();
         while (reader.Read())
         {
             Kompanija company = new Kompanija
             {
                 Id             = (long)reader[0],
                 NazivKompanije = reader[1].ToString()
             };
             companies.Add(company);
         }
         return(companies);
     }
     catch (Exception)
     {
         return(null);
     }
 }