public JsonResult Edit(DishesSpec model) { try { if (model.DishesSpecId > 0) { var entity = _DishesSpecService.GetById(model.DishesSpecId); //修改 entity.Name = model.Name; //执行更新 _DishesSpecService.Update(entity); } else { //新增 _DishesSpecService.Insert(model); } } catch (Exception) { return(Json(new { Status = Successed.Error, Info = Successed.Error.ToString() }, JsonRequestBehavior.AllowGet)); } return(Json(new { Status = Successed.Ok }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 删除实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Delete(DishesSpec model) { this._DishesSpecBiz.Delete(model); }
/// <summary> /// 修改实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Update(DishesSpec model) { this._DishesSpecBiz.Update(model); }
/// <summary> /// 添加实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public DishesSpec Insert(DishesSpec model) { return(this._DishesSpecBiz.Insert(model)); }
/// <summary> /// 删除实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Delete(DishesSpec model) { this._repoDishesSpec.Delete(model); }
/// <summary> /// 修改实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Update(DishesSpec model) { this._repoDishesSpec.Update(model); }
public DishesSpec Insert(DishesSpec model) { return(this._repoDishesSpec.Insert(model)); }