public JsonResult SubmitUser(Game_QAVolunteer vt) { IEnumerable<Game_QAVolunteer> volunteers = WMFactory.GameQAVolunteer.FindByConditions(null, f => f.Oid == vt.Oid); bool flag = false; if (volunteers.Count() <= 0) { vt.CreateUser = "******"; vt.TntId = Guid.Parse("cfe404ea-fe5b-4a85-87f0-b2701929462c"); flag = WMFactory.GameQAVolunteer.Insert(vt); } else { Game_QAVolunteer vtnew = volunteers.First(); vtnew.VtAddress = vt.VtAddress; vtnew.VTName = vt.VTName; vtnew.VtPhone = vt.VtPhone; vtnew.VtReason = vt.VtReason; vtnew.ModifyUser = "******"; flag = WMFactory.GameQAVolunteer.Update(vtnew); } if (flag) return Json(ResultMsg.Success("报名成功!")); else return Json(ResultMsg.Failure("报名失败!")); }
public JsonResult Post(Game_QAVolunteer _t) { if (WMFactory.GameQAVolunteer.Insert(_t)) return Json(ResultMsg.Success("新增成功!")); else return Json(ResultMsg.Failure("新增失败,请您重试!")); }
public JsonResult Delete(Game_QAVolunteer _t) { if (WMFactory.GameQAVolunteer.Delete(s => s.Id == _t.Id )) return Json(ResultMsg.Success("删除成功!")); else return Json(ResultMsg.Failure("删除失败,请您重试!")); }
public JsonResult Put(Game_QAVolunteer _t) { IGameQAVolunteerService service = WMFactory.GameQAVolunteer; Game_QAVolunteer entity = service.GetById(_t.Id.ToString()); entity = AutoMapper<Game_QAVolunteer, Game_QAVolunteer>.Convert(_t, entity); if (service.Update(entity)) return Json(ResultMsg.Success("更新成功!")); else return Json(ResultMsg.Failure("更新失败,请您重试!")); }