コード例 #1
0
        public void RemoveManagerRequest(long idRevision, dtoRevisionMessage managerMessage, String webSiteurl, dtoRevisionFilters filters, int pageIndex, int pageSize)
        {
            int idUser = UserContext.CurrentUserID;

            if (!UserContext.isAnonymous)
            {
                long idSubmission = Service.GetIdSubmissionFromRevision(idRevision);
                Service.RemoveManagerRequest(View.CallType, idSubmission, idRevision, idUser, View.PreloadIdCommunity, "", managerMessage, webSiteurl);
            }
            LoadRevisions(filters, pageIndex, pageSize);
        }
コード例 #2
0
        public void RemoveManagerRequest(long idSubmission, long idRevision, dtoRevisionMessage managerMessage, String webSiteurl)
        {
            int idUser = UserContext.CurrentUserID;

            if (!UserContext.isAnonymous)
            {
                if (ServiceCall.RemoveManagerRequest(View.CallType, idSubmission, idRevision, idUser, View.PreloadIdOtherCommunity, "", managerMessage, webSiteurl))
                {
                    View.IdPendingRevision = 0;
                }
            }
            LoadSubmission(View.IdSubmission, View.IdRevision, idUser);
        }
コード例 #3
0
        public void RequireRevision(long idSubmission, string reason, dtoRevisionMessage message, List <dtoRevisionItem> fieldsToReview, DateTime deadline, String webSiteurl, String baseFilePath, String baseThumbnailPath)
        {
            int idUser = UserContext.CurrentUserID;

            if (!UserContext.isAnonymous)
            {
                Revision rev = ServiceCall.RequireRevision(idSubmission, idUser, View.PreloadIdOtherCommunity, reason, message, fieldsToReview, deadline, webSiteurl, baseFilePath, baseThumbnailPath);
                if (rev != null)
                {
                    View.IdPendingRevision = rev.Id;
                }
            }
            LoadSubmission(View.IdSubmission, View.IdRevision, idUser);
        }
コード例 #4
0
        //
        public void AskForRevision(long idSubmission, string reason, dtoRevisionMessage message, String webSiteurl)
        {
            int idUser = UserContext.CurrentUserID;

            if (!UserContext.isAnonymous)
            {
                Revision rev = ServiceCall.AskForRevision(idSubmission, idUser, reason, webSiteurl, RootObject.ViewSubmission(View.CallType, View.IdCall, View.IdSubmission, false, CallStatusForSubmitters.Submitted, View.PreloadIdOtherCommunity, 0), message);
                if (rev != null)
                {
                    View.IdPendingRevision = rev.Id;
                }
            }
            LoadSubmission(View.IdSubmission, View.IdRevision, idUser);
        }
