public ActionResult Edit(EbayReplayType obj) { try { NSession.Update(obj); NSession.Flush(); } catch (Exception ee) { return(Json(new { errorMsg = "出错了" })); } return(Json(new { IsSuccess = "true" })); }
/// <summary> /// 根据Id获取 /// </summary> /// <param name="Id"></param> /// <returns></returns> public EbayReplayType GetById(int Id) { EbayReplayType obj = NSession.Get <EbayReplayType>(Id); if (obj == null) { throw new Exception("返回实体为空"); } else { return(obj); } }
public JsonResult DeleteConfirmed(int id) { try { EbayReplayType obj = GetById(id); NSession.Delete(obj); NSession.Flush(); } catch (Exception ee) { return(Json(new { errorMsg = "出错了" })); } return(Json(new { IsSuccess = "true" })); }
public JsonResult Create(EbayReplayType obj) { try { obj.CreateBy = CurrentUser.Realname; obj.CreateOn = DateTime.Now; NSession.SaveOrUpdate(obj); NSession.Flush(); } catch (Exception ee) { return(Json(new { errorMsg = "出错了" })); } return(Json(new { IsSuccess = "true" })); }
public ActionResult Edit(int id) { EbayReplayType obj = GetById(id); return(View(obj)); }