Exemplo n.º 1
0
 public JsonResult Post(Game_QARst _t)
 {
     if (WMFactory.GameQARst.Insert(_t))
         return Json(ResultMsg.Success("新增成功!"));
     else
         return Json(ResultMsg.Failure("新增失败,请您重试!"));
 }
Exemplo n.º 2
0
 public JsonResult Delete(Game_QARst _t)
 {
     if (WMFactory.GameQARst.Delete(s => s.Id == _t.Id ))
         return Json(ResultMsg.Success("删除成功!"));
     else
         return Json(ResultMsg.Failure("删除失败,请您重试!"));
 }
Exemplo n.º 3
0
 public JsonResult Put(Game_QARst _t)
 {
     IGameQARstService service = WMFactory.GameQARst;
     Game_QARst entity = service.GetById(_t.Id.ToString());
     entity = AutoMapper<Game_QARst, Game_QARst>.Convert(_t, entity);
     if (service.Update(entity))
         return Json(ResultMsg.Success("更新成功!"));
     else
         return Json(ResultMsg.Failure("更新失败,请您重试!"));
 }
Exemplo n.º 4
0
 public JsonResult Submit(Guid sid, int score)
 {
     Game_QARst rst = new Game_QARst();
     rst.TntId = sid;
     rst.Oid = string.IsNullOrEmpty(Request["oid"]) ? Guid.NewGuid().ToString() : Request["oid"];
     rst.Total = score;
     rst.CreateUser = "******";
     rst.Id = Guid.NewGuid();
     if (WMFactory.GameQARst.Insert(rst))
         return Json(ResultMsg.Success(rst.Id.ToString()));
     else
         return Json(ResultMsg.Failure("很抱歉,成绩提交失败"));
 }