public ActionResult Create(FormCollection collection) { int id_projet = Convert.ToInt32(Session["projet"]); if (ModelState.IsValid) { DateTime date_livraison = Convert.ToDateTime(collection["date_livraison"]); int type = Convert.ToInt32(collection.Get("type")); string type_string; string libelle; if (type == 0) { libelle = collection.Get("libelle"); type_string = "Non fonctionnelle"; } else { libelle = ""; type_string = "Fonctionnelle"; } bool res = FactoryServices.createServices().insertExigence(type_string, libelle, id_projet); if (res == true) { TempData["alert"] = "succes"; TempData["result"] = "Exigence a été crée"; //return RedirectToAction("Index", "Jalon"); } else { TempData["alert"] = "danger"; TempData["result"] = "Une erreur est survenue lors de l'ajout"; } } return(RedirectToAction("Index", "Exigence", new { @id = id_projet })); }
protected void btn_ajouter_projet_Click(object sender, EventArgs e) { int id = 2; string trigramme = nom.Text; bool res = FactoryServices.createServices().insertProjet(trigramme, id); Debug.Write(res); }
// GET: Tache/Details/5 public ActionResult Details(int id) { Tache tache = FactoryServices.createServices().getTacheById(id); List <Exigence> exigences = FactoryServices.createServices().getExigencesByTache(id); ViewBag.Exigences = exigences; return(View(tache)); }
public ActionResult Edit(int id) { Jalon jalon = FactoryServices.createServices().getJalonById(id); List <Utilisateur> utilisateurs = FactoryServices.createServices().getUtilisateurs(); ViewBag.Utilisateurs = utilisateurs; return(View("Edit")); }
public ActionResult Edit(int id) { Project projet = FactoryServices.createServices().getProjectById(id); List <Utilisateur> utilisateurs = FactoryServices.createServices().getUtilisateurs(); ViewBag.Utilisateurs = utilisateurs; return(View("Edit")); }
protected void btn_editer_Click(object sender, EventArgs e) { int id = 2; Debug.Write(id); Project project = FactoryServices.createServices().getProjectById(id); string trigramme = project.Trigramme; string Id_responsable = project.Id_responsable.ToString(); Debug.WriteLine("Parameters: {0}, {1}", trigramme, Id_responsable); }
protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["id"]; string nom = Request.QueryString["nom"]; id_label.InnerText = id; projet_trigramme.InnerText += nom; int id_projet = Convert.ToInt32(id); List <Jalon> jalons = FactoryServices.createServices().getJalonsByProjet(id_projet); repeater.DataSource = jalons; repeater.DataBind(); }
public ActionResult Index() { if (TempData["alert"] != null && TempData["result"] != null) { ViewBag.Alert = TempData["alert"].ToString(); ViewBag.Result = TempData["result"].ToString(); } List <Project> liste_projets = FactoryServices.createServices().getProjets(); List <Utilisateur> utilisateurs = FactoryServices.createServices().getUtilisateurs(); ViewBag.Utilisateurs = utilisateurs; return(View(liste_projets)); }
// GET: Tache/Edit/5 public ActionResult Edit(int id) { int id_projet = Convert.ToInt32(Session["projet"]); int id_jalon = Convert.ToInt32(Session["jalon"]); List <Utilisateur> utilisateurs = FactoryServices.createServices().getUtilisateurs(); List <Exigence> exigences = FactoryServices.createServices().getExigencesByProjet(id_projet); List <Tache> taches = FactoryServices.createServices().getTachesByJalon(id_jalon); Tache tache = FactoryServices.createServices().getTacheById(id); ViewBag.Utilisateurs = utilisateurs; Tuple <List <Utilisateur>, List <Tache>, List <Exigence>, Tache> tuple = new Tuple <List <Utilisateur>, List <Tache>, List <Exigence>, Tache> (utilisateurs, taches, exigences, tache); return(View(tuple)); }
public ActionResult Delete(int id) { bool res = FactoryServices.createServices().deleteProjet(id); if (res) { TempData["alert"] = "success"; TempData["result"] = "Projet supprimé"; } else { TempData["alert"] = "danger"; TempData["result"] = "Une erreur est survenue lors de suppression"; } return(RedirectToAction("Index")); }
public ActionResult Edit(int id, FormCollection collection) { int id_projet = Convert.ToInt32(Session["projet"]); if (ModelState.IsValid) { string libelle = collection["libelle"]; int id_responsable; DateTime date_livraison = Convert.ToDateTime(collection["date_livraison"]); if (collection.Get("ids_users") == "" || collection.Get("ids_users") == null) { string user_trigramme = collection["user_tri"]; Utilisateur utilisateur = FactoryServices.createServices().insertUtilisateur(user_trigramme); id_responsable = utilisateur.Id; } else { id_responsable = Convert.ToInt32(collection.Get("ids_users")); } DateTime date_reelle; if (collection.Get("date_reelle") == "" || collection.Get("date_reelle") == null) { date_reelle = Convert.ToDateTime(""); } else { date_reelle = Convert.ToDateTime(collection.Get("date_reelle")); } Jalon jalon = FactoryServices.createServices().updateJalon(id, libelle, date_livraison, date_reelle, id_projet, id_responsable); if (jalon.Id != 0) { TempData["alert"] = "succes"; TempData["result"] = "Jalon a été modifé"; //return RedirectToAction("Index", "Jalon"); } else { TempData["alert"] = "danger"; TempData["result"] = "Une erreur est survenue lors de modification"; } } return(RedirectToAction("Index", "Jalon", new { @id = id_projet })); }
// GET: Tache/Delete/5 public ActionResult Delete(int id) { int id_jalon = Convert.ToInt32(Session["jalon"]); bool res = FactoryServices.createServices().deleteTache(id); if (res) { TempData["alert"] = "success"; TempData["result"] = "Tâche supprimé"; } else { TempData["alert"] = "danger"; TempData["result"] = "Une erreur est survenue lors de suppression"; } return(RedirectToAction("Index", "Tache", new { @id = id_jalon })); }
// GET: Tache public ActionResult Index(int mode, int id) { List <Tache> liste_taches; int id_projet = Convert.ToInt32(Session["projet"]); // on fait la requête selon le menu selectionné si le paramètre passe est 1 alors ce sont les tâches de l'exigence if (mode == 1) { ViewBag.Title = "Liste des tâches de l'exigence"; Session["exigence"] = id; liste_taches = FactoryServices.createServices().getTachesByExigence(id); } else { ViewBag.Title = "Liste des tâches du jalon"; Session.Remove("exigence"); // sinon c'est l'affichage par le jalon if (id != 0 && id != null) { Session["jalon"] = id; } else { id = Convert.ToInt32(Session["jalon"]); } liste_taches = FactoryServices.createServices().getTachesByJalon(id); List <Exigence> exigences = FactoryServices.createServices().getExigencesByProjet(id_projet); ViewBag.Exigences = exigences; } if (TempData["alert"] != null && TempData["result"] != null) { ViewBag.Alert = TempData["alert"].ToString(); ViewBag.Result = TempData["result"].ToString(); } List <Utilisateur> utilisateurs = FactoryServices.createServices().getUtilisateurs(); List <Tache> taches = FactoryServices.createServices().getTachesByProjet(id_projet); ViewBag.Utilisateurs = utilisateurs; ViewBag.Taches = taches; return(View(liste_taches)); }
public ActionResult Create(FormCollection collection) { try { if (ModelState.IsValid) { string trigramme = collection["trigramme"]; int id_responsable; if (collection.Get("ids_users") == "" || collection.Get("ids_users") == null) { string user_trigramme = collection["user_tri"]; Utilisateur utilisateur = FactoryServices.createServices().insertUtilisateur(user_trigramme); id_responsable = utilisateur.Id; } else { id_responsable = Convert.ToInt32(collection.Get("ids_users")); } bool res = FactoryServices.createServices().insertProjet(trigramme, id_responsable); if (res == true) { TempData["alert"] = "succes"; TempData["result"] = "Projet a été crée"; //return RedirectToAction("Index", "Jalon"); } else { TempData["alert"] = "danger"; TempData["result"] = "Une erreur est survenue lors de l'ajout"; } } //ViewBag.Alert = "succes"; //ViewBag.Result = "Medecin a été ajouté"; return(RedirectToAction("Index", "Home")); } catch { //ViewBag.Alert = "danger"; //ViewBag.Result = "Une erreur est survenue lors de l'ajout"; return(RedirectToAction("About", "Home")); } }
// GET: Exigence public ActionResult Index(int id) { if (id != 0 && id != null) { Session["projet"] = id; if (TempData["alert"] != null && TempData["result"] != null) { ViewBag.Alert = TempData["alert"].ToString(); ViewBag.Result = TempData["result"].ToString(); } } else { id = Convert.ToInt32(Session["projet"]); } List <Exigence> exigences = FactoryServices.createServices().getExigencesByProjet(id); ViewBag.Exigences = exigences; return(View(exigences)); }
// GET: Jalon public ActionResult Index(int id) { if (id != 0 && id != null) { Session["projet"] = id; if (TempData["alert"] != null && TempData["result"] != null) { ViewBag.Alert = TempData["alert"].ToString(); ViewBag.Result = TempData["result"].ToString(); } } else { id = Convert.ToInt32(Session["projet"]); } List <Jalon> liste_jalons = FactoryServices.createServices().getJalonsByProjet(id); List <Utilisateur> utilisateurs = FactoryServices.createServices().getUtilisateurs(); ViewBag.Utilisateurs = utilisateurs; return(View(liste_jalons)); }
protected void Page_Load(object sender, EventArgs e) { List <Project> projets = FactoryServices.createServices().getProjets(); StringBuilder html = new StringBuilder(); Table tb = new Table(); foreach (var projet in projets) { TableRow tr = new TableRow(); TableCell td1 = new TableCell(); TableCell td2 = new TableCell(); TableCell td3 = new TableCell(); td1.CssClass = "col-sm-6"; td1.Text = projet.Trigramme; td2.CssClass = "col-sm-6"; td3.CssClass = "col-sm-6"; Button btn_edit = new Button(); btn_edit.CssClass = "btn btn-warning"; btn_edit.Text = "Editer"; btn_edit.OnClientClick = "btn_editer_Click"; Button btn_delete = new Button(); btn_delete.CssClass = "btn btn-danger"; btn_delete.Text = "Supprimer"; btn_delete.OnClientClick = "btn_supprimer_Click"; HyperLink anchor = new HyperLink(); anchor.Attributes.Add("href", "/About?id=" + projet.Id + "&nom=" + projet.Trigramme); anchor.CssClass = "list-group-item list-group-item-action"; td1.Controls.Add(anchor); td2.Controls.Add(btn_edit); td3.Controls.Add(btn_delete); tr.Cells.Add(td1); tr.Cells.Add(td2); tr.Cells.Add(td3); tbody_table.Controls.Add(tr); //tb.Rows.Add(tr); } //table_div.Controls.Add(tb); Debug.Write("page Load here :::"); }
public ActionResult Edit(int id, FormCollection collection) { try { string trigramme = collection["trigramme"]; int id_responsable; // si on séléctionne un responsable de la liste if (collection.Get("ids_users") == "" || collection.Get("ids_users") == null) { string user_trigramme = collection["user_tri"]; Utilisateur utilisateur = FactoryServices.createServices().insertUtilisateur(user_trigramme); id_responsable = utilisateur.Id; } else { // si non on crée un nouveau responsable et l'ajoute au nouveau id_responsable = Convert.ToInt32(collection.Get("ids_users")); } Project projet = FactoryServices.createServices().updateProjet(id, trigramme, id_responsable); if (projet.Id != 0) { TempData["alert"] = "succes"; TempData["result"] = "Projet a été modifé"; //return RedirectToAction("Index", "Jalon"); } else { TempData["alert"] = "danger"; TempData["result"] = "Une erreur est survenue lors de modification"; } return(RedirectToAction("Index")); } catch { return(RedirectToAction("About")); } }
public ActionResult Edit(int id, FormCollection collection) { int id_projet = Convert.ToInt32(Session["projet"]); if (ModelState.IsValid) { DateTime date_livraison = Convert.ToDateTime(collection["date_livraison"]); int type = Convert.ToInt32(collection.Get("type")); string type_string; string libelle; if (type == 0) { libelle = collection.Get("libelle"); type_string = "Non fonctionnelle"; } else { libelle = ""; type_string = "Fonctionnelle"; } Debug.Write(type_string); Debug.Write(libelle); Exigence exigence = FactoryServices.createServices().updateExigence(id, type_string, libelle, id_projet); if (exigence.Id != 0) { TempData["alert"] = "succes"; TempData["result"] = "Exigence modifiée"; //return RedirectToAction("Index", "Jalon"); } else { TempData["alert"] = "danger"; TempData["result"] = "Une erreur est survenue lors de modification"; } } return(RedirectToAction("Index", "Exigence", new { @id = id_projet })); }
public ActionResult Create(FormCollection collection) { int id_projet = Convert.ToInt32(Session["projet"]); if (ModelState.IsValid) { string libelle = collection["libelle"]; int id_responsable; DateTime date_livraison = Convert.ToDateTime(collection["date_livraison"]); if (collection.Get("ids_users") == "" || collection.Get("ids_users") == null) { string user_trigramme = collection["user_tri"]; Utilisateur utilisateur = FactoryServices.createServices().insertUtilisateur(user_trigramme); id_responsable = utilisateur.Id; } else { id_responsable = Convert.ToInt32(collection.Get("ids_users")); } bool res = FactoryServices.createServices().insertJalon(libelle, date_livraison, id_projet, id_responsable); if (res == true) { TempData["alert"] = "succes"; TempData["result"] = "Jalon a été crée"; //return RedirectToAction("Index", "Jalon"); } else { TempData["alert"] = "danger"; TempData["result"] = "Une erreur est survenue lors de l'ajout"; } } return(RedirectToAction("Index", "Jalon", new { @id = id_projet })); }
public ActionResult Create(FormCollection collection) { int id_jalon = Convert.ToInt32(Session["jalon"]); int mode = 2; int id_redirect = id_jalon; if (ModelState.IsValid) { string libelle = collection["libelle"]; string description = collection["description"]; int duree = Convert.ToInt32(collection["duree"]); int tache_precedente = Convert.ToInt32(collection.Get("tache_precedente")); int id_responsable; string res_chk_exigence = collection["checkbox_exigence"]; string res_chk_new = collection["checkbox_new"]; DateTime date_debut = Convert.ToDateTime(collection["date_debut"]); if (res_chk_new == "on") { string user_trigramme = collection["user_tri"]; Utilisateur utilisateur = FactoryServices.createServices().insertUtilisateur(user_trigramme); id_responsable = utilisateur.Id; } else { id_responsable = Convert.ToInt32(collection.Get("ids_users")); } int avancement = 0; // tâche non démarré par défaut Tache tache = FactoryServices.createServices().insertTache(libelle, description, date_debut, duree, tache_precedente, id_responsable, id_jalon, avancement); int id_exigence = 0; if (Session["exigence"] != null) { id_exigence = Convert.ToInt32(Session["exigence"]); id_redirect = id_exigence; mode = 1; } else { if (res_chk_exigence == "on") { id_exigence = Convert.ToInt32(collection.Get("ids_exigences")); } } if (id_exigence != 0) { bool res = FactoryServices.createServices().insertAssoc(id_exigence, tache.Id); } if (tache.Id != 0) { TempData["alert"] = "succes"; TempData["result"] = "Nouvelle tâche ajoutée"; //return RedirectToAction("Index", "Jalon"); } else { TempData["alert"] = "danger"; TempData["result"] = "Une erreur est survenue lors de l'ajout"; } } return(RedirectToAction("Index", "Tache", new { @mode = mode, @id = id_redirect })); }
// GET: Exigence/Edit/5 public ActionResult Edit(int id) { Exigence exigence = FactoryServices.createServices().getExigenceById(id); return(View(exigence)); }
public ActionResult Edit(int id, FormCollection collection) { int id_jalon = Convert.ToInt32(Session["jalon"]); int mode = 2; int id_redirect = id_jalon; if (ModelState.IsValid) { string libelle = collection["libelle"]; string description = collection["description"]; int duree = Convert.ToInt32(collection["duree"]); int id_tache_precente = Convert.ToInt32(collection.Get("tache_precedente")); int avancement = Convert.ToInt32(collection.Get("avancement")); int id_responsable; string res_chk_exigence = collection["checkbox_exigence"]; DateTime date_debut = Convert.ToDateTime(collection["date_debut"]); if (collection.Get("ids_users") == "" || collection.Get("ids_users") == null) { string user_trigramme = collection["user_tri"]; Utilisateur utilisateur = FactoryServices.createServices().insertUtilisateur(user_trigramme); id_responsable = utilisateur.Id; } else { id_responsable = Convert.ToInt32(collection.Get("ids_users")); } DateTime date_reelle_debut; if (collection.Get("date_reelle") == "" || collection.Get("date_reelle") == null) { date_reelle_debut = Convert.ToDateTime(""); } else { date_reelle_debut = Convert.ToDateTime(collection.Get("date_reelle")); if (avancement == 0) { avancement = 1; // on considère que dès qu'on a une date réelle la tâche est en cours } } int id_exigence = 0; if (Session["exigence"] != null) { id_exigence = Convert.ToInt32(Session["exigence"]); id_redirect = id_exigence; mode = 1; } else { if (res_chk_exigence == "on") { id_exigence = Convert.ToInt32(collection.Get("ids_exigences")); } } Tache tache = FactoryServices.createServices().updateTache(id, libelle, description, date_debut, date_reelle_debut, duree, id_tache_precente, id_responsable, id_jalon, avancement); int id_tache = tache.Id; if (id_exigence != 0) { Debug.Write("Id exigence ---->"); Debug.Write(id_exigence); Debug.Write("Id tache ---->"); Debug.Write(id_tache); bool res = FactoryServices.createServices().insertAssoc(id_exigence, id_tache); } if (tache.Id != 0) { TempData["alert"] = "succes"; TempData["result"] = "Tâche a été modifé"; //return RedirectToAction("Index", "Jalon"); } else { TempData["alert"] = "danger"; TempData["result"] = "Une erreur est survenue lors de modification"; } } return(RedirectToAction("Index", "Tache", new { @mode = mode, @id = id_redirect })); }