public ActionResult EditerSelections(String Id) { SelectionTable table = new SelectionTable(Session["Database"]); table.SelectByID(Id); BieresTable bieres = new BieresTable(Session["Database"]); bieres.SelectByID(table.Selection.IdBiere); table.Selection.ListeBieres = new List<BieresRecord>(); table.Selection.ListeBieres.Add(bieres.biere); return View(table.Selection); }
public ActionResult EditerBieres(String Id) { BieresTable bieres = new BieresTable(Session["Database"]); TypesTable types = new TypesTable(Session["Database"]); types.SelectAll(); bieres.biere.ListeTypes = types.ToList(); if (bieres.SelectByID(Id)) return View(bieres.biere); else return RedirectToAction("ListerBieres", "Bieres"); }
public ActionResult EditerBieres(BieresRecord record) { BieresTable table = new BieresTable(Session["Database"]); if (ModelState.IsValid) { if (table.SelectByID(record.Id.ToString())) { record.Etiquette = table.biere.Etiquette; table.biere = record; table.biere.UploadEtiquette(Request); table.Update(); return RedirectToAction("ListerBieres", "Bieres"); } } return View(record); }
public ActionResult EditerSelections(SelectionsRecord selection) { if (ModelState.IsValid) { SelectionTable table = new SelectionTable(Session["Database"]); table.Selection = selection; table.Update(); return RedirectToAction("AfficherSelections", "Selections", new { Id = ((BarsTable)Session["Bar"]).bar.Id }); } else { BieresTable bieres = new BieresTable(Session["Database"]); bieres.SelectByID(selection.IdBiere); selection.ListeBieres = new List<BieresRecord>(); selection.ListeBieres.Add(bieres.biere); return View(selection); } }