Example #1
0
        public static BAdrese getAdresa(int pIdAdresa, IDbTransaction pTranzactie)
        {
            BAdrese adresa = null;

            using (DataSet ds = DAdrese.GetById(pIdAdresa, pTranzactie))
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    adresa = new BAdrese(dr);
                }
            }

            return(adresa);
        }
Example #2
0
 /// <summary>
 /// Metoda de clasa pentru obtinerea DataRow-ului corespunzator obiectului in baza de date
 /// </summary>
 /// <param name="pId"></param>
 /// <returns>Un DataRow ce contine informatiile corespunzatoare obiectului</returns>
 /// <remarks></remarks>
 private static DataRow GetDataRowForObjet(int pId, IDbTransaction pTranzactie)
 {
     if (pId <= 0)
     {
         throw new IdentificareBazaImposibilaException("BAdrese");
     }
     using (DataSet ds = DAdrese.GetById(pId, pTranzactie))
     {
         if (ds.Tables[0].Rows.Count > 0)
         {
             return(ds.Tables[0].Rows[0]);
         }
         else
         {
             throw new IdentificareBazaImposibilaException("BAdrese");
         }
     }
 }