Exemplo n.º 1
0
 public ActionResult GetResumes()
 {
     try
     {
         var vm = new ResumeListVM(resumeService.GetAllForUser(User.Identity.Name));
         return(PartialView("~/Views/Resume/ResumeListPartial.cshtml", vm));
     }
     catch (Exception ex)
     {
         logger.Log(LogType.Error, "Get resumes failed", ex);
         var vm = new ResumeListVM();
         vm.Notification.Message = "Unable to retrieve your resumes.";
         vm.Notification.Type    = NotificationType.Error;
         return(PartialView("~/Views/Resume/ResumeListPartial.cshtml", vm));
     }
 }
Exemplo n.º 2
0
        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));
        }