Exemple #1
0
        public void InitView()
        {
            Boolean isAnonymousUser = UserContext.isAnonymous;
            long    idCall          = View.PreloadIdCall;
            Int32   idUser          = UserContext.CurrentUserID;

            lm.Comol.Modules.CallForPapers.Domain.CallForPaperType type = ServiceCall.GetCallType(idCall);
            int idModule = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

            dtoCall call = (type == CallForPaperType.CallForBids) ? ServiceCall.GetDtoCall(idCall) : null;

            if (call != null)
            {
                View.SetContainerName(call.Name, call.EndEvaluationOn);
            }


            if (call.AdvacedEvaluation)
            {
                View.RedirectToAdvance(call.Id);
            }


            int idCommunity = GetCurrentCommunity(call);

            View.IdCall          = idCall;
            View.IdCallModule    = idModule;
            View.IdCallCommunity = idCommunity;
            View.CallType        = type;

            ModuleCallForPaper module     = ServiceCall.CallForPaperServicePermission(idUser, idCommunity);
            Boolean            allowAdmin = ((module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser)));

            View.SetActionUrl((allowAdmin) ? CallStandardAction.Manage : CallStandardAction.List, RootObject.ViewCalls(idCall, type, ((allowAdmin) ? CallStandardAction.Manage : CallStandardAction.List), idCommunity, View.PreloadView));

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(RootObject.CommitteesSummary(idCall, idCommunity, View.PreloadView, View.PreloadIdSubmitterType, View.PreloadFilterBy, View.PreloadOrderBy, View.PreloadAscending, View.PreloadPageIndex, View.PreloadPageSize, View.GetItemEncoded(View.PreloadSearchForName)));
            }
            else if (call == null)
            {
                View.DisplayUnknownCall(idCommunity, idModule, idCall);
            }
            else if (type == CallForPaperType.RequestForMembership)
            {
                View.DisplayEvaluationUnavailable();
            }
            else if (allowAdmin)
            {
                View.CurrentEvaluationType = call.EvaluationType;
                if (call.EvaluationType == EvaluationType.Dss)
                {
                    View.CallUseFuzzy = Service.CallUseFuzzy(idCall);
                }
                View.AllowExportAll = Service.HasEvaluations(idCall);
                View.DisplayEvaluationInfo(call.EndEvaluationOn);
                InitializeView(idCall, call.EvaluationType, idCommunity, View.PreloadFilters);
            }
        }