コード例 #5
0
        public void SaveCompleteRevision(List <dtoSubmissionValueField> fields, String baseFilePath, String translationFileName, String webSiteUrl, dtoRevisionMessage message)
        {
            Int32              containerIdCommunity = (View.PreloadIdOtherCommunity != -1) ? View.PreloadIdOtherCommunity : View.IdCallCommunity;
            long               idSubmission         = this.View.IdSubmission;
            long               idCall     = View.IdCall;
            long               idRevision = View.IdRevision;
            UserSubmission     submission = Service.GetUserSubmission(View.IdSubmission);
            dtoRevisionRequest rev        = Service.GetRevisionRequest(View.IdRevision, false);

            if (submission != null && rev != null && rev.AllowSubmission(View.InitSubmissionTime) && rev.AllowSave)
            {
                submission = SaveUserRevision(fields);
                if (submission != null && rev != null)
                {
                    idSubmission       = submission.Id;
                    View.TryToComplete = true;
                    try
                    {
                        Int32      idUser = UserContext.CurrentUserID;
                        litePerson person = GetCurrentUser(ref idUser);
                        if (submission.Owner.Id == idUser)
                        {
                            Service.CompleteSubmissionRevision(submission, idRevision, idUser, View.InitSubmissionTime, baseFilePath, fields, translationFileName, webSiteUrl, message);
                            View.AllowCompleteSubmission = false;
                            View.AllowDeleteSubmission   = false;
                            View.AllowSave = false;
                            View.SendUserAction(View.IdCallCommunity, View.IdCallModule, idRevision, ModuleCallForPaper.ActionType.ConfirmSubmission);
                            View.GoToUrl(RootObject.FinalMessage(View.CallType, idCall, idSubmission, idRevision, submission.UserCode, false, false, View.PreloadView, containerIdCommunity));
                        }
                        else if (UserContext.isAnonymous)
                        {
                            View.DisplayCallUnavailableForPublic();
                        }
                        else
                        {
                            View.DisplaySessionTimeout();
                        }
                    }
                    catch (SubmissionStatusChange ex)
                    {
                        //View.AllowDeleteSubmission = (submission != null && submission.Deleted == BaseStatusDeleted.None && submission.Status == SubmissionStatus.draft);
                        View.LoadError(RevisionErrorView.StringValueSaving);
                    }
                    catch (SubmissionItemsEmpty ex)
                    {
                        Dictionary <long, FieldError> errors = Service.GetSubmissionFieldErrors(submission, idRevision);
                        View.AllowDeleteSubmission = (submission != null && submission.Deleted == BaseStatusDeleted.None && submission.Status == SubmissionStatus.draft);

                        View.LoadError((errors.ToList().Where(er => er.Value != FieldError.Mandatory).Any()) ? RevisionErrorView.InvalidFields : RevisionErrorView.RequiredItems);
                        LoadSections(submission.Call, submission.Type.Id, idSubmission, View.IdRevision, errors);
                    }
                    catch (SubmissionTimeExpired ex)
                    {
                        View.LoadError(RevisionErrorView.TimeExpired);
                    }
                    //View.InitSubmissionTime = DateTime.Now;
                }
            }
            else if (rev != null)
            {
                View.GoToUrl(RootObject.ViewSubmission(View.CallType, View.IdCall, View.IdSubmission, View.IdRevision, View.PreloadedUniqueID, false, false, View.PreloadView, containerIdCommunity, 0));
            }
            else
            {
                View.GoToUrl(RootObject.ViewCalls(View.IdCall, View.CallType, CallStandardAction.List, containerIdCommunity, View.PreloadView));
            }
        }
コード例 #6
0
        public void SaveSettings(long idSubmission, long idRevision, DateTime deadline, List <dtoRevisionItem> fieldsToReview, dtoRevisionMessage userMessage, String webSiteurl)
        {
            int idUser = UserContext.CurrentUserID;

            if (!UserContext.isAnonymous)
            {
                RevisionErrorView result = Service.SaveRevisionSettings(View.CallType, View.IdCall, idSubmission, idRevision, idUser, deadline, fieldsToReview, userMessage, webSiteurl);
                if (result == RevisionErrorView.None)
                {
                    LoadSubmission(View.IdCall, View.IdSubmission, View.IdRevision);
                }
                else
                {
                    View.DisplayRevisionError(result);
                }
            }
            else
            {
                LoadSubmission(View.IdCall, View.IdSubmission, View.IdRevision);
            }
        }
コード例 #7
0
        public void RemoveManagerRequest(long idSubmission, long idRevision, string reason, dtoRevisionMessage managerMessage, String webSiteurl)
        {
            int idUser = UserContext.CurrentUserID;

            if (!UserContext.isAnonymous)
            {
                Service.RemoveManagerRequest(View.CallType, idSubmission, idRevision, idUser, View.PreloadIdCommunity, reason, managerMessage, webSiteurl);
            }
            LoadSubmission(View.IdCall, View.IdSubmission, View.IdRevision);
        }
コード例 #8
0
        public void AcceptUserRequest(long idSubmission, long idRevision, string reason, DateTime deadline, List <dtoRevisionItem> fieldsToReview, String baseFilePath, String baseThumbnailPath, dtoRevisionMessage message, String webSiteurl)
        {
            int idUser = UserContext.CurrentUserID;

            if (!UserContext.isAnonymous)
            {
                Service.AcceptUserRequest(idUser, idSubmission, idRevision, reason, message, fieldsToReview, deadline, webSiteurl, baseFilePath, baseThumbnailPath);
            }

            LoadSubmission(View.IdCall, View.IdSubmission, View.IdRevision);
        }