Esempio n. 1
0
        public CustomerList GetAll()
        {
            StudentDB database = new StudentDB("Student");

            database.Command.Parameters.Clear();
            database.Command.CommandType = System.Data.CommandType.StoredProcedure;
            database.Command.CommandText = "tblCustomer_GETALL";
            DataTable dt = database.ExecuteQuery();

            foreach (DataRow dr in dt.Rows)
            {
                Customer customer = new Customer();
                customer.Initialize(dr);
                customer.InitializeBusinessData(dr);
                customer.isNew   = false;
                customer.isDirty = false;
                _List.Add(customer);
            }
            return(this);
        }