Beispiel #1
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);
        }
        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);
            }
        }