private void LoadItems(long idCall, EvaluationType type, Int32 idCommunity, dtoEvaluationsFilters filters, int pageIndex, int pageSize)
        {
            if (type == EvaluationType.Dss)
            {
                InitializeDssInfo(idCall);
            }
            else
            {
                View.HideDssWarning();
            }

            bool isAdvance = ServiceCall.CallIsAdvanced(idCall);

            List <dtoEvaluationSummaryItem> items =
                isAdvance ?
                ServiceCall.GetEvaluationsList(idCall, View.IdCallAdvCommission, type, filters, View.AnonymousDisplayname, View.UnknownDisplayname) :
                Service.GetEvaluationsList(idCall, type, filters, View.AnonymousDisplayname, View.UnknownDisplayname, true);



            PagerBase pager = new PagerBase();

            pager.PageSize = pageSize;

            if (pageSize == 0)
            {
                pageSize = 50;
            }
            pager.Count     = (int)items.Count - 1;
            pager.PageIndex = pageIndex;// Me.View.CurrentPageIndex
            View.Pager      = pager;

            View.CurrentOrderBy   = filters.OrderBy;
            View.CurrentFilterBy  = filters.Status;
            View.CurrentAscending = filters.Ascending;
            View.PageSize         = pageSize;

            View.AllowExportCurrent = (items != null && items.Any() && items.Skip(pageIndex * pageSize).Take(pageSize).Any());
            if (pager.Count < 0)
            {
                View.DisplayNoEvaluationsFound();
            }
            else
            {
                List <long> committees = Service.GetIdCommittees(idCall);
                if (committees.Count == 1)
                {
                    View.DisplayLinkToSingleCommittee(committees.FirstOrDefault());
                }
                View.LoadEvaluations(items.Skip(pageIndex * pageSize).Take(pageSize).ToList(), committees.Count);
            }
            View.SendUserAction(View.IdCallCommunity, View.IdCallModule, ModuleCallForPaper.ActionType.ViewEvaluationsSummary);


            if (isAdvance)
            {
                bool cancloseAdvance = ServiceCall.CommissionCanClose(View.IdCallAdvCommission);
                View.ShowCloseCommission(cancloseAdvance);
            }
        }
        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);
            }
        }