示例#1
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();
        }
 public void AddClass(ClassesDTO classes)
 {
     ClassesBL ClassesListBL = new ClassesBL();
     ClassesListBL.AddClasses(classes);
 }