Example #1
0
 private void SetRole(ApplicationUser currentuser, PulledDocumentsViewModel model)
 {
     if (currentuser.Roles.Select(x => x.Role.Name).ToList().Contains(Role.PullAuthorisation))
     {
         model.CanAuthorisePullList = true;
     }
 }
Example #2
0
        public ActionResult GetPulls(Int32 jobId)
        {
            var currentUser = this.userService.GetApplicationUser();
            var pulls       = this.packStoreService.GetPulledPacks(jobId);

            var model = new PulledDocumentsViewModel();

            model.AddPulls(pulls);

            this.SetRole(currentUser, model);

            return(this.PartialView("_PulledDocuments", model));
        }
Example #3
0
        public ActionResult RemovePull(String clientRef, Int32 jobId)
        {
            var currentUser = this.userService.GetApplicationUser();

            this.packStoreService.UpdatePullStatus(clientRef, false);

            var pulls = this.packStoreService.GetPulledPacks(jobId);

            var model = new PulledDocumentsViewModel();

            model.AddPulls(pulls);

            this.SetRole(currentUser, model);

            return(this.PartialView("_PulledDocuments", model));
        }