Exemplo n.º 1
0
        public IActionResult CreateReviewer(long submissionId)
        {
            var model = new CreateReviewRequestViewModel {
                SubmissionId = submissionId
            };

            if (Request.IsAjaxRequest())
            {
                return(PartialView(model));
            }
            return(View(model));
        }
Exemplo n.º 2
0
        public void AssignReviewer(CreateReviewRequestViewModel model, string journalpath)
        {
            var context = _serviceProvider.GetService <ApplicationDbContext>();

            if (!context.ReviewRequest.Any(x => x.SubmissionId == model.SubmissionId && x.ReviewerID == model.ReviewerId))
            {
                context.ReviewRequest.Add(new ReviewRequest
                {
                    CreatedDate   = DateTime.UtcNow,
                    DueDate       = model.DueDate,
                    EditorComment = model.EditorComment,
                    ReviewerID    = model.ReviewerId,
                    ReviewType    = model.ReviewType,
                    SubmissionId  = model.SubmissionId
                });
                _ = context.SaveChanges();
            }
        }
Exemplo n.º 3
0
 public IActionResult AssignReviewer(CreateReviewRequestViewModel model)
 {
     if (ModelState.IsValid)
     {
         HttpContext.RequestServices.GetService <IReviewService>().AssignReviewer(model, TenantID);
         var reviewer = HttpContext.RequestServices.GetService <IUserService>().GetUser(model.ReviewerId);
         HttpContext.RequestServices.GetService <ISubmissionService>().SaveSubmissionHistory(new SubmissionHistory
         {
             ActionDate   = DateTime.UtcNow,
             ActorEmail   = JMSUser.Email,
             ActorName    = $"{JMSUser.FirstName} {JMSUser.LastName}",
             SubmissionId = model.SubmissionId,
             TenanatID    = JMSUser.TenantId.Value,
             Action       = $"{reviewer.FirstName} {reviewer.LastName} has been assigned to the Submission Review Type: {model.ReviewType.ToString()} {(model.DueDate.HasValue ? $"with due date {model.DueDate.Value.ToString("dd MMM yyyy")}." : ".")}"
         });
         return(Ok());
     }
     return(BadRequest());
 }