private List <dtoSubmissionMultipleAssignment> GetItems(CallForPaper call, dtoSubmissionFilters filters, int pageIndex, int pageSize) { PagerBase pager = new PagerBase(); pager.PageSize = pageSize; if (pageSize == 0) { pageSize = 50; } pager.Count = (int)CallService.SubmissionsCount(call.Id, filters) - 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; if (pager.Count < 0) { return(new List <dtoSubmissionMultipleAssignment>()); } else { return(Service.GetCommitteesAssignments(call, CallService.GetSubmissionsForEvaluation(call.Id, filters, pager.PageIndex, pageSize))); } }
private void LoadMembers(long idCall) { CallForPaper call = CallService.GetCallForPaper(idCall); if (call != null) { LoadMembers(call); } }
private void LoadAssignments(long idCall) { CallForPaper call = CallService.GetCallForPaper(idCall); if (call != null) { LoadAssignments(call); } }
public void LoadMultipleAssignments(long idCall) { CallForPaper call = CallService.GetCallForPaper(idCall); if (call != null) { LoadMultipleAssignments(call, Service.GetAvailableCommittees(call), Service.GetAvailableSteps(call, WizardEvaluationStep.AssignSubmissionWithNoEvaluation)); } }
public void LoadAssignments(long idCall, dtoSubmissionFilters filters, int pageIndex, int pageSize) { CallForPaper call = CallService.GetCallForPaper(idCall); if (call != null) { LoadAssignments(call, filters, pageIndex, pageSize); } }
private void LoadAssignments(CallForPaper call) { List <lm.Comol.Core.Wizard.NavigableWizardItem <dtoEvaluationStep> > steps = Service.GetAvailableSteps(call, WizardEvaluationStep.AssignSubmission); View.AllowChangeAssignModeToEvalutors = (call.EvaluationType != EvaluationType.Dss); List <dtoBaseCommittee> committees = Service.GetAvailableCommittees(call); if (committees.Count == 0) { View.AllowSave = false; View.DisplayError(EvaluationEditorErrors.NoCommittees); LoadStep(call.Id, steps, false); } else if (committees.Count == 1) { View.IdCommittee = committees[0].Id; Dictionary <SubmissionStatus, int> infos = Service.GetSubmissionsInfo(call); if (Service.CallHasEvaluation(call)) { List <CommitteeMember> members = Service.GetCommitteeMembers(committees[0].Id); List <dtoSubmissionAssignment> assignments = Service.GetCommitteeAssignments(call, committees[0].Id); if (members == null || members.Count == 0) { View.DisplayError(EvaluationEditorErrors.NoEvaluators); View.LoadWizardSteps(call.Id, View.IdCommunity, steps, EvaluationEditorErrors.NoEvaluators); } else { View.AllowAssignEvaluatorsToAll = (assignments.Where(a => a.Evaluators.Count() == 0).Any() && View.AllowSave); LoadStep(call.Id, steps, true); View.LoadSubmissions(assignments, members.Where(m => m.Evaluator != null && m.Evaluator.Person != null).ToDictionary(m => m.Evaluator.Id, m => m.Evaluator.Person.SurnameAndName)); View.LoadWizardSteps(call.Id, View.IdCommunity, steps); } } else { //View.AllowSave = false; View.AllowAssignEvaluatorsToAll = false; LoadStep(call.Id, steps, true); if (infos.Where(i => i.Value > 0).Select(i => i.Key).Where(k => k >= SubmissionStatus.accepted && k != SubmissionStatus.rejected).Any()) { View.DisplayStartup(infos.Select(i => i.Value).Sum(), infos.ContainsKey(SubmissionStatus.accepted) ? infos[SubmissionStatus.accepted] : 0, infos.ContainsKey(SubmissionStatus.rejected) ? infos[SubmissionStatus.rejected] : 0); } else { View.DisplayNoAvailableSubmission(infos.Select(i => i.Value).Sum(), (infos.ContainsKey(SubmissionStatus.rejected) ? infos[SubmissionStatus.rejected] : 0)); } View.LoadWizardSteps(call.Id, View.IdCommunity, steps); } } else { View.ReloadEditor(RootObject.EditCommiteeByStep(call.Id, View.IdCommunity, WizardEvaluationStep.MultipleAssignSubmission, View.PreloadView)); } }
private void LoadAssignments(CallForPaper call, dtoSubmissionFilters filters, int pageIndex, int pageSize) { List <lm.Comol.Core.Wizard.NavigableWizardItem <dtoEvaluationStep> > steps = Service.GetAvailableSteps(call, WizardEvaluationStep.MultipleAssignSubmission); View.AllowChangeAssignModeToEvalutors = (call.EvaluationType != EvaluationType.Dss); List <dtoBaseCommittee> committees = Service.GetAvailableCommittees(call); if (committees.Count == 0) { View.DisplayError(EvaluationEditorErrors.NoCommittees); LoadStep(call.Id, steps, false); } else if (committees.Count == 1) { View.ReloadEditor(RootObject.EditCommiteeByStep(call.Id, View.IdCommunity, WizardEvaluationStep.AssignSubmission, View.PreloadView)); } else { Dictionary <SubmissionStatus, int> infos = Service.GetSubmissionsInfo(call); if (Service.CallHasEvaluation(call)) { Dictionary <long, Dictionary <long, String> > members = Service.GetCommitteesMemberships(call); List <dtoSubmissionMultipleAssignment> assignments = GetItems(call, filters, pageIndex, pageSize); if (members == null || members.Count == 0) { View.DisplayError(EvaluationEditorErrors.NoEvaluators); View.LoadWizardSteps(call.Id, View.IdCommunity, steps, EvaluationEditorErrors.NoEvaluators); } else { View.AllowAssignEvaluatorsToAll = View.AllowSave; LoadStep(call.Id, steps, true); View.LoadSubmissions(assignments, members); View.LoadWizardSteps(call.Id, View.IdCommunity, steps); } } else { View.AllowAssignEvaluatorsToAll = false; LoadStep(call.Id, steps, true); if (infos.Where(i => i.Value > 0).Select(i => i.Key).Where(k => k >= SubmissionStatus.accepted && k != SubmissionStatus.rejected).Any()) { View.DisplayStartup(infos.Select(i => i.Value).Sum(), infos.ContainsKey(SubmissionStatus.accepted) ? infos[SubmissionStatus.accepted] : 0, infos.ContainsKey(SubmissionStatus.rejected) ? infos[SubmissionStatus.rejected] : 0); } else { View.DisplayNoAvailableSubmission(infos.Select(i => i.Value).Sum(), (infos.ContainsKey(SubmissionStatus.rejected) ? infos[SubmissionStatus.rejected] : 0)); } View.LoadWizardSteps(call.Id, View.IdCommunity, steps); } } }
private List <dtoSubmissionMultipleAssignment> GetItems(CallForPaper call) { List <dtoBaseSubmission> items = Service.GetSubmissionsForNoEvaluations(call.Id, View.CurrentOrderBy, View.CurrentAscending); if (items == null) { return(new List <dtoSubmissionMultipleAssignment>()); } else { return(Service.GetCommitteesAssignmentsForNoEvaluations(call, items)); } }
private void LoadMultipleAssignments(CallForPaper call, List <dtoBaseCommittee> committees, List <lm.Comol.Core.Wizard.NavigableWizardItem <dtoEvaluationStep> > steps) { Dictionary <SubmissionStatus, int> infos = Service.GetSubmissionsInfoWithNoEvaluation(call); View.DisplayStartup(infos.Select(i => i.Value).Sum(), infos.ContainsKey(SubmissionStatus.accepted) ? infos[SubmissionStatus.accepted] : 0, infos.ContainsKey(SubmissionStatus.rejected) ? infos[SubmissionStatus.rejected] : 0); Dictionary <long, Dictionary <long, String> > members = Service.GetCommitteesMemberships(call); List <dtoSubmissionMultipleAssignment> assignments = GetItems(call); if (members == null || members.Count == 0) { View.DisplayError(EvaluationEditorErrors.NoEvaluators); View.LoadWizardSteps(call.Id, View.IdCommunity, steps, EvaluationEditorErrors.NoEvaluators); } else { LoadStep(call.Id, steps, true); View.LoadSubmissions(assignments, members); } }
private void LoadMembers(CallForPaper call) { List <dtoBaseCommittee> committees = Service.GetAvailableCommittees(call); List <dtoCommitteeMember> members = Service.GetCommitteesMembers(call); List <lm.Comol.Core.Wizard.NavigableWizardItem <dtoEvaluationStep> > steps = Service.GetAvailableSteps(call, WizardEvaluationStep.FullManageEvaluators); View.AllowMultipleCommittees = (committees.Count > 1); Boolean multipleCommittee = !call.OneCommitteeMembership && committees.Count > 1; View.IdOnlyOneCommittee = (committees == null || committees.Count == 0 || committees.Count > 1) ? 0 : committees[0].Id; if (committees == null || committees.Count == 0) { View.DisplayError(EvaluationEditorErrors.NoCommittees); } else if (members == null || members.Count == 0) { View.DisplayWarning(EvaluationEditorErrors.NoEvaluators); View.LoadWizardSteps(call.Id, View.IdCommunity, steps, EvaluationEditorErrors.NoEvaluators); } else { dtoEvaluationStep s = steps.Where(i => i.Id.Type == WizardEvaluationStep.FullManageEvaluators).Select(i => i.Id).FirstOrDefault(); if (s != null && s.Errors.Any()) { if (s.Errors.Contains(EditingErrors.CommitteeWithNoEvaluators)) { View.DisplayWarning(EvaluationEditorErrors.CommitteeWithNoEvaluators); } else if (s.Errors.Contains(EditingErrors.UnassingedEvaluators)) { View.DisplayWarning(EvaluationEditorErrors.UnassignedEvaluators); } else if (s.Errors.Contains(EditingErrors.MoreEvaluatorAssignment)) { View.DisplayWarning(EvaluationEditorErrors.MoreEvaluatorAssignment); } } View.LoadWizardSteps(call.Id, View.IdCommunity, steps); View.LoadEvaluators(members, multipleCommittee, committees); } }
//public void SaveSettings(List<dtoSubmissionAssignment> assignments) { //} #endregion private void LoadAssignments(CallForPaper call) { List <lm.Comol.Core.Wizard.NavigableWizardItem <dtoEvaluationStep> > steps = Service.GetAvailableSteps(call, WizardEvaluationStep.AssignSubmissionWithNoEvaluation); List <dtoBaseCommittee> committees = Service.GetAvailableCommittees(call); View.MultiComittees = (committees.Count > 1); if (committees.Count == 0) { View.AllowSave = false; View.DisplayError(EvaluationEditorErrors.NoCommittees); LoadStep(call.Id, steps, false); } else if (committees.Count == 1) { View.IdCommittee = committees[0].Id; Dictionary <SubmissionStatus, int> infos = Service.GetSubmissionsInfoWithNoEvaluation(call); View.DisplayStartup(infos.Select(i => i.Value).Sum(), infos.ContainsKey(SubmissionStatus.accepted) ? infos[SubmissionStatus.accepted] : 0, infos.ContainsKey(SubmissionStatus.rejected) ? infos[SubmissionStatus.rejected] : 0); List <CommitteeMember> members = Service.GetCommitteeMembers(committees[0].Id); List <dtoSubmissionAssignment> assignments = Service.GetCommitteeAssignmentsForNoEvaluations(call, committees[0].Id, members); if (members == null || members.Count == 0) { View.AllowSave = false; View.DisplayError(EvaluationEditorErrors.NoEvaluators); View.LoadWizardSteps(call.Id, View.IdCommunity, steps, EvaluationEditorErrors.NoEvaluators); } else { LoadStep(call.Id, steps, true); View.LoadSubmissions(assignments, members.Where(m => m.Evaluator != null && m.Evaluator.Person != null).ToDictionary(m => m.Evaluator.Id, m => m.Evaluator.Person.SurnameAndName)); View.LoadWizardSteps(call.Id, View.IdCommunity, steps); } } else { LoadMultipleAssignments(call, committees, steps); } }
private void LoadCommittees(BaseForPaper call, Boolean allowUseOfDssMethods, long idMethod = -1, long idRatingSet = -1) { List <dtoCommittee> committees = Service.GetEditorCommittees(call); List <dtoSubmitterType> submitters = CallService.GetCallAvailableSubmittersType(call); CallForPaper cfp = Service.GetCallForCommiteeSettings(call.Id); Boolean useDssMethod = allowUseOfDssMethods && (cfp != null && cfp != null && cfp.EvaluationType == EvaluationType.Dss); View.AllowSubmittersSelection = !useDssMethod && (committees.Count > 0) && submitters.Count > 0; View.UseDssMethods = useDssMethod; View.LoadSubmitterTypes(submitters); List <lm.Comol.Core.Wizard.NavigableWizardItem <dtoEvaluationStep> > steps = Service.GetAvailableSteps(call, WizardEvaluationStep.none); Int32 count = committees.Count; View.CommitteesCount = count; List <dtoSelectMethod> methods = null; if (useDssMethod) { methods = ServiceDss.MethodsGetAvailable(UserContext.Language.Id); View.CurrentMethods = methods; } if (committees == null || committees.Count == 0) { if (!Service.isNewCommittee(call)) { View.CommitteesCount = 0; View.DisplayError(EvaluationEditorErrors.NoCommittees); View.LoadWizardSteps(call.Id, View.IdCommunity, steps, EvaluationEditorErrors.NoCommittees); View.DisplayDssErrors(new List <dtoCommittee>()); } else { EvaluationCommittee committee = Service.AddFirstCommittee(call, View.DefaultCommitteeName, View.DefaultCommitteeDescription, useDssMethod); if (committee != null) { committees = new List <dtoCommittee>(); committees.Add(new dtoCommittee() { Id = committee.Id, Description = committee.Description, DisplayOrder = committee.DisplayOrder, UseDss = committee.UseDss, WeightSettings = new Core.Dss.Domain.Templates.dtoItemWeightSettings(), MethodSettings = new Core.Dss.Domain.Templates.dtoItemMethodSettings() { InheritsFromFather = false }, Name = committee.Name, ForAllSubmittersType = true }); count = 1; View.CommitteesCount = count; View.LoadCommittees(committees); } else { View.CommitteesCount = 0; } if (useDssMethod && committees.Any(c => c.HasDssErrors(count))) { //lm.Comol.Core.Wizard.NavigableWizardItem<dtoEvaluationStep> step = steps.Where(s=> s.Id.Type== WizardEvaluationStep.GeneralSettings).FirstOrDefault(); //if (step!=null){ // step.Id.Errors.Add(EditingErrors.CommitteeDssSettings); // if (step.Status== Core.Wizard.WizardItemStatus.valid || step.Status== Core.Wizard.WizardItemStatus.none) // step.Status= Core.Wizard.WizardItemStatus.error; //} View.DisplayDssErrors(committees.Where(c => c.HasDssErrors(1)).ToList()); } else { View.DisplayDssErrors(new List <dtoCommittee>()); } View.LoadWizardSteps(call.Id, View.IdCommunity, steps); } } else { if (useDssMethod && committees.Any(c => c.HasDssErrors(count))) { View.DisplayDssErrors(committees.Where(c => c.HasDssErrors(count)).ToList()); //lm.Comol.Core.Wizard.NavigableWizardItem<dtoEvaluationStep> step = steps.Where(s => s.Id.Type == WizardEvaluationStep.GeneralSettings).FirstOrDefault(); //if (step != null) //{ // step.Id.Errors.Add(EditingErrors.CommitteeDssSettings); // if (step.Status == Core.Wizard.WizardItemStatus.valid || step.Status == Core.Wizard.WizardItemStatus.none) // step.Status = Core.Wizard.WizardItemStatus.error; //} } else { View.DisplayDssErrors(new List <dtoCommittee>()); } View.LoadWizardSteps(call.Id, View.IdCommunity, steps); if (useDssMethod) { if (committees.Count > 1) { View.InitializeAggregationMethods(methods, (idMethod == -1 ? cfp.IdDssMethod : idMethod), (idRatingSet == -1 ? cfp.IdDssRatingSet : idRatingSet), GetAvailableWeights(call, call.IsDssMethodFuzzy, call.UseOrderedWeights, committees)); } else { View.HideCallAggregationMethods(methods, (idMethod == -1 ? cfp.IdDssMethod : idMethod), (idRatingSet == -1 ? cfp.IdDssRatingSet : idRatingSet), GetAvailableWeights(call, call.IsDssMethodFuzzy, call.UseOrderedWeights, committees)); } } View.LoadCommittees(committees); } }
public static String Translate(string content, lm.Comol.Modules.CallForPapers.Business.ServiceCallOfPapers service, CallForPaper call, Int32 idUser, UserSubmission submission) { String translation = content; //if (path != null) //{ // Int32 IdCRole = service.CommunityRoleId(path.Community.Id,idUser); // ILookup<StatusStatistic, ActivityStatistic> statdict = null; // DateTime? endDate = service.GetEpEndDate(path, idUser); // if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.PathName))) // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.PathName), ReplaceChars(path.Name)); // //if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.UnitCount))) // // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.UnitCount), path.UnitList.Where(u=> u.Deleted== BaseStatusDeleted.None)); // if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.PathMinCompletion))) // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.PathMinCompletion), path.MinCompletion.ToString() + "%"); // //if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.PathMinMark))) // // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.PathMinMark), path.MinCompletion.ToString()); // Boolean timeBased = service.CheckEpType(path.EPType, EPType.Time); // Int32 totalAct = -1; // Int32 notStarted = -1; // Int32 started = -1; // Int32 completed = -1; // Int32 completedAndPassed = -1; // // ANCHE SE è AUTO devo verificare ?? // //Boolean timeBased = service.CheckEpType(path.EPType, EPType.Time) && service.CheckEpType(path.EPType, EPType.Auto); // if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.PathDuration)) && timeBased ) // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.PathDuration), (path.Weight > 0) ? service.ConvertTimeFromLong(path.Weight) : "//"); // if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.UnitCount))) // { // short count = service.GetActiveUnitsCount(path.UnitList, idUser, IdCRole, true, false); // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.UnitCount), count.ToString()); // } // if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.ActivitiesCount))) // { // totalAct = service.GetActiveActivitiesCount(path.UnitList.SelectMany(x => x.ActivityList).ToList(), idUser, IdCRole, true, false); // //foreach (var item in path.UnitList) // //{ // // count += service.GetActiveActivitiesCount(item.ActivityList , idUser, IdCRole, true, false); // //} // //totalAct = count; // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.ActivitiesCount), totalAct.ToString()); // } // if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.StartedActivities))) // { // //if (statdict == null) // // statdict = service.ServiceStat.GetStatCount_ByUser(path.Id, idUser, DateTime.Now); // //started = statdict[StatusStatistic.BrowsedStarted].Count(); // started = service.ServiceStat.GetStatCount_ByUserAndStatus(path.Id, idUser, DateTime.Now, StatusStatistic.Started); // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.StartedActivities), started.ToString()); // } // if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.CompletedActivities))) // { // //if (statdict == null) // // statdict = service.ServiceStat.GetStatCount_ByUser(path.Id, idUser, DateTime.Now); // //completed = statdict[StatusStatistic.Started | StatusStatistic.Browsed | StatusStatistic.Completed ].Count(); // //completed = statdict[StatusStatistic.Started | StatusStatistic.Browsed | StatusStatistic.CompletedPassed].Count(); // completedAndPassed = service.ServiceStat.GetStatCount_ByUserAndStatus(path.Id, idUser, DateTime.Now, StatusStatistic.Completed); // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.CompletedActivities), completedAndPassed.ToString()); // } // if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.NotStartedActivities))) // { // //if (statdict == null) // // statdict = service.ServiceStat.GetStatCount_ByUser(path.Id, idUser, DateTime.Now); // //if (totalAct == -1) // //{ // // totalAct = service.GetActiveActivitiesCount(path.UnitList.SelectMany(x => x.ActivityList).ToList(), idUser, IdCRole, true, false); // //} // //Int32 x = statdict[StatusStatistic.].Count(); // notStarted = service.ServiceStat.GetStatCount_ByUserAndStatus(path.Id, idUser, DateTime.Now, StatusStatistic.Started ,true ); // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.NotStartedActivities), notStarted.ToString()); // } // if (content.Contains(GetPlaceHolder(EduPathPlaceHoldersType.CompletedOn))) // { // //(!subActivity.UsePathEndDateStatistics || !endDate.HasValue) || (subActivity.UsePathEndDateStatistics && endDate.HasValue && a.CompletedOn <= endDate.Value)); // PathStatistic pathStatistic = null; // if (!subActivity.UsePathEndDateStatistics || !endDate.HasValue) // pathStatistic = service.ServiceStat.GetPathStat(path.Id, idUser); // else if (subActivity.UsePathEndDateStatistics && endDate.HasValue) // pathStatistic = service.ServiceStat.GetPathStat(path.Id, idUser, endDate.Value); // //TODO:Check epAuto // if (service.ServiceStat.CheckStatusStatistic(pathStatistic.Status, StatusStatistic.Completed) || service.ServiceStat.CheckStatusStatistic(pathStatistic.Status, StatusStatistic.CompletedPassed)) // { // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.CompletedOn), pathStatistic.CreatedOn.Value.ToShortDateString()); // } // //else // //{ // // translation = translation.Replace(GetPlaceHolder(EduPathPlaceHoldersType.CompletedOn), "###"); // //} // } //} return(translation); }