public virtual bool Edit(CarInfo model) { try { _carRepository.Update(model); } catch { return false; } return true; }
public JsonResult Edit(CarInfo model) { var result = _carInfoService.Edit(model); return Json(new OperateMessage<CarInfo>(OperateResult.Success, result, string.Empty, model)); }
public JsonResult Create(CarInfo model) { var result = _carInfoService.Create(model); return Json(new OperateMessage<CarInfo>(OperateResult.Success, true, string.Empty, model)); }
public void OnCarCreating(CarInfo model) { if(model.Price<0) throw new ValidationException(); }