Example #1
0
 public static List<PersonneBO> SelectById(Int32 pId)
 {
     List<PersonneBO> lstPersonne = null;
     try {
         using (PersonneDAL personneDal = new PersonneDAL(Util.GetConnection())) {
             lstPersonne = personneDal.PersonneBO_SelectById(pId).ToList();
         }
     } catch (Exception Ex) {
         throw;
     }
     return lstPersonne;
 }
 public static PersonneBO SelectById(Int32 pId)
 {
     PersonneBO objPersonne = null;
     try {
         using (var personneDal = new PersonneDAL(Util.GetConnection())) {
             var lstPersonne = personneDal.PersonneBO_SelectById(pId).ToList();
             if (lstPersonne.Count() == 1) {
                 objPersonne = lstPersonne[0];
                 objPersonne.Client = ClientBL.SelectById(objPersonne.PersonneId);
                 objPersonne.Administrateur = AdministrateurBL.SelectById(objPersonne.PersonneId);
             }
         }
     } catch (Exception Ex) {
         throw;
     }
     return objPersonne;
 }