예제 #1
0
 public JsonResult Get(int page, int pageSize)
 {
     JsonResult result = new JsonResult();
     StudentShare bll = new StudentShare();
     var t = bll.FindByPage(page, pageSize);
     return Json(t, JsonRequestBehavior.AllowGet);
 }
예제 #2
0
 public ActionResult Add()
 {
     var t = Request.QueryString["id"];
     if (t != null)
     {
         ViewData["studentshareinfo"] = new StudentShare().Find(int.Parse(t.ToString()));
     }
     return View();
 }
예제 #3
0
 public ActionResult GetModel()
 {
     if (Request["id"] != null)
     {
         ViewData["studentshareinfo"] = new StudentShare().Find(int.Parse(Request["id"].ToString()));
     }
     else
     {
         ViewData["studentshareinfo"] = null;
     }
     return View();
 }
예제 #4
0
 public ActionResult Detail()
 {
     var id = Request.QueryString["id"];
     int pid = 0;
     var i = int.TryParse(id, out pid);
     if (!string.IsNullOrEmpty(id) && i)
     {
         var model = new StudentShare().Find(pid);
         if (model == null)
         {
             model = new sd_studentshare();
         }
         ViewBag.studentShareDetail = model;
     }
     return View();
 }
예제 #5
0
 public ActionResult Update(string models)
 {
     sd_studentshare model = new sd_studentshare();
     List<sd_studentshare> list = new List<sd_studentshare>();
     if (models != null)
     {
         model = JsonConvert.DeserializeObject<sd_studentshare>(models);
         var t = new StudentShare().Update(model);
     }
     return Json(list);
 }
예제 #6
0
 public ActionResult UpdateList(string models)
 {
     sd_studentshare model = new sd_studentshare();
     List<sd_studentshare> list = new List<sd_studentshare>();
     if (models != null)
     {
         try
         {
             list = JsonConvert.DeserializeObject<List<sd_studentshare>>(models);
             foreach (sd_studentshare item in list)
             {
                 var t = new StudentShare().Update(item);
             }
             return Json(true);
         }
         catch (Exception ex)
         {
             return Json(false);
         }
     }
     return Json(list);
 }