Exemple #1
0
 public ActionResult Delete(int id, ResumeViewModel viewModel)
 {
     try
     {
         resumeService.DeleteResume(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         ModelState.AddModelError("", "An error has occured. This Employee was not deleted.");
     }
     return(View(viewModel));
 }
        public ActionResult Delete(int id)
        {
            var notif = new NotificationVM();

            try
            {
                var res = resumeService.DeleteResume(User.Identity.Name, id);
                notif.Message = "Success";
                notif.Type    = NotificationType.Success;
            }
            catch (Exception ex)
            {
                logger.Log(LogType.Error, "Resume delete failed.", ex);
                notif.Message = "Failed to delete";
                notif.Type    = NotificationType.Error;
            }

            var vm = new ResumeListVM(resumeService.GetAllForUser(User.Identity.Name));

            vm.Notification = notif;
            return(PartialView("~/Views/Resume/ResumeListPartial.cshtml", vm));
        }