Exemplo n.º 1
0
 public StatusCollection GetStatus()
 {
     StatusCollection status = new StatusCollection();
     using (StatusDataAdapter adapter = new StatusDataAdapter())
     {
         IDataReader dr = adapter.GetStatus();
         while (dr.Read())
         {
             status.Add(PopulateReader(dr));
         }
         dr.Dispose();
         adapter.Dispose();
         return status;
     }
 }
Exemplo n.º 2
0
        public Status GetStatusById(int id)
        {
            Status status = new Status();
            using (StatusDataAdapter adapter = new StatusDataAdapter())
            {
                IDataReader dr = adapter.GetStatusById(id);
                if (dr.Read())
                {
                    status = PopulateReader(dr);
                    dr.Dispose();
                }

                adapter.Dispose();
                return status;
            }
        }