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 Utilisateur insertUtilisateur(string trigramme) { using (UtilisateurTableAdapter utilisateurTableAdapter = new UtilisateurTableAdapter()) { int id = (int)utilisateurTableAdapter.insertUtilisateur(trigramme); Utilisateur utilisateur = FactoryServicesDA.createUtilisateurServices().getUtilisateurById(id); Debug.Write("Id from ServiceDA-->"); Debug.Write(utilisateur.Id); return(utilisateur); } }
public Project getProjectById(int id) { ProjetDataTable projetDataTable = new ProjetDataTable(); using (ProjetTableAdapter projetTableAdapter = new ProjetTableAdapter()) { projetDataTable = projetTableAdapter.getProjetById(id); ProjetRow row = projetDataTable[0]; Project projet = new Project(row.id, row.trigramme, row.id_utilisateur); projet.Responsable = FactoryServicesDA.createUtilisateurServices().getUtilisateurById(row.id_utilisateur); return(projet); } }
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 List <Project> getProjets() { ProjetDataTable projetDataTable = new ProjetDataTable(); List <Project> projets = new List <Project>(); using (ProjetTableAdapter projetTableAdapter = new ProjetTableAdapter()) { projetDataTable = projetTableAdapter.getProjets(); foreach (ProjetRow row in projetDataTable) { Project projet = new Project(row.id, row.trigramme, row.id_utilisateur); projet.Etat = this.getEtatProjet(row.id); projet.Responsable = FactoryServicesDA.createUtilisateurServices().getUtilisateurById(row.id_utilisateur); projets.Add(projet); } return(projets); } }
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); } }