コード例 #1
0
        //
        // 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;
        }
コード例 #2
0
 public ActionResult Edit(int id, Info model, FormCollection collection)
 {
     try
     {
         DataRepository dataRepository = new DataRepository();
         dataRepository.editItem(model);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #3
0
 public ActionResult Delete(int id, Info model, FormCollection collection)
 {
     try
     {
         DataRepository dataRepository = new DataRepository();
         dataRepository.delItemByPosition(id);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #4
0
 public ActionResult Create(Info model, FormCollection collection)
 {
     try
     {
         DataRepository dataRepository = new DataRepository();
         dataRepository.addData(model);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
コード例 #5
0
 //
 // GET: /Home/Details/5
 public ActionResult Details(int id)
 {
     DataRepository dataRepository = new DataRepository();
     var item = dataRepository.getDetailsByPos(id);
     return Json(item, JsonRequestBehavior.AllowGet);
 }