public async Task OnGet(string id, string confirm) { if (String.IsNullOrEmpty(id)) { if (SaleEntry == null) { SaleEntry = new SaleEntry() { SaleDate = DateTime.Now }; } } else { //var uri = _configuration.GetSection("SaleEsApi").GetSection("Uri").Value; SaleEntries = await GetAsJson <List <SaleEntry> >(UriEs + "SaleEntry/saleentry/" + id); SaleEntry = SaleEntries.FirstOrDefault(); if (!String.IsNullOrEmpty(confirm) && confirm == "ok") { ConfirmMessage = $"Update successful to id = {id}."; } } }
public async Task OnPostSearch(string id) { if (!String.IsNullOrEmpty(id)) { //var uri = _configuration.GetSection("SaleEsApi").GetSection("Uri").Value; SaleEntries = await GetAsJson <List <SaleEntry> >(UriEs + "SaleEntry/saleentry/" + id); SaleEntry = SaleEntries.FirstOrDefault(); } }