Exemple #1
0
        //GetItemsForAllSubjects
        public static List <ItemsForSubject> GetItemsForAllSubjects()
        {
            List <Subjects>        subjects         = SubjectsDL.GetAllSubjects();
            List <ItemsForSubject> itemsForSubjects = new List <ItemsForSubject>();

            foreach (var subject in subjects)
            {
                var result = GetItemsBySubjectId(subject.SubjectId);
                if (result != null)
                {
                    itemsForSubjects.Add(result);
                }
            }
            return(itemsForSubjects);
        }
Exemple #2
0
 //GetAll
 public static List <Subjects1> GetAllSubjects()
 {
     return(SubjectsConvertor.ConvertToListDto(SubjectsDL.GetAllSubjects()));
 }
Exemple #3
0
        //GetContainName
        public static List <Subjects1> GetSubjectContainText(string text)
        {
            List <Subjects> lst = new List <Subjects>(SubjectsDL.GetAllSubjects());

            return(SubjectsConvertor.ConvertToListDto(lst.Where(k => k.Subject.Contains(text)).ToList()));
        }
Exemple #4
0
        //GetByName
        public static Subjects1 GetSubjectByName(string subject)
        {
            List <Subjects> lst = new List <Subjects>(SubjectsDL.GetAllSubjects());

            return(SubjectsConvertor.ConvertToDto(lst.Where(k => k.Subject.Equals(subject)).FirstOrDefault()));
        }