private List <TimeslotsWeight> UseCriteria(Criteria criteria, List <Timeslots> timeslots, Raschasovka load) { List <CriteriaRate> criteriaRate = new List <CriteriaRate>(); switch (criteria.Name) { case "MinGap": criteriaRate = CheckGap(load, timeslots); break; case "MoreThanOne": criteriaRate = MoreThanOneSubject(load, timeslots); break; case "LessThenFour": criteriaRate = LessThenFourSubject(load, timeslots); break; case "Shift": criteriaRate = ScheduleShift(load, timeslots); break; default: break; } if (criteriaRate.Count != 0) { services.InsertGenTimeslots(criteriaRate, load.Id); return(services.GetTimeslotsWeight()); } return(new List <TimeslotsWeight>()); }