public void func()
        {
            studentDTO   s    = new studentDTO();
            StreamReader read = new StreamReader(@"d:\aa.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(',');
                s.id         = arr1[j++];
                s.first_name = arr1[j++];
                s.last_name  = arr1[j++];
                s.id_parent  = arr1[j++];
                s.code_class = int.Parse(arr1[j++]);
                studentBL sBL = new studentBL();
                sBL.AddStudent(s);
                Console.WriteLine();
            }
            Console.ReadLine();
        }
Beispiel #2
0
        // מחזירה לכל אמא את ילידה
        public List <studentDTO> get_kids(string id_p)
        {
            List <studens> ls = studensDAL.GetKids(id_p);

            if (ls == null)
            {
                return(new List <studentDTO>());
            }
            List <studentDTO> studentListDTO = new List <studentDTO>();

            ls.ForEach(x =>
            {
                studentDTO s = new studentDTO();
                s.id         = x.id;
                s.code_class = x.code_class;
                s.id_parent  = x.id_parent;
                s.first_name = x.first_name;
                s.last_name  = x.last_name;
                timesBL time = new timesBL();
                studentListDTO.Add(s);
            });
            return(studentListDTO);
        }
Beispiel #3
0
        public string AddStudent(studentDTO student)
        {
            var studensMapper = iMapper.Map <studentDTO, studens>(student);

            return(studensDAL.AddStudens(studensMapper));
        }
Beispiel #4
0
        //עדכון

        public void UpdateStudens(studentDTO student)
        {
            var studensMapper = iMapper.Map <studentDTO, studens>(student);

            studensDAL.UpdateStudens(studensMapper);
        }
Beispiel #5
0
        public void Put(studentDTO student)
        {
            studentBL studentListBL = new studentBL();

            studentListBL.UpdateStudens(student);
        }
Beispiel #6
0
        public void addStudent(studentDTO a)
        {
            studentBL studentListBL = new studentBL();

            studentListBL.AddStudent(a);
        }