예제 #1
0
 public ActionResult AjouterBieres()
 {
     BieresRecord biere = new BieresRecord();
     TypesTable types = new TypesTable(Session["Database"]);
     types.SelectAll();
     biere.ListeTypes = types.ToList();
     return View(biere);
 }
예제 #2
0
 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");
 }
예제 #3
0
 public ActionResult AjouterTypes(TypesRecord type)
 {
     if (ModelState.IsValid)
     {
         TypesTable table = new TypesTable(Session["Database"]);
         table.type = type;
         table.Insert();
         return RedirectToAction("Index", "Bieres");
     }
     return View(type);
 }
예제 #4
0
 public ActionResult EditerTypes(String Id)
 {
     TypesTable types = new TypesTable(Session["Database"]);
     if (types.SelectByID(Id))
         return View(types.type);
     else
         return RedirectToAction("ListerTypes", "Bieres");
 }
예제 #5
0
 public ActionResult SupprimerTypes(String Id)
 {
     TypesTable table = new TypesTable(Session["Database"]);
     BieresTable biere = new BieresTable(Session["Database"]);
     biere.DeleteAllByType(Id);
     table.DeleteRecordByID(Id);
     return RedirectToAction("ListerTypes", "Bieres");
 }
예제 #6
0
        ////////////////////////////////////////////////////////////
        // TYPES
        ////////////////////////////////////////////////////////////
        public ActionResult ListerTypes()
        {
            TypesTable table = new TypesTable(Session["Database"]);

            String orderBy = "";

            if (Session["SortBy_Type"] != null)
                orderBy = (String)Session["SortBy_Type"] + " " + (String)Session["SortOrder"];

            table.SelectAll(orderBy);

            return View(table.ToList());
        }
예제 #7
0
 public ActionResult EditerTypes(TypesRecord record)
 {
     TypesTable table = new TypesTable(Session["Database"]);
     if (ModelState.IsValid)
     {
         if (table.SelectByID(record.Id))
         {
             table.type = record;
             table.Update();
             return RedirectToAction("ListerTypes", "Bieres");
         }
     }
     return View(record);
 }