Exemple #2
0
        public void InitView()
        {
            Boolean isAnonymousUser = UserContext.isAnonymous;
            long    idCall          = View.PreloadIdCall;
            long    idSubmission    = View.PreloadIdSubmission;
            Int32   idUser          = UserContext.CurrentUserID;

            lm.Comol.Modules.CallForPapers.Domain.CallForPaperType type = ServiceCall.GetCallType(idCall);
            int idModule = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

            dtoBaseForPaper call        = ServiceCall.GetDtoBaseCall(idCall);
            int             idCommunity = GetCurrentCommunity(call);

            View.IdCall          = idCall;
            View.IdCallModule    = idModule;
            View.IdCallCommunity = idCommunity;
            View.IdSubmission    = idSubmission;
            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(RootObject.ViewSubmissionTableEvaluations(idSubmission, idCall, idCommunity));
            }
            else
            {
                if (call == null)
                {
                    View.DisplayUnknownCall(idCommunity, idModule, idCall, type);
                }
                else if (type == CallForPaperType.RequestForMembership)
                {
                    View.DisplayEvaluationUnavailable();
                }
                else
                {
                    ModuleCallForPaper module         = ServiceCall.CallForPaperServicePermission(idUser, idCommunity);
                    Boolean            allowAdmin     = ((module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser)));
                    EvaluationType     evaluationType = ServiceCall.GetEvaluationType(idCall);
                    View.CurrentEvaluationType = evaluationType;
                    if (!allowAdmin)
                    {
                        View.DisplayNoPermissionToView();
                    }
                    else
                    {
                        dtoSubmissionRevision submission = ServiceCall.GetSubmissionWithRevisions(idSubmission, false);
                        if (submission == null)
                        {
                            View.DisplayUnknownSubmission(idCommunity, idModule, idSubmission, type);
                        }
                        else
                        {
                            LoadData(idCommunity, call, evaluationType, submission);
                        }
                    }
                }
            }
        }
        public void InitView()
        {
            Boolean          allowAdmin      = false;
            Boolean          isAnonymousUser = UserContext.isAnonymous;
            long             idCall          = View.PreloadIdCall;
            CallForPaperType type            = ServiceCall.GetCallType(idCall);
            long             idSubmission    = View.PreloadedIdSubmission;
            long             idRevision      = View.PreloadedIdRevision;
            Guid             uniqueId        = View.PreloadedUniqueID;

            dtoSubmissionRevision submission = ServiceCall.GetSubmissionWithRevisions(idSubmission, true);
            int idModule = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

            dtoBaseForPaper call        = ServiceCall.GetDtoBaseCall(idCall);
            int             idCommunity = SetCallCurrentCommunity(call);

            View.isAnonymousSubmission = true;
            View.IdCall          = idCall;
            View.IdCallModule    = idModule;
            View.IdCallCommunity = idCommunity;
            View.CallType        = type;
            View.IdSubmission    = idSubmission;
            if (idRevision == 0 && submission != null)
            {
                idRevision = submission.GetIdLastActiveRevision();
            }
            View.IdRevision = idRevision;
            if (submission == null || submission.Owner == null || (submission != null && submission.UniqueId != uniqueId))
            {
                View.DisplayUnknownSubmission(idCommunity, idModule, idSubmission, type);
            }
            else
            {
                if (idCall != submission.IdCall)
                {
                    idCall      = submission.IdCall;
                    call        = ServiceCall.GetDtoBaseCall(idCall);
                    idCommunity = SetCallCurrentCommunity(call);
                    type        = (call != null) ? call.Type : type;
                    idModule    = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

                    View.IdCall          = idCall;
                    View.IdCallModule    = idModule;
                    View.IdCallCommunity = idCommunity;
                    View.CallType        = type;
                }
                if (call == null)
                {
                    View.DisplayUnknownCall(idCommunity, idModule, idCall, type);
                    if (!isAnonymousUser)
                    {
                        View.SetActionUrl(CallStandardAction.List, RootObject.ViewCalls(type, CallStandardAction.List, idCommunity, View.PreloadView));
                    }
                }
                else if (isAnonymousUser && !submission.IsAnonymous)
                {
                    View.DisplaySessionTimeout();
                }
                else if (isAnonymousUser && !call.IsPublic)
                {
                    View.DisplayCallUnavailableForPublic();
                }
                else
                {
                    int        idUser     = UserContext.CurrentUserID;
                    litePerson currenUser = GetCurrentUser(ref idUser);
                    Boolean    allowView  = false;
                    View.CallRepository = call.GetRepositoryIdentifier();
                    switch (type)
                    {
                    case CallForPaperType.CallForBids:
                        ModuleCallForPaper module = ServiceCall.CallForPaperServicePermission(idUser, idCommunity);
                        allowView  = (submission.Owner.Id == idUser || module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser));
                        allowAdmin = (module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser));
                        break;

                    case CallForPaperType.RequestForMembership:
                        ModuleRequestForMembership moduleR = ServiceCall.RequestForMembershipServicePermission(idUser, idCommunity);
                        allowView  = (submission.Owner.Id == idUser || moduleR.ManageBaseForPapers || moduleR.Administration || ((moduleR.CreateBaseForPaper || moduleR.EditBaseForPaper) && call.Owner.Id == idUser));
                        allowAdmin = (moduleR.ManageBaseForPapers || moduleR.Administration || ((moduleR.CreateBaseForPaper || moduleR.EditBaseForPaper) && call.Owner.Id == idUser));
                        break;
                    }
                    View.InitializeView(ServiceCall.GetExternalContext(idCall));
                    CallStatusForSubmitters fromView = View.PreloadView;
                    if (fromView == CallStatusForSubmitters.None)
                    {
                        fromView = (allowAdmin) ? CallStatusForSubmitters.SubmissionClosed : CallStatusForSubmitters.Submitted;
                    }

                    if (allowView)
                    {
                        if (!isAnonymousUser)
                        {
                            View.SetActionUrl(CallStandardAction.List, RootObject.ViewCalls(type, CallStandardAction.List, idCommunity, fromView));
                        }
                        else if (View.FromPublicList)
                        {
                            View.SetActionUrl(CallStandardAction.List, RootObject.PublicCollectorCalls(type, idCall, idCommunity));
                        }
                    }
                    if (submission.Deleted != BaseStatusDeleted.None && !allowAdmin)
                    {
                        View.DisplaySubmissionUnavailable();
                    }
                    else if (allowAdmin || allowView || (isAnonymousUser && submission.IsAnonymous && submission.UniqueId == View.PreloadedUniqueID))
                    {
                        LoadSubmission(call, submission, idUser, allowAdmin);
                    }
                    else
                    {
                        View.DisplayNoPermission(idCommunity, idModule);
                    }
                }
            }
        }
