Exemplo n.º 1
0
        public void addparents()
        {
            parentsDTO   p    = new parentsDTO();
            StreamReader read = new StreamReader(@"d:\parents.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(',');
                p.id             = arr1[j++];
                p.first_name     = arr1[j++];
                p.last_name      = arr1[j++];
                p.telefone       = arr1[j++];
                p.email          = arr1[j++];
                p.code_instation = int.Parse(arr1[j++]);
                perentsBL pBL = new perentsBL();
                pBL.AddParents(p);
                Console.WriteLine();
            }
            Console.ReadLine();
        }
        public void Post(parentsDTO parentsDTO)
        {
            perentsBL perentBL = new perentsBL();

            perentBL.AddParents(parentsDTO);
        }