// GET: Stores/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } try { var response = await StoresServices.GetStoreAsync((int)id); if (response.success) { return(View(response.store)); } else { ViewBag.ErrorMsg = "Ocurrió un error al tratar de obtener la tienda."; return(View("Error")); } } catch (Exception) { ViewBag.ErrorMsg = "Ocurrió un error al tratar de editar la tienda."; return(View("Error")); } }
// GET: Stores/Details/5 public async Task <ActionResult> Details(int id) { var response = await StoresServices.GetStoreAsync(id); if (response.success) { return(View(response.store)); } else { ViewBag.ErrorMsg = "Ocurrió un error al tratar de obtener la tienda."; return(View("Error")); } }
// GET: Stores/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var response = await StoresServices.GetStoreAsync((int)id); if (response.success) { return(View(response.store)); } else { return(View("Error")); } }