Exemple #4
0
        public void InitView()
        {
            Boolean isAnonymousUser = UserContext.isAnonymous;
            long    idCall          = View.PreloadIdCall;
            Int32   idUser          = UserContext.CurrentUserID;

            lm.Comol.Modules.CallForPapers.Domain.CallForPaperType type = ServiceCall.GetCallType(idCall);
            int idModule = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

            dtoCall call = (type == CallForPaperType.CallForBids) ? ServiceCall.GetDtoCall(idCall) : null;

            if (call != null)
            {
                View.SetContainerName(call.Name, call.EndEvaluationOn);
            }
            int idCommunity = GetCurrentCommunity(call);

            View.IdCall          = idCall;
            View.IdCallModule    = idModule;
            View.IdCallCommunity = idCommunity;
            View.CallType        = type;

            if (call != null && call.AdvacedEvaluation)
            {
                //Advanced.dto.dtoCommEvalInfo evInfo = ServiceCall.CommissionEvalTypeGet(View.IdAdvCommittee);

                //if (evInfo.Type == Advanced.EvalType.Average)
                //    View.CurrentEvaluationType = EvaluationType.Average;
                //else
                //    View.CurrentEvaluationType = EvaluationType.Sum;


                //Il TIPO di valutazione IMPOSTATO ha impatto SOLO nell'aggregazione tra COMMISSARI.
                //Nell'aggregazione tra i criteri di un VALUTATORE, uso SEMPRE E SOLO LA SOMMA!

                // View.CurrentEvaluationType = EvaluationType.Sum;
                //Sposto a DOPO , dove ho l'AdvCommission!
            }
            else
            {
                View.CurrentEvaluationType = (call != null ? call.EvaluationType : EvaluationType.Sum);
            }



            dtoEvaluationsFilters filters = View.PreloadFilters;
            ModuleCallForPaper    module  = ServiceCall.CallForPaperServicePermission(idUser, idCommunity);

            Boolean allowEvaluate = false;
            Boolean allowAdmin    = ((module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser)));

            View.SetActionUrl(
                (allowAdmin) ? CallStandardAction.Manage : CallStandardAction.List,
                RootObject.ViewCalls(idCall,
                                     type,
                                     ((allowAdmin) ? CallStandardAction.Manage : CallStandardAction.List),
                                     idCommunity,
                                     View.PreloadView),
                call.AdvacedEvaluation,
                RootObject.AdvCommissionEdit(idCall, View.IdAdvCommittee, Advanced.CommiteeEditPage.Members));

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(RootObject.ViewSubmissionsToEvaluate(CallForPaperType.CallForBids, idCall, idCommunity, View.PreloadView, View.PreloadOrderBy, View.PreloadAscending, filters.IdSubmitterType, filters.Status, View.GetItemEncoded(filters.SearchForName)));
            }
            if (call == null)
            {
                View.DisplayUnknownCall(idCommunity, idModule, idCall, type);
            }
            else if (type == CallForPaperType.RequestForMembership)
            {
                View.DisplayEvaluationUnavailable();
            }
            else
            {
                if (call.AdvacedEvaluation)
                {
                    Advanced.EvaluationAdvPermission advPermission = ServiceCall.EvaluationAdvPermission(idCall, View.IdAdvCommittee);

                    allowEvaluate = ((advPermission & Advanced.EvaluationAdvPermission.Evaluate) == Advanced.EvaluationAdvPermission.Evaluate);
                    bool allowView = ((advPermission & Advanced.EvaluationAdvPermission.View) == Advanced.EvaluationAdvPermission.View);

                    if (allowEvaluate | allowView)
                    {
                        View.AllowEvaluate = allowEvaluate; // (allowEvaluate && (!call.EndEvaluationOn.HasValue || call.EndEvaluationOn.Value >= DateTime.Now));
                        View.DisplayEvaluationInfo(call.EndEvaluationOn);
                        long idMember = ServiceCall.MemberIdGet(View.IdAdvCommittee);
                        InitalizeViewAdv(idCall, idCommunity, View.IdAdvCommittee, idMember, filters);
                    }
                    else
                    {
                    }
                }
                else
                {
                    long    idEvaluator = Service.GetIdEvaluator(idCall, UserContext.CurrentUserID);
                    Boolean isEvaluator = (idEvaluator > 0); //Service.isEvaluator(idCall, UserContext.CurrentUserID);
                    allowEvaluate    = isEvaluator;          //(isEvaluator || module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser));
                    View.IdEvaluator = idEvaluator;
                    if (!allowEvaluate)
                    {
                        View.DisplayEvaluationUnavailable();
                    }
                    else if (!isEvaluator)
                    {
                        View.DisplayNotEvaluationPermission();
                    }
                    else
                    {
                        View.AllowEvaluate = (allowEvaluate && (!call.EndEvaluationOn.HasValue || call.EndEvaluationOn.Value >= DateTime.Now));
                        View.DisplayEvaluationInfo(call.EndEvaluationOn);
                        InitalizeView(idCall, idCommunity, View.PreloadIdCommittee, idEvaluator, filters);
                    }
                }
            }
        }
