Пример #1
0
        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));
        }
Пример #2
0
        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"));
        }