// // GET: /Home/List public ActionResult List(string param) { DataRepository dataRepository = new DataRepository(); List<Info> list = null; list = dataRepository.getList(param); var json = Json(list, JsonRequestBehavior.AllowGet); return json; }
public ActionResult Edit(int id, Info model, FormCollection collection) { try { DataRepository dataRepository = new DataRepository(); dataRepository.editItem(model); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Delete(int id, Info model, FormCollection collection) { try { DataRepository dataRepository = new DataRepository(); dataRepository.delItemByPosition(id); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(Info model, FormCollection collection) { try { DataRepository dataRepository = new DataRepository(); dataRepository.addData(model); return RedirectToAction("Index"); } catch { return View(); } }
// // GET: /Home/Details/5 public ActionResult Details(int id) { DataRepository dataRepository = new DataRepository(); var item = dataRepository.getDetailsByPos(id); return Json(item, JsonRequestBehavior.AllowGet); }