public Tache insertTache(string libelle, string description, DateTime date_debut, int duree, int id_tache_precente, int id_responsable, int id_jalon, int avancement) { using (TacheTableAdapter tacheTableAdapter = new TacheTableAdapter()) { int id = (int)tacheTableAdapter.insertTache(libelle, description, date_debut, null, duree, id_tache_precente, id_responsable, id_jalon, avancement); Tache tache = FactoryServicesDA.createTacheServices().getTacheById(id); return(tache); } }
public List <Jalon> getJalonsByProjet(int id_projet) { JalonDataTable jalonDataTable = new JalonDataTable(); List <Jalon> jalons = new List <Jalon>(); using (JalonTableAdapter jalonTableAdapter = new JalonTableAdapter()) { jalonDataTable = jalonTableAdapter.getJalonsByProjet(id_projet); foreach (JalonRow row in jalonDataTable) { Jalon jalon = new Jalon(row.id, row.libelle, row.date_livraison, row.id_projet, row.id_responsable); jalon.Etat = FactoryServicesDA.createTacheServices().getEtatTachesByJalon(row.id); jalons.Add(jalon); } return(jalons); } }
public Tache getTacheById(int id) { TacheDataTable tacheDataTable = new TacheDataTable(); using (TacheTableAdapter tacheTableAdapter = new TacheTableAdapter()) { tacheDataTable = tacheTableAdapter.getTacheById(id); TacheRow row = tacheDataTable[0]; Tache tache = new Tache(row.id, row.libelle, row.description, row.date_debut, row.duree, row.id_tache_precente, row.id_responsable, row.id_jalon, row.avancement); if (row.id_tache_precente > 0) { Tache tache_precedente = FactoryServicesDA.createTacheServices().getTacheById(row.id_tache_precente); tache.Tache_precedente = tache_precedente; } Utilisateur responsable = FactoryServicesDA.createUtilisateurServices().getUtilisateurById(row.id_responsable); tache.Responsable = responsable; Jalon jalon = FactoryServicesDA.createJalonServices().getJalonById(row.id_jalon); tache.Jalon = jalon; return(tache); } }