// Methode qui retourne un bool en fonctione du status Factory public static bool CheckStatus(FactoryBO factory) { try { List<FactoryBO> listResult = new List<FactoryBO>(); FactoryBO result = new FactoryBO(); FactoryDAL dal = new FactoryDAL(CUtil.GetConnexion()); listResult = dal.FactoryBO_FindById(factory.id_factory).ToList(); result = listResult.FirstOrDefault(); if (result.status == "true") { return true; } else { return false; } } catch (Exception) { throw; } }
// Méthode retourne la Factory en fonction de ID Factory public static FactoryBO SearchById(int id_factory) { try { List<FactoryBO> listResult = new List<FactoryBO>(); FactoryBO result = new FactoryBO(); FactoryDAL dal = new FactoryDAL(CUtil.GetConnexion()); listResult = dal.FactoryBO_FindById(id_factory).ToList(); result = listResult.FirstOrDefault(); return result; } catch (Exception) { throw; } }