public ActionResult Delete(int saleId) { if (!this.service.SaleExists(saleId)) { return(this.HttpNotFound("Interest not found.")); } this.ViewBag.SalesActive = "active"; DeleteSaleVm vm = this.service.GetDeleteVm(saleId); return(this.View(vm)); }
public ActionResult Delete(int id) { string userId = this.User.Identity.GetUserId(); if (!this.service.SaleExists(id)) { return(this.HttpNotFound("Interest not found.")); } bool isValid = this.service.IsUserAuthenticatedToEditCurrent(id, userId); if (isValid) { DeleteSaleVm vm = this.service.GetDeleteVm(id); return(this.View(vm)); } return(this.RedirectToAction("All")); }