public async Task <IActionResult> DeleteConfirmed(int id) { await _receipt.DeleteReceipt(id); await _receipt.SaveReceipt(); return(RedirectToAction(nameof(Index))); }
public ActionResult DeleteReceipt(Guid id, string callback) { if (id == Guid.Empty) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "No id specified")); } try { _receiptRepository.DeleteReceipt(id); return(Jsonp("Success", callback, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, ex.Message)); } }
public async Task <ActionResult> DeleteReceipt(int id) { await _receipt.DeleteReceipt(id); return(Ok(await _receipt.SaveReceipt())); }