//添加商品 -编辑 public ActionResult AddGoods(string formVals = "{}") { var vmResult = new CommonAjaxResponseModel <bool>(); try { t_goods model = formVals.ToModel <t_goods>(); if (model.id != 0) { GoodsDAL.UpdateGoods(model); vmResult.BFlag = CommonResponseBFlag.Success; vmResult.TData = true; } else { //插入 model.status = 1; GoodsDAL.AddGoods(model); vmResult.BFlag = CommonResponseBFlag.Success; vmResult.TData = true; } } catch (Exception ex) { vmResult.BFlag = CommonResponseBFlag.SysError; vmResult.Msg = ex.Message; } return(Json(vmResult)); }
public int AddGoods(Goods goods) { return(gd.AddGoods(goods)); }
public int AddGoods(Goods n) { return(dal.AddGoods(n)); }