public ActionResult DeleteConfirmed(int id) { TypeTache typeTache = db.TypeTaches.Find(id); db.TypeTaches.Remove(typeTache); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Nom,Description")] TypeTache typeTache) { if (ModelState.IsValid) { db.Entry(typeTache).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(typeTache)); }
public ActionResult Create([Bind(Include = "Id,Nom,Description")] TypeTache typeTache) { if (ModelState.IsValid) { db.TypeTaches.Add(typeTache); db.SaveChanges(); return(RedirectToAction("Create")); } return(View(typeTache)); }
private static void FillNewTypeTache(IXLWorksheet sheet, TypeTache tache, JourEvenement jour, IEnumerable <Affectation> affectations, IEnumerable <Benevole> benevoles, bool readableExport = false, Planning p = null) { IXLCell c = sheet.Cell("A1"); c.Value = jour.Id; c = sheet.Cell("B1"); c.Value = tache.Nom; c.Style.Font.FontSize = 34; c.Style.Font.Bold = true; c = sheet.Cell("C1"); c.Value = jour.Nom; c.Style.Font.FontSize = 30; c.Style.Font.Bold = true; int i = 3; foreach (Tache t in tache.Taches.Where(s => s.Creneaux.Count(u => u.CreneauDef.JourId == jour.Id) > 0)) { FillNewTache(sheet, t, jour, ref i, p, affectations, readableExport); i += 2; } if (readableExport) { var r = sheet.Row(i); r.Cell(2).Value = "Prenom"; r.Cell(2).Style.Font.Bold = true; r.Cell(3).Value = "Nom"; r.Cell(3).Style.Font.Bold = true; r.Cell(5).Value = "Tel"; r.Cell(5).Style.Font.Bold = true; r.Cell(7).Value = "Email"; r.Cell(7).Style.Font.Bold = true; r.Cell(10).Value = "Permis"; r.Cell(10).Style.Font.Bold = true; i++; foreach (Benevole b in benevoles.OrderBy(s => s.Prenom)) { r = sheet.Row(i); r.Cell(2).Value = b.Prenom; r.Cell(3).Value = b.Nom; r.Cell(5).Value = "'" + b.Tel; r.Cell(7).Value = b.Email; r.Cell(10).Value = b.Permis ? "Oui" : "Non"; i++; } } }
// GET: TypeTaches/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TypeTache typeTache = db.TypeTaches.Find(id); if (typeTache == null) { return(HttpNotFound()); } return(View(typeTache)); }
public static TypeView tToTV(TypeTache t) { TypeView tv = null; if (t.Parent != null) { tv = tToTV(t.Parent); } return(new TypeView() { Nom = t.Nom, Parent = tv }); }