public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } try { /* * 2 - Namespace in Datastore. It is used as TenantID in multi-tenant system here * PROD - Environment. Can be Production, Testing, Development or etc */ ItemMasterProxy iprox = new ItemMasterProxy("2", "PROD"); await iprox.UpdateAsync( Item.Id, Item.Code, Item.Description, Item.Brand, Item.Model, Item.BaseUOM, "*****@*****.**"); } catch (Exception ex) { throw new Exception(ex.Message); } return(RedirectToPage("/Item/Index")); }
public async Task OnGetAsync() { /* * 2 - Namespace in Datastore. It is used as TenantID in multi-tenant system here * PROD - Environment. Can be Production, Testing, Development or etc */ ItemMasterProxy iprox = new ItemMasterProxy("2", "PROD"); Items = await iprox.ListAsync(); }
public async Task <IActionResult> OnPostDeleteAsync(long id) { /* * 2 - Namespace in Datastore. It is used as TenantID in multi-tenant system here * PROD - Environment. Can be Production, Testing, Development or etc */ ItemMasterProxy iprox = new ItemMasterProxy("2", "PROD"); await iprox.DeleteAsync(id); return(RedirectToPage()); }
public async Task <ActionResult> OnGetAsync(long id) { /* * 2 - Namespace in Datastore. It is used as TenantID in multi-tenant system here * PROD - Environment. Can be Production, Testing, Development or etc */ ItemMasterProxy iprox = new ItemMasterProxy("2", "PROD"); Item = await iprox.DetailAsync(id); if (Item == null) { return(RedirectToPage("/Item/Index")); } return(Page()); }
static void Main(string[] args) { ItemMasterProxy iprox = new ItemMasterProxy("2", "PROD"); for (int i = 1; i < 50; i++) { var code = (1000 + i).ToString(); var desc = $"Item {code}"; var brand = "Avenger"; var model = $"Justice{i}"; var baseUOM = "UNIT"; var id = iprox.InsertAsync(code, desc, brand, model, baseUOM, "*****@*****.**").Result; Console.WriteLine($"{id}"); } foreach (var x in iprox.ListAsync().Result) { Console.WriteLine($"ID = {x.Id} Code = {x.Code} Name = {x.Description}"); } }