public JsonResult Update(dnt_test_topics obj) { ResultModel <dynamic> model = new ResultModel <dynamic>(); _service.Command <Outsourcing>((db, o) => { model.IsSuccess = model.ResultInfo = db.Update <dnt_test_topics>( new { title = obj.title, fid = obj.fid } , it => it.tid == obj.tid); }); return(Json(model, JsonRequestBehavior.AllowGet)); }
public JsonResult Insert(dnt_test_topics obj) { ResultModel <dynamic> model = new ResultModel <dynamic>(); _service.Command <Outsourcing>((db, o) => { obj.postdatetime = DateTime.Now; obj.lastpost = DateTime.Now; obj.lastposter = obj.poster = "管理员"; model.ResultInfo = db.Insert(obj); model.IsSuccess = true; }); return(Json(model, JsonRequestBehavior.AllowGet)); }