public void CreateBooking(string customerName, string startTime, DateTime bookingDate, string email, string telephone, List <string> packageNames, string licensePlate, string brand, string vat = "") { List <Package> packagesFromDB = dbc.Sp_GetAllPackages(); foreach (Package package in packagesFromDB) { pr.AddPackageToList(package); } List <Package> packages = new List <Package>(); foreach (string packageName in packageNames) { packages.Add(pr.FindPackage(packageName)); } Booking b = dbc.Sp_CreateBooking(customerName, startTime, bookingDate, email, telephone, packages, licensePlate, brand, vat); try { br.AddBookingToList(b); } catch (NullReferenceException e) { MessageBox.Show(e.Message); } }
public void LoadAllPackagesToPackageRepo() { pr.ClearPackageList(); List <Package> packages = new List <Package>(); packages = dbc.Sp_GetAllPackages(); foreach (Package package in packages) { pr.AddPackageToList(package); } }