public void InitData() { if (_provider.GetQuery().Count() == 0) { _provider.Add(_models); } }
public ActionResult Edit(StockModel model) { if (model.Id == 0) { _dataService.Add(model); return(JsonTips("success", "添加成功!")); } else { _dataService.Change(model); return(JsonTips("success", "修改成功!")); } }