Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        public void addStudent(studentDTO a)
        {
            studentBL studentListBL = new studentBL();

            studentListBL.AddStudent(a);
        }