public ActionResult Edit(ProjectType obj) { try { NSession.Update(obj); NSession.Flush(); } catch (Exception ee) { return Json(new { IsSuccess = false, ErrorMsg = "出错了" }); } return Json(new { IsSuccess = true }); }
public JsonResult Create(ProjectType obj) { try { if (obj.RealEndDate < Convert.ToDateTime("2000-01-01")) { obj.RealEndDate = Convert.ToDateTime("2000-01-01"); } obj.CreateOn = DateTime.Now; obj.CreateBy = CurrentUser.Realname; NSession.Save(obj); NSession.Flush(); } catch (Exception ee) { return Json(new { IsSuccess = false, ErrorMsg = "出错了" }); } return Json(new { IsSuccess = true }); }
public ActionResult Details(ProjectType obj) { try { obj.Content = Session["Content"]+DateTime.Now.Date.ToShortDateString()+": "+obj.Content+"<br>"; NSession.Update(obj); NSession.Flush(); } catch (Exception ee) { return Json(new { IsSuccess = false, ErrorMsg = "出错了" }); } return Json(new { IsSuccess = true }); }