public GymUser() { this.FirstName = CapstoneUtilities.FindRandomValue(CapstoneUtilities.firstNames); this.LastName = CapstoneUtilities.FindRandomValue(CapstoneUtilities.lastNames); this.StreetAddress = CapstoneUtilities.random.Next(100, 10000).ToString() + " " + CapstoneUtilities.FindRandomValue(CapstoneUtilities.streetNames) + " " + CapstoneUtilities.FindRandomValue(CapstoneUtilities.streetTypes); this.City = CapstoneUtilities.FindRandomValue(CapstoneUtilities.cities); this.State = CapstoneUtilities.FindRandomValue(CapstoneUtilities.states); this.Zipcode = CapstoneUtilities.FindRandomValue(CapstoneUtilities.zipcodes); this.PhoneBegin = CapstoneUtilities.random.Next(100, 1000).ToString(); this.PhoneMiddle = CapstoneUtilities.random.Next(100, 1000).ToString(); this.PhoneEnd = CapstoneUtilities.random.Next(1000, 10000).ToString(); this.EmailCompany = CapstoneUtilities.FindRandomValue(CapstoneUtilities.emailCompanies); this.EmailDomain = CapstoneUtilities.FindRandomValue(CapstoneUtilities.emailEndings); }
static void Main(string[] args) { Console.WriteLine("\t*** Capstone Database Population Script ***\n"); Console.WriteLine("This program will populate the Capstone database with sample data.\n"); CapstoneUtilities.ConnectToDatabase(); try { PopulateGymUserTable(); PopulateEmployeeRoleTable(); PopulateEmployeeTable(); PopulateSalaryTable(); PopulateMembershipTypeTable(); PopulateMembershipPriceTable(); PopulateMembershipTable(); PopulateProductTable(); PopulateProductPriceTable(); PopulatePurchaseTable(); PopulateProductQuantityTable(); PopulateFinanceCategoryTable(); PopulateRevenueTable(); PopulateExpenseTable(); CapstoneUtilities.connection.Close(); Console.WriteLine("\nConnection to database closed.\n"); Console.WriteLine("Population of tables successfull..."); Console.ReadLine(); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine("Closing connection..."); CapstoneUtilities.connection.Close(); Console.WriteLine("Connection closed."); } Console.ReadLine(); }