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);
            }
        }
Ejemplo n.º 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);
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void LoadData(
            Int32 idCommunity,
            dtoBaseForPaper call,
            EvaluationType type,
            dtoSubmissionRevision submission)
        {
            List <dtoCommitteeEvaluationInfo> committees =
                call.AdvacedEvaluation ?
                ServiceCall.GetCommitteesInfoForSubmission(submission.Id, call.Id, View.AdvCommissionId) :
                Service.GetCommitteesInfoForSubmission(submission.Id, call.Id);

            if (call.AdvacedEvaluation)
            {
                //EvaluationType oldEvtype = ServiceCall.CommissionGetEvalType(View.AdvCommissionId);
                EvaluationType oldEvtype = EvaluationType.Average;

                Advanced.dto.dtoCommEvalInfo evinfo = ServiceCall.CommissionEvalTypeGet(View.AdvCommissionId);

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

                case Advanced.EvalType.Sum:
                    oldEvtype = EvaluationType.Sum;
                    break;
                }

                View.CurrentEvaluationType = oldEvtype;
            }
            else
            {
                View.CurrentEvaluationType = type;
            }


            View.CommitteesCount = committees.Count;
            String     owner       = (submission == null || (submission != null && (submission.IsAnonymous))) ? View.AnonymousDisplayName : ((submission.Owner != null) ? submission.Owner.SurnameAndName : View.UnknownDisplayname);
            litePerson submitter   = CurrentManager.GetLitePerson(submission.IdSubmittedBy);
            String     submittedBy = (submission.IdPerson == submission.IdSubmittedBy) ? "" : (submitter == null || submitter.TypeID == (int)UserTypeStandard.Guest) ? View.AnonymousDisplayName : submitter.SurnameAndName;

            View.SetViewEvaluationsUrl(RootObject.ViewSubmissionEvaluations(submission.Id, call.Id, idCommunity, View.AdvCommissionId));
            // View.SetViewSubmissionUrl(RootObject.ViewSubmissionAsManager(
            bool isPresident = false;

            if (call.AdvacedEvaluation)
            {
                isPresident = ServiceCall.CommissionUserIsPresident(View.AdvCommissionId, UserContext.CurrentUserID);
            }
            int minscore = (!call.AdvacedEvaluation) ? 0 :
                           (committees == null || !committees.Any()) ? 0 :
                           committees[0].MinValue;


            View.LoadSubmissionInfo(
                call.Name,
                owner,
                submission.SubmittedOn,
                submittedBy,
                committees,
                (committees == null || !committees.Any()) ? 0 : committees[0].IdCommittee,
                isPresident,
                minscore);

            if (type == EvaluationType.Dss)
            {
                InitializeDssInfo(call.Id);
            }
            LoadEvaluations(submission.Id, call.Id, type, View.IdCurrentCommittee, committees.Count);
        }