Example #1
0
        public List <ClassesDTO> GetAllClasses()
        {
            List <classes> classesList = classeesDAL.GetAllClasses();

            if (classesList == null)
            {
                return(new List <ClassesDTO>());
            }
            List <ClassesDTO> classesListDTO = new List <ClassesDTO>();

            classesList.ForEach(x =>
            {
                ClassesDTO c = new ClassesDTO();
                c.class_     = x.class_;
                c.code       = x.code;
                c.num_class  = x.num_class;
                c.id_teacher = x.id_teacher;
                classesListDTO.Add(c);
            });
            return(classesListDTO);
        }
Example #2
0
        public List <ClassesDTO> GetClasesByCodeInstatition(int id)
        {
            List <classes> classesList = classeesDAL.GetClasesByCodeInstation(id);

            if (classesList == null)
            {
                return(new List <ClassesDTO>());
            }
            List <ClassesDTO> ClassesDTOList = new List <ClassesDTO>();

            classesList.ForEach(x =>
            {
                ClassesDTO c = new ClassesDTO();
                c.code       = x.code;
                c.id_teacher = x.id_teacher;
                c.class_     = x.class_;
                c.num_class  = x.num_class;
                ClassesDTOList.Add(c);
            });
            return(ClassesDTOList);
        }
Example #3
0
        public void addClasses()
        {
            ClassesDTO   c    = new ClassesDTO();
            StreamReader read = new StreamReader(@"d:\classes.csv", Encoding.Default);
            string       str  = read.ReadToEnd();

            string[] arr = str.Split('\n');
            for (int i = 0; i < arr.Length; i++)
            {
                int      j    = 0;
                string[] arr1 = arr[i].Split(',');
                c.code       = int.Parse(arr1[j++]);
                c.id_teacher = arr1[j++];
                c.class_     = arr1[j++];
                c.num_class  = int.Parse(arr1[j++]);
                ClassesBL cBL = new ClassesBL();
                cBL.AddClasses(c);
                Console.WriteLine();
            }
            Console.ReadLine();
        }
Example #4
0
        //עדכון

        public void UpdateClasses(ClassesDTO clas)
        {
            var ClassesMapper = iMapper.Map <ClassesDTO, classes>(clas);

            classeesDAL.UpdateClass(ClassesMapper);
        }
Example #5
0
        public int AddClasses(ClassesDTO x)
        {
            var ClassesMapper = iMapper.Map <ClassesDTO, classes>(x);

            return(classeesDAL.AddClass(ClassesMapper));
        }
        public void Put(ClassesDTO ClassesDTO)
        {
            ClassesBL ClassBL = new ClassesBL();
            ClassBL.UpdateClasses(ClassesDTO);

        }
 public void AddClass(ClassesDTO classes)
 {
     ClassesBL ClassesListBL = new ClassesBL();
     ClassesListBL.AddClasses(classes);
 }