public void LoadEvaluationsAdvance(
            long idCall,
            EvaluationType type,
            Int32 idCommunity,
            long idCommission,
            dtoEvaluationsFilters filters,
            int pageIndex,
            int pageSize,
            CallForPaperType CpType)
        {
            Boolean allowManage = true;

            View.CurrentFilters = filters;

            ModuleCallForPaper module = Service.CallForPaperServicePermission(UserContext.CurrentUserID, idCommunity);

            allowManage = (module.CreateCallForPaper || module.Administration || module.ManageCallForPapers || module.EditCallForPaper);

            bool IsPresident = ServiceCall.CommissionUserIsPresident(idCommission, UserContext.CurrentUserID);
            bool IsSecretary = ServiceCall.CommissionUserIsSecretary(idCommission, UserContext.CurrentUserID);

            allowManage |= IsPresident | IsSecretary;

            //E controllo sui membri della commissione!

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

            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout();
            }
            else if (allowManage)
            {
                LoadItemsAdv(idCall,
                             type,
                             idCommunity,
                             idCommission,
                             filters,
                             pageIndex,
                             pageSize);
            }
            else
            {
                View.DisplayNoPermission(idCommunity, View.IdCallModule);
            }
        }
        public void LoadEvaluations(long idCall, EvaluationType EvalType, Int32 idCommunity, dtoEvaluationsFilters filters, int pageIndex, int pageSize)
        {
            Boolean allowManage = true;

            View.CurrentFilters = filters;

            ModuleCallForPaper module = Service.CallForPaperServicePermission(UserContext.CurrentUserID, idCommunity);

            allowManage = (module.CreateCallForPaper || module.Administration || module.ManageCallForPapers || module.EditCallForPaper);

            lm.Comol.Modules.CallForPapers.Domain.CallForPaperType type = ServiceCall.GetCallType(idCall);
            dtoCall call = (type == CallForPaperType.CallForBids) ? ServiceCall.GetDtoCall(idCall) : null;

            if (call.AdvacedEvaluation)
            {
                bool isPresident = ServiceCall.CommissionUserIsPresident(View.IdCallAdvCommission, UserContext.CurrentUserID);
                bool isSecretary = ServiceCall.CommissionUserIsSecretary(View.IdCallAdvCommission, UserContext.CurrentUserID);

                if (isPresident || isSecretary)
                {
                    allowManage = true;
                }
            }


            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout();
            }
            else if (allowManage)
            {
                LoadItems(idCall, EvalType, idCommunity, filters, pageIndex, pageSize);
            }

            else
            {
                View.DisplayNoPermission(idCommunity, View.IdCallModule);
            }
        }
예제 #3
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);

                    if (call.AdvacedEvaluation)
                    {
                        bool isPresident = ServiceCall.CommissionUserIsPresident(View.AdvCommissionId, idUser);
                        bool isSecretary = ServiceCall.CommissionUserIsSecretary(View.AdvCommissionId, idUser);

                        allowAdmin |= isPresident | isSecretary;
                    }


                    //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);
                        }
                    }
                }
            }
        }