Exemple #5
0
        public void InitView(Boolean forPublicCall)
        {
            Boolean          allowAdmin      = false;
            Boolean          isAnonymousUser = UserContext.isAnonymous;
            long             idCall          = View.PreloadIdCall;
            CallForPaperType type            = ServiceCall.GetCallType(idCall);
            long             idSubmission    = View.PreloadedIdSubmission;
            long             idRevision      = View.PreloadedIdRevision;
            Guid             uniqueId        = View.PreloadedUniqueID;


            View.IsAdvance = ServiceCall.CallIsAdvanced(idCall);


            dtoSubmissionRevision submission = ServiceCall.GetSubmissionWithRevisions(idSubmission, true);
            int idModule = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

            dtoBaseForPaper call        = ServiceCall.GetDtoBaseCall(idCall);
            int             idCommunity = SetCallCurrentCommunity(call);

            View.isAnonymousSubmission = forPublicCall;
            View.IdCall          = idCall;
            View.IdCallModule    = idModule;
            View.IdCallCommunity = idCommunity;
            View.CallType        = type;
            View.IdSubmission    = idSubmission;
            if (idRevision == 0 && submission != null)
            {
                idRevision = submission.GetIdLastActiveRevision();
            }
            View.IdRevision = idRevision;
            if (submission == null || submission.Owner == null)
            {
                View.DisplayUnknownSubmission(idCommunity, idModule, idSubmission, type);
            }
            else
            {
                if (idCall != submission.IdCall)
                {
                    idCall      = submission.IdCall;
                    call        = ServiceCall.GetDtoBaseCall(idCall);
                    idCommunity = SetCallCurrentCommunity(call);
                    type        = (call != null) ? call.Type : type;
                    idModule    = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

                    View.IdCall          = idCall;
                    View.IdCallModule    = idModule;
                    View.IdCallCommunity = idCommunity;
                    View.CallType        = type;
                }
                if (call == null)
                {
                    View.DisplayUnknownCall(idCommunity, idModule, idCall, type);
                    if (!isAnonymousUser)
                    {
                        View.SetActionUrl(CallStandardAction.List, RootObject.ViewCalls(type, CallStandardAction.List, View.PreloadIdOtherCommunity, View.PreloadView));
                    }
                }
                else if (isAnonymousUser && !forPublicCall)
                {
                    if (call.IsPublic && submission.IsAnonymous)
                    {
                        View.GoToUrl(RootObject.ViewSubmission(type, idCall, idSubmission, idRevision, uniqueId, true, false, View.PreloadView, View.PreloadIdOtherCommunity, 0));
                    }
                    else
                    {
                        View.DisplaySessionTimeout();
                    }
                }
                else if (isAnonymousUser && forPublicCall && !call.IsPublic)
                {
                    View.DisplayCallUnavailableForPublic();
                }
                else
                {
                    int        idUser     = UserContext.CurrentUserID;
                    litePerson currenUser = GetCurrentUser(ref idUser);
                    Boolean    allowView  = false;
                    View.CallRepository = call.GetRepositoryIdentifier();
                    switch (type)
                    {
                    case CallForPaperType.CallForBids:
                        ModuleCallForPaper module = ServiceCall.CallForPaperServicePermission(idUser, idCommunity);
                        allowView  = (submission.Owner.Id == idUser || module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser));
                        allowAdmin = (View.PreloadFromManagement && (module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser)));
                        break;

                    case CallForPaperType.RequestForMembership:
                        ModuleRequestForMembership moduleR = ServiceCall.RequestForMembershipServicePermission(idUser, idCommunity);
                        allowView  = (submission.Owner.Id == idUser || moduleR.ManageBaseForPapers || moduleR.Administration || ((moduleR.CreateBaseForPaper || moduleR.EditBaseForPaper) && call.Owner.Id == idUser));
                        allowAdmin = (View.PreloadFromManagement && (moduleR.ManageBaseForPapers || moduleR.Administration || ((moduleR.CreateBaseForPaper || moduleR.EditBaseForPaper) && call.Owner.Id == idUser)));
                        break;
                    }

                    if (View.IsAdvance)
                    {
                        Advanced.SubmissionListPermission permission = ServiceCall.SubmissionCanList(idCall);

                        if ((permission & Advanced.SubmissionListPermission.View) == Advanced.SubmissionListPermission.View)
                        {
                            allowView = true;
                        }

                        if ((permission & Advanced.SubmissionListPermission.Manage) == Advanced.SubmissionListPermission.Manage)
                        {
                            allowAdmin = true;
                        }
                    }


                    View.ShowAdministrationTools = allowAdmin;
                    CallStatusForSubmitters fromView = View.PreloadView;
                    if (fromView == CallStatusForSubmitters.None)
                    {
                        fromView = (allowAdmin) ? CallStatusForSubmitters.SubmissionClosed : CallStatusForSubmitters.Submitted;
                    }

                    if (!allowAdmin && allowView)
                    {
                        View.SetActionUrl(CallStandardAction.List, RootObject.ViewCalls(type, CallStandardAction.List, View.PreloadIdOtherCommunity, fromView));
                    }
                    else if (allowAdmin)
                    {
                        View.SetActionUrl(CallStandardAction.Manage, RootObject.ViewSubmissions(type, idCall, idSubmission, idRevision, fromView, View.PreloadFilterSubmission, View.PreloadOrderSubmission, View.PreloadAscending, View.PreloadPageIndex, View.PreloadPageSize));
                    }

                    if (submission.Deleted != BaseStatusDeleted.None && !allowAdmin)
                    {
                        View.DisplaySubmissionUnavailable();
                    }
                    else if (allowAdmin || allowView || (isAnonymousUser && submission.IsAnonymous && submission.UniqueId == View.PreloadedUniqueID))
                    {
                        LoadSubmission(call, submission, idUser, allowAdmin);
                    }
                    else
                    {
                        View.DisplayNoPermission(idCommunity, idModule);
                    }
                }
            }

            bool ShowSendIntegration = false;

            if (call.AdvacedEvaluation)
            {
                ShowSendIntegration = ServiceCall.ShowSendIntegration(idSubmission, View.CommissionId);
            }

            View.ShowHideSendIntegration(ShowSendIntegration);

            if (View.IsAdvance)
            {
                if (!ServiceCall.SignSubmissionIsNotExpired(idSubmission, idRevision, DateTime.Now, DateTime.Now))
                {
                    bool ShowMessage = (submission.Status == SubmissionStatus.waitforsignature);
                    View.DisplayOutOfTime("Expired", ShowMessage, false);
                }
            }
        }
        public void InitView()
        {
            Boolean isAnonymousUser = UserContext.isAnonymous;
            long    idCall          = View.PreloadIdCall;
            Int32   idUser          = UserContext.CurrentUserID;

            lm.Comol.Modules.CallForPapers.Domain.CallForPaperType type = ServiceCall.GetCallType(idCall);
            int idModule = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

            dtoCall call = (type == CallForPaperType.CallForBids) ? ServiceCall.GetDtoCall(idCall) : null;

            if (call != null)
            {
                View.SetContainerName(call.Name, call.EndEvaluationOn);
            }

            int idCommunity = GetCurrentCommunity(call);

            View.IdCall          = idCall;
            View.IdCallModule    = idModule;
            View.IdCallCommunity = idCommunity;
            View.CallType        = type;

            ModuleCallForPaper module     = ServiceCall.CallForPaperServicePermission(idUser, idCommunity);
            Boolean            allowAdmin = ((module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser)));

            View.SetActionUrl((allowAdmin) ? CallStandardAction.Manage : CallStandardAction.List, RootObject.ViewCalls(idCall, type, ((allowAdmin) ? CallStandardAction.Manage : CallStandardAction.List), idCommunity, View.PreloadView));

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(RootObject.EvaluationsSummary(idCall, idCommunity, View.PreloadView, 0, View.PreloadIdSubmitterType, View.PreloadFilterBy, View.PreloadOrderBy, View.PreloadAscending, View.PreloadPageIndex, View.PreloadPageSize, View.GetItemEncoded(View.PreloadSearchForName)));
            }
            else if (call == null)
            {
                View.DisplayUnknownCall(idCommunity, idModule, idCall);
            }
            else if (type == CallForPaperType.RequestForMembership)
            {
                View.DisplayEvaluationUnavailable();
            }
            else if (allowAdmin)
            {
                //
                //EvaluationType EvalType = (call.AdvacedEvaluation) ?
                //    ServiceCall.CommissionGetEvalType(idCommission):
                //    call.EvaluationType;

                //EvaluationType EvalType = call.EvaluationType;
                //call.EvaluationType;

                if (call.EvaluationType == EvaluationType.Dss)
                {
                    View.CallUseFuzzy = Service.CallUseFuzzy(idCall);
                }
                View.AllowExportAll = Service.HasEvaluations(idCall);
                View.DisplayEvaluationInfo(call.EndEvaluationOn);

                if (!call.AdvacedEvaluation)
                {
                    View.CurrentEvaluationType = call.EvaluationType;
                    InitializeView(idCall, call.EvaluationType, idCommunity, View.PreloadFilters);
                    View.SetStepSummaryLink(0, 0, false);
                }
            }

            if (call.AdvacedEvaluation)
            {
                long idCommission = View.IdCallAdvCommission;
                long StepId       = ServiceCall.StepGetIdFromComm(idCommission);


                bool ShowGenericLink = ServiceCall.CommissionUserIsPresidentOrSegretaryInMaster(idCommission, UserContext.CurrentUserID);


                View.SetStepSummaryLink(StepId, idCommission, ShowGenericLink);

                EvaluationType oldEvtype = EvaluationType.Average;

                Advanced.dto.dtoCommEvalInfo evinfo = ServiceCall.CommissionEvalTypeGet(idCommission);

                switch (evinfo.Type)
                {
                case Advanced.EvalType.Average:
                    oldEvtype = EvaluationType.Average;
                    break;

                case Advanced.EvalType.Sum:
                    oldEvtype = EvaluationType.Sum;
                    break;
                }
                View.CurrentEvaluationType = (evinfo.Type == Advanced.EvalType.Sum) ? EvaluationType.Sum : EvaluationType.Average;
                View.minRange = evinfo.minRange;
                View.LockBool = evinfo.LockBool;


                bool cancloseAdvance = ServiceCall.CommissionCanClose(idCommission);

                View.ShowCloseCommission(cancloseAdvance);


                InitializeViewAvance(idCall,
                                     oldEvtype,
                                     idCommunity,
                                     idCommission,
                                     View.PreloadFilters,
                                     call.Type);
            }
        }
        public void InitView()
        {
            Boolean isAnonymousUser = UserContext.isAnonymous;
            long    idCall          = View.PreloadIdCall;
            Int32   idUser          = UserContext.CurrentUserID;

            lm.Comol.Modules.CallForPapers.Domain.CallForPaperType type = ServiceCall.GetCallType(idCall);
            int idModule = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

            dtoCall call = (type == CallForPaperType.CallForBids) ? ServiceCall.GetDtoCall(idCall) : null;

            if (call != null)
            {
                View.SetContainerName(call.Name, call.EndEvaluationOn);
            }
            int idCommunity = GetCurrentCommunity(call);

            View.IdCall                = idCall;
            View.IdCallModule          = idModule;
            View.IdCallCommunity       = idCommunity;
            View.CallType              = type;
            View.CurrentEvaluationType = (call != null ? call.EvaluationType : EvaluationType.Sum);
            dtoEvaluationsFilters filters = View.PreloadFilters;
            ModuleCallForPaper    module  = ServiceCall.CallForPaperServicePermission(idUser, idCommunity);

            Boolean allowEvaluate = false;
            Boolean allowAdmin    = ((module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser)));

            View.SetActionUrl((allowAdmin) ? CallStandardAction.Manage : CallStandardAction.List, RootObject.ViewCalls(idCall, type, ((allowAdmin) ? CallStandardAction.Manage : CallStandardAction.List), idCommunity, View.PreloadView));

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(RootObject.ViewSubmissionsToEvaluate(CallForPaperType.CallForBids, idCall, idCommunity, View.PreloadView, View.PreloadOrderBy, View.PreloadAscending, filters.IdSubmitterType, filters.Status, View.GetItemEncoded(filters.SearchForName)));
            }
            if (call == null)
            {
                View.DisplayUnknownCall(idCommunity, idModule, idCall, type);
            }
            else if (type == CallForPaperType.RequestForMembership)
            {
                View.DisplayEvaluationUnavailable();
            }
            else
            {
                long    idEvaluator = Service.GetIdEvaluator(idCall, UserContext.CurrentUserID);
                Boolean isEvaluator = (idEvaluator > 0); //Service.isEvaluator(idCall, UserContext.CurrentUserID);
                allowEvaluate    = isEvaluator;          //(isEvaluator || module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser));
                View.IdEvaluator = idEvaluator;
                if (!allowEvaluate)
                {
                    View.DisplayEvaluationUnavailable();
                }
                else if (!isEvaluator)
                {
                    View.DisplayNotEvaluationPermission();
                }
                else
                {
                    View.AllowEvaluate = (allowEvaluate && (!call.EndEvaluationOn.HasValue || call.EndEvaluationOn.Value >= DateTime.Now));
                    View.DisplayEvaluationInfo(call.EndEvaluationOn);
                    InitalizeView(idCall, idCommunity, View.PreloadIdCommittee, idEvaluator, filters);
                }
            }
        }
Exemple #8
0
        public void InitView(Boolean forPublicCall)
        {
            Boolean isAnonymousUser = UserContext.isAnonymous;
            long    idCall          = View.PreloadIdCall;
            long    idEvaluation    = View.PreloadedIdEvaluation;
            Int32   idUser          = UserContext.CurrentUserID;

            lm.Comol.Modules.CallForPapers.Domain.CallForPaperType type = ServiceCall.GetCallType(idCall);
            int idModule = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

            dtoBaseForPaper call        = ServiceCall.GetDtoBaseCall(idCall);
            int             idCommunity = GetCurrentCommunity(call);


            View.IdCall          = idCall;
            View.IdCallModule    = idModule;
            View.IdCallCommunity = idCommunity;
            View.IdEvaluation    = idEvaluation;
            View.CallType        = type;



            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout(RootObject.EvaluateSubmission(idCall, View.PreloadIdCommunity, View.PreloadedIdEvaluation));
            }
            if (call == null)
            {
                View.DisplayUnknownCall(idCommunity, idModule, idCall, type);
            }
            else if (type == CallForPaperType.RequestForMembership)
            {
                View.DisplayEvaluationUnavailable();
            }
            else
            {
                bool canEvaluate = true;
                //Evantualmente aggiungere i tag anche sulle vecchie commissioni...
                string tags = (call.AdvacedEvaluation) ?
                              ServiceCall.TagGetForEvaluation(idEvaluation, idCall, ref canEvaluate) :
                              call.Tags;

                if (call.AdvacedEvaluation && !canEvaluate)
                {
                    View.DisplayEvaluationUnavailable();
                }

                View.BindTag(tags);

                ModuleCallForPaper module        = ServiceCall.CallForPaperServicePermission(idUser, idCommunity);
                Boolean            allowEvaluate = false;
                Boolean            allowAdmin    = ((module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser)));

                Boolean isEvaluator =
                    (call.AdvacedEvaluation) ?
                    ServiceCall.isEvaluationOwner(idEvaluation, UserContext.CurrentUserID) :
                    Service.isEvaluationOwner(idEvaluation, UserContext.CurrentUserID);

                allowEvaluate = isEvaluator; //(isEvaluator || module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && call.Owner.Id == idUser));

                if (!allowEvaluate)
                {
                    View.DisplayEvaluationUnavailable();
                }
                else
                {
                    lm.Comol.Modules.CallForPapers.Domain.Evaluation.dtoEvaluation evaluation =
                        (call.AdvacedEvaluation) ?
                        ServiceCall.GetFullEvaluation(idEvaluation, View.AnonymousOwnerName, View.UnknownDisplayname):
                        Service.GetFullEvaluation(idEvaluation, View.AnonymousOwnerName, View.UnknownDisplayname);
                    if (evaluation == null)
                    {
                        View.DisplayUnknownEvaluation(idCommunity, idModule, idEvaluation);
                    }
                    else
                    {
                        View.IdEvaluator = evaluation.IdEvaluator;
                        dtoSubmissionRevision submission = ServiceCall.GetSubmissionWithRevisions(evaluation.IdSubmission, true);
                        if (submission == null)
                        {
                            View.DisplayUnknownSubmission(idCommunity, idModule, evaluation.IdSubmission, type);
                        }
                        else
                        {
                            LoadData(idCall, evaluation, submission);
                        }
                    }
                }
            }
        }
Exemple #9
0
        public void InitView()
        {
            Boolean isAnonymousUser = UserContext.isAnonymous;
            long    idCall          = View.PreloadIdCall;
            long    idEvaluation    = View.PreloadIdEvaluation;
            long    idSubmission    = View.PreloadIdSubmission;
            long    idEvaluator     = View.PreloadIdEvaluator;
            Int32   idUser          = UserContext.CurrentUserID;

            lm.Comol.Modules.CallForPapers.Domain.CallForPaperType type = ServiceCall.GetCallType(idCall);
            int idModule = (type == CallForPaperType.CallForBids) ? ServiceCall.ServiceModuleID() : ServiceRequest.ServiceModuleID();

            dtoBaseForPaper baseCall    = ServiceCall.GetDtoBaseCall(idCall);
            int             idCommunity = GetCurrentCommunity(baseCall);


            View.IdCall          = idCall;
            View.IdCallModule    = idModule;
            View.IdCallCommunity = idCommunity;
            View.IdEvaluation    = idEvaluation;
            View.IdSubmission    = idSubmission;
            View.IdEvaluator     = idEvaluator;
            View.CallType        = type;
            DisplayEvaluations dEvaluation = DisplayEvaluations.None;

            if (idEvaluation > 0)
            {
                dEvaluation = DisplayEvaluations.Single;
            }
            else if (idEvaluator > 0)
            {
                dEvaluation = DisplayEvaluations.ForUser;
            }
            else if (idSubmission > 0)
            {
                dEvaluation = DisplayEvaluations.ForSubmission;
            }

            if (UserContext.isAnonymous)
            {
                switch (dEvaluation)
                {
                case DisplayEvaluations.Single:
                    View.DisplaySessionTimeout(RootObject.ViewSingleEvaluation(idEvaluation, idSubmission, idCall, idCommunity, View.AdvCommId));
                    break;

                case DisplayEvaluations.ForUser:
                    View.DisplaySessionTimeout(RootObject.ViewUserEvaluations(idEvaluator, idSubmission, idCall, idCommunity, View.AdvCommId));
                    break;

                default:
                    View.DisplaySessionTimeout(RootObject.ViewSubmissionEvaluations(idSubmission, idCall, idCommunity, View.AdvCommId));
                    break;
                }
            }
            else
            {
                if (baseCall == null)
                {
                    View.DisplayUnknownCall(idCommunity, idModule, idCall, type);
                }
                else if (type == CallForPaperType.RequestForMembership)
                {
                    View.DisplayEvaluationUnavailable();
                }
                else if (dEvaluation == DisplayEvaluations.None)
                {
                    View.DisplayNoEvaluationsToView();
                }
                else
                {
                    ModuleCallForPaper module     = ServiceCall.CallForPaperServicePermission(idUser, idCommunity);
                    Boolean            allowAdmin = ((module.ManageCallForPapers || module.Administration || ((module.CreateCallForPaper || module.EditCallForPaper) && baseCall.Owner.Id == idUser)));

                    if (!allowAdmin && !Service.isEvaluationOwner(idEvaluator, idEvaluation, idSubmission, dEvaluation, UserContext.CurrentUserID))
                    {
                        View.DisplayNoPermissionToView();
                    }
                    else
                    {
                        dtoSubmissionRevision submission = ServiceCall.GetSubmissionWithRevisions(idSubmission, false);
                        if (submission == null)
                        {
                            View.DisplayUnknownSubmission(idCommunity, idModule, idSubmission, type);
                        }
                        else
                        {
                            dtoCall call = ServiceCall.GetDtoCall(idCall);
                            if (call != null)
                            {
                                View.CurrentEvaluationType = call.EvaluationType;
                                if (call.EvaluationType == EvaluationType.Dss)
                                {
                                    InitializeDssInfo(idCall);
                                }
                                else
                                {
                                    View.HideDssWarning();
                                }
                                LoadData(dEvaluation, idCommunity, call, submission, idEvaluation, idEvaluator);
                            }
                            else
                            {
                                View.DisplayUnknownCall(idCommunity, idModule, idCall, type);
                            }
                        }
                    }
                }
            }
        }