public IActionResult OnPostDelete(string id) { var criteria = new M.Criteria(id, string.Empty); var goodses = _goodsRepo.Get(criteria); if (goodses == null || goodses.Count == 0) { ModelState.AddModelError(string.Empty, "删除的数据无效!"); return(Page()); } var spec = new M.CreationSpec { Id = id, GoodsName = string.Empty, GoondsPrice = 0, Operate = "D" }; _goodsRepo.Operate(spec); return(RedirectToPage("/Goods/GoodsList")); }
public void OnGet() { var criteria = new M.Criteria(string.Empty, string.Empty); Goodses = _goodsRepo.Get(criteria).ToList(); }
public void OnPostSearch(string searchValue) { var criteria = new M.Criteria(string.Empty, searchValue); Goodses = _goodsRepo.Get(criteria).ToList(); }
public IReadOnlyList <M> Get(M.Criteria criteria) => OnFunction(x => criteria.ApplyTo(x.JaniceGoods_Raw).OrderBy(criteria.OrderByName).MapToReadOnlyList <M>());