//private int SetCallCurrentCommunity(dtoBaseForPaper call) //{ // int idCommunity = 0; // Community currentCommunity = CurrentManager.GetCommunity(this.UserContext.CurrentCommunityID); // Community community = null; // if (call != null) // idCommunity = (call.IsPortal) ? 0 : (call.Community != null) ? call.Community.Id : 0; // community = CurrentManager.GetCommunity(idCommunity); // if (community != null){} // // View.SetContainerName(community.Name, (call != null) ? call.Name : ""); // else if (currentCommunity != null) // { // idCommunity = this.UserContext.CurrentCommunityID; // // View.SetContainerName(currentCommunity.Name, (call != null) ? call.Name : ""); // } // else // { // idCommunity = 0; // //View.SetContainerName(View.Portalname, (call != null) ? call.Name : ""); // } // View.IdCallCommunity = idCommunity; // return idCommunity; //} private void LoadData(long idCall, lm.Comol.Modules.CallForPapers.Domain.Evaluation.dtoEvaluation evaluation, dtoSubmissionRevision submission) { // LOAD CALL INFO //dtoCall dtoC = ServiceCall.GetDtoCall(idCall; // View.LoadCallInfo(dtoC); //View.LoadAttachments(ServiceCall.GetAvailableCallAttachments(idCall, submission.Type.Id)); //Boolean submissionSubmitted = (submission.Status == SubmissionStatus.accepted); dtoCall call = ServiceCall.GetDtoCall(idCall); LoadSubmission(call, submission); LoadEvaluationData(call, evaluation); }
private void LoadEvaluationData(dtoCall call, lm.Comol.Modules.CallForPapers.Domain.Evaluation.dtoEvaluation evaluation) { Boolean inEvaluation = (evaluation.Status == Domain.Evaluation.EvaluationStatus.Evaluating || evaluation.Status == Domain.Evaluation.EvaluationStatus.None); View.AllowEvaluate = inEvaluation && !(call.EndEvaluationOn.HasValue && call.EndEvaluationOn.Value <= DateTime.Now); View.AllowCompleteEvaluation = inEvaluation && !(call.EndEvaluationOn.HasValue && call.EndEvaluationOn.Value <= DateTime.Now); evaluation.Criteria.Where(c => View.SavingForComplete || !c.IsValueEmpty).ToList().ForEach(c => c.CriterionError = (c.IsValidForEvaluation) ? FieldError.None : (c.IsValidForCriterionSaving) ? FieldError.Mandatory : FieldError.Invalid); List <dtoCriterionForEvaluation> tabs = (from e in evaluation.Criteria orderby e.Criterion.DisplayOrder select new dtoCriterionForEvaluation(e.Criterion.Id, e.Criterion.Name, e.Criterion.DisplayOrder, e.Status, e.CriterionError != FieldError.None)).ToList(); tabs.Add(new dtoCriterionForEvaluation(0, View.GeneralTabName, tabs.Select(t => t.DisplayOrder).Max() + 1, Domain.Evaluation.EvaluationStatus.None, false)); evaluation.Criteria.Add(dtoCriterionEvaluated.GetEvaluationPlaceHolder(evaluation.Comment, tabs.Where(t => t.Id == 0).Select(t => t.DisplayOrder).FirstOrDefault())); View.InitializeEvaluationSettings(tabs, evaluation); }
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); } } } } }
private void LoadEvaluationData(long idCall, lm.Comol.Modules.CallForPapers.Domain.Evaluation.dtoEvaluation evaluation) { LoadEvaluationData(ServiceCall.GetDtoCall(idCall), evaluation); }
private void LoadData(DisplayEvaluations display, Int32 idCommunity, dtoCall call, dtoSubmissionRevision submission, long idEvaluation, long idEvaluator) { View.CurrentDisplay = display; List <dtoCommitteeEvaluationInfo> committees = null; String owner = (submission.IsAnonymous || submission.Owner == null) ? View.AnonymousDisplayName : submission.Owner.SurnameAndName; litePerson submitter = CurrentManager.GetLitePerson(submission.IdSubmittedBy); String submittedBy = (submission.IdPerson == submission.IdSubmittedBy) ? "" : (submitter == null || submitter.TypeID == (int)UserTypeStandard.Guest) ? View.AnonymousDisplayName : submitter.SurnameAndName; View.LoadSubmissionInfo(owner, call.Name, submission.SubmittedOn, submittedBy); View.AllowPrint = true; if (call.AdvacedEvaluation) { View.SetViewEvaluationUrl(""); } else { View.SetViewEvaluationUrl(RootObject.ViewSubmissionTableEvaluations(submission.Id, call.Id, idCommunity)); } View.CommitteeIsFuzzy = Service.GetCommitteeDssMethodIsFuzzy(call.Id); switch (display) { case DisplayEvaluations.ForSubmission: committees = (call.AdvacedEvaluation) ? ServiceCall.GetCommitteesInfoForSubmission(submission.Id, call.Id, View.AdvCommId) : Service.GetCommitteesInfoForSubmission(submission.Id, call.Id); View.LoadCommitteesStatus(committees, display); View.LoadEvaluations( (call.AdvacedEvaluation) ? ServiceCall.GetSubmissionEvaluationsDispItem(call.Id, submission.Id, View.AdvCommId, View.UnknonwUserName) : Service.GetSubmissionEvaluations(submission.Id, call.Id, View.UnknonwUserName) ); break; case DisplayEvaluations.ForUser: committees = (call.AdvacedEvaluation) ? ServiceCall.GetCommitteesInfoForEvaluator(idEvaluator, View.AdvCommId) : Service.GetCommitteesInfoForEvaluator(idEvaluator); CallEvaluator evaluator = CurrentManager.Get <CallEvaluator>(idEvaluator); if (committees != null) { View.LoadEvaluatorInfo((evaluator == null || evaluator.Person == null) ? View.AnonymousDisplayName : evaluator.Person.SurnameAndName, committees.Count); } else { View.LoadEvaluatorInfo((evaluator == null || evaluator.Person == null) ? View.AnonymousDisplayName : evaluator.Person.SurnameAndName, 0); } View.LoadEvaluations(Service.GetEvaluationsInfo(idEvaluator, submission.Id, View.AnonymousDisplayName, View.UnknonwUserName)); View.LoadCommitteesStatus(committees, display); break; case DisplayEvaluations.Single: lm.Comol.Modules.CallForPapers.Domain.Evaluation.dtoEvaluation evaluation = (call.AdvacedEvaluation) ? ServiceCall.GetFullEvaluation(idEvaluation, View.AnonymousDisplayName, View.UnknonwUserName): Service.GetFullEvaluation(idEvaluation, View.AnonymousDisplayName, View.UnknonwUserName); if (evaluation == null) { View.DisplayUnknownEvaluation(View.IdCallCommunity, View.IdCallModule, idEvaluation); } else { dtoCommitteeEvaluation result = new dtoCommitteeEvaluation() { Evaluation = evaluation, IdCommittee = evaluation.IdCommittee }; committees = (call.AdvacedEvaluation) ? ServiceCall.GetCommitteesInfoForEvaluator(evaluation.IdEvaluator): Service.GetCommitteesInfoForEvaluator(evaluation.IdEvaluator); if (committees.Where(c => c.IdCommittee == evaluation.IdCommittee).Any()) { committees.Where(c => c.IdCommittee == evaluation.IdCommittee).FirstOrDefault().Status = evaluation.Status; result.Status = evaluation.Status; result.Name = committees.Where(c => c.IdCommittee == evaluation.IdCommittee).FirstOrDefault().Name; } View.LoadCommitteesStatus(committees.Where(c => c.IdCommittee == evaluation.IdCommittee).ToList(), display); if (committees != null) { View.LoadEvaluatorInfo(evaluation.EvaluatorName, committees.Count); } else { View.LoadEvaluatorInfo(evaluation.EvaluatorName, 0); } View.LoadEvaluation(result); } break; } }