Ejemplo 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);
     }
 }
Ejemplo 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);
     }
 }