Beispiel #1
0
 public ActionResult Delete(int id)
 {
     try
     {
         model = new Cruds(Session);
         model.Delete(id);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Beispiel #2
0
 public ActionResult Create(FormCollection collection)
 {
     try
     {
         model = new Cruds(Session);
         CrudWS.Crud crud = new CrudWS.Crud();
         crud.Name = collection["Name"];
         model.Create(crud);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Beispiel #3
0
 public ActionResult Edit(int id, FormCollection collection)
 {
     try
     {
         model = new Cruds(Session);
         CrudWS.Crud crud = new CrudWS.Crud();
         crud.CrudId = Convert.ToInt32(collection["CrudId"]);
         crud.Name = collection["Name"];
         model.Edit(crud);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Beispiel #4
0
 public ActionResult Index()
 {
     model = new Cruds(Session);
     return View(model.Index());
 }
Beispiel #5
0
 public ActionResult Edit(int id)
 {
     model = new Cruds(Session);
     return View(model.Find(id));
 }