예제 #1
0
        private List<DataRow> GenerateRows(int numRows)
        {
            List<DataRow> rows = new List<DataRow>();

            for (int x = 0; x < numRows; x++) {
                DataRow row = new DataRow();
                row.AddColumn(new IDColumn());
                row.AddColumn(new FirstNameColumn());
                row.AddColumn(new LastNameColumn());
                row.AddColumn(new BirthDayColumn());
                row.AddColumn(new BirthMonthColumn());
                row.AddColumn(new BirthYearColumn());
                row.AddColumn(new CityColumn());
                row.AddColumn(new DriversLicenseNumberColumn());
                row.AddColumn(new PhoneNumberColumn());
                row.AddColumn(new SocialSecurityNumberColumn());
                row.AddColumn(new StateColumn());
                row.AddColumn(new StreetNumberColumn());
                row.AddColumn(new StreetNameColumn());
                row.AddColumn(new ApartmentNumberColumn());
                row.AddColumn(new ZipCodeColumn());
                rows.Add(row);
            }

            return rows;
        }
예제 #2
0
        private List<DataRow> GenerateRows(int numRows, FormCollection collection)
        {
            List<DataRow> rows = new List<DataRow>();

            for (int x = 0; x < numRows; x++) {
                DataRow row = new DataRow();
                if (collection["id"] != null) {
                    row.AddColumn(new IDColumn());
                }
                if (collection["firstName"] != null) {
                    row.AddColumn(new FirstNameColumn());
                }
                if (collection["lastName"] != null) {
                    row.AddColumn(new LastNameColumn());
                }
                if (collection["birthDay"] != null) {
                    row.AddColumn(new BirthDayColumn());
                }
                if (collection["birthMonth"] != null) {
                    row.AddColumn(new BirthMonthColumn());
                }
                if (collection["birthYear"] != null) {
                    row.AddColumn(new BirthYearColumn());
                }
                if (collection["city"] != null) {
                    row.AddColumn(new CityColumn());
                }
                if (collection["driversLicenseNumber"] != null) {
                    row.AddColumn(new DriversLicenseNumberColumn());
                }
                if (collection["phoneNumber"] != null) {
                    row.AddColumn(new PhoneNumberColumn());
                }
                if (collection["socialSecurityNumber"] != null) {
                    row.AddColumn(new SocialSecurityNumberColumn());
                }
                if (collection["state"] != null) {
                    row.AddColumn(new StateColumn());
                }
                if (collection["streetNumber"] != null) {
                    row.AddColumn(new StreetNumberColumn());
                }
                if (collection["streetName"] != null) {
                    row.AddColumn(new StreetNameColumn());
                }
                if (collection["apartmentNumber"] != null) {
                    row.AddColumn(new ApartmentNumberColumn());
                }
                if (collection["zipCode"] != null) {
                    row.AddColumn(new ZipCodeColumn());
                }

                rows.Add(row);
            }

            return rows;
        }