Example #1
0
        public IActionResult ConfirmRemovePlan(int id, [FromServices] ConfirmRemovePlanViewModel model)
        {
            model.Plan = _planService.Get(id);
            if (model.Plan == null)
            {
                return(RedirectToAction("List"));
            }

            return(View(model));
        }
Example #2
0
        public IActionResult RemovePlan([FromForm] ConfirmRemovePlanViewModel model)
        {
            try
            {
                _planService.Delete(model.PlanId);
            }
            catch
            {
                return(RedirectToAction("ConfirmRemovePlan", new { id = model.PlanId }));

                ;
            }
            return(RedirectToAction("List"));
        }