public static bool Delete(SocieteManager societeManager, Societe societe) { SocieteDataAccess dataAccess = new SocieteDataAccess(); int rowCount = dataAccess.Delete(societe); return(rowCount > 0); }
public List <Societe> RetrieveAllSocietes(string textItem) { List <Societe> societes = new List <Societe>(); SocieteDataAccess dataAccess = new SocieteDataAccess(); DataTable schemaTable = dataAccess.SelectAll(); foreach (DataRow row in schemaTable.Rows) { Societe societe = new Societe { Id = Convert.ToInt32(row["ID_SOCIETE"]), Nom = row["NOM_SOCIETE"].ToString().ToUpper() }; societes.Add(societe); } Societe societeItem = new Societe { Id = 0, Nom = textItem }; societes.Insert(0, societeItem); return(societes); }
public static int Create(SocieteManager societeManager, Societe societe) { SocieteDataAccess dataAccess = new SocieteDataAccess(); int idSociete = dataAccess.Insert(societe); return(idSociete); }