public ActionResult Edit(NewGuideType obj) { try { NSession.Update(obj); NSession.Flush(); } catch (Exception ee) { return(Json(new { IsSuccess = false, ErrorMsg = "出错了" })); } return(Json(new { IsSuccess = true })); }
/// <summary> /// ����Id��ȡ /// </summary> /// <param name="Id"></param> /// <returns></returns> public NewGuideType GetById(int Id) { NewGuideType obj = NSession.Get <NewGuideType>(Id); if (obj == null) { throw new Exception("出错"); } else { return(obj); } }
public JsonResult DeleteConfirmed(int id) { try { NewGuideType obj = GetById(id); NSession.Delete(obj); NSession.Flush(); } catch (Exception ee) { return(Json(new { IsSuccess = false, ErrorMsg = "出错了" })); } return(Json(new { IsSuccess = true })); }
public JsonResult Create(NewGuideType obj) { try { obj.CreateOn = DateTime.Now; NSession.SaveOrUpdate(obj); NSession.Flush(); } catch (Exception ee) { return(Json(new { IsSuccess = false, ErrorMsg = "出错了" })); } return(Json(new { IsSuccess = true })); }
public ActionResult Edit(int id) { NewGuideType obj = GetById(id); return(View(obj)); }