public void TestMethodGetParkingView() { ReservationDataService ds = new ReservationDataService(); ParkingsView test = ds.GetParkingsView(); Assert.AreEqual(4, 4); }
private void SaveReserveren() { //Be Reservation test = Reservation; Reservation.Status = "reserved"; //user already exist UserDataService dbUser = new UserDataService(); User us = dbUser.UserExist(Reservation.User); if (us == null) { //creat New User dbUser.InsertUser(Reservation.User); us = dbUser.UserExist(Reservation.User); } Reservation.User = us; //reservation ReservationDataService dbReservation = new ReservationDataService(); dbReservation.InsertReservation(Reservation); MessageBox.Show("Reservatie is voltooid"); NewForm(); }
public StatistiekViewModel() { ReservationDataService dbReservation = new ReservationDataService(); MostUsedParkPlace = dbReservation.GetMostReservedParkingPlace(); MostUsedUser = dbReservation.GetMostReservedUser(); //Barchart CountReservationsPerDay = new SeriesCollection { new ColumnSeries { Title = "Reservation \n per day", Values = new ChartValues <int> { } } }; CountReservationPerDayFormat = value => value.ToString("0"); countReservationPerDayLabel = new List <String>(); List <Graph <string, int> > countReservationsPerDayData = dbReservation.GetCountReservationEveryDay(); foreach (Graph <string, int> data in countReservationsPerDayData) { CountReservationsPerDay.First().Values.Add((int)data.YValue); countReservationPerDayLabel.Add(data.XValue); } //endBarchart //instantiëren DialogService als singleton dialogService = new DialogService(); KoppelCommands(); }
public void TestMethodGetCountReservationEveryDay() { ReservationDataService ds = new ReservationDataService(); List <Graph <string, int> > test = ds.GetCountReservationEveryDay(); Assert.AreEqual(4, 4); }
public void TestMethodGetMostReservedParkingPlace() { ReservationDataService ds = new ReservationDataService(); ParkPlace parkplace = ds.GetMostReservedParkingPlace(); Assert.AreEqual(4, 4); }
private static void Main(string[] args) { _service = new CarDataService(); _resService = new ReservationDataService(); string input = ""; while (input.ToUpper() != "Q") { Console.WriteLine("L) List Cars"); Console.WriteLine("#) Show specific Car"); Console.WriteLine("N) Enter a new Car"); Console.WriteLine("Q) Quit"); Console.Write("Please enter a command: "); input = Console.ReadLine().ToUpper(); int index = 0; if (input == "L") { ListCars(); } else if (input == "N") { EnterCar(); } else if (int.TryParse(input, out index)) { ShowCar(index); } } input = ""; while (input.ToUpper() != "Q") { Console.WriteLine("L) List Reservations"); Console.WriteLine("#) Show specific Reservation"); Console.WriteLine("N) Enter a new Reservation"); Console.WriteLine("Q) Quit"); Console.Write("Please enter a command: "); input = Console.ReadLine().ToUpper(); if (input == "L") { ListReservations(); } else if (input == "N") { EnterReservation(); } else { int carId = int.Parse(Console.ReadLine()); int costumerId = int.Parse(Console.ReadLine()); ShowReservation(carId, costumerId); } } }
public void TestMethodGetReservationParkPlace() { ParkPlace parkplace = new ParkPlace(); parkplace.Id = 2; ReservationDataService ds = new ReservationDataService(); ObservableCollection <Reservation> reservations = ds.GetReservationParkPlace(parkplace); Assert.AreEqual(3, reservations.Count); }
public void TestMethodGetNewParkPlaces() { Reservation reservation = new Reservation(); ReservationDataService ds = new ReservationDataService(); reservation.BeginTime = DateTime.Parse("05/04/2020 11:50:00"); reservation.EndTime = DateTime.Parse("05/04/2020 12:50:00"); String location = "A202"; ParkPlace park = ds.GetNewParkPlaces(reservation, location); Assert.AreEqual(16, park.Id); }
private void GetParkingPlace() { //kijken welke paringPlaats ReservationDataService ds = new ReservationDataService(); ParkPlace reservationPark = ds.GetNewParkPlaces(Reservation, Location); if (reservationPark == null) { //geen parking gevonden MessageBox.Show("Geen parkingplaatsen gevonden!"); } else { Reservation.ParkPlace = reservationPark; } }
private void GetReservation() { if (SelectedDateTime != null) { //remove all list RemoveAllReservations(); ReservationDataService db = new ReservationDataService(); PreviousReservation = db.GetReservationDate(SelectedDateTime, SelectedParkingView.Parking); foreach (Reservation reservation in PreviousReservation) { SelectedParkingView.Rows.ElementAt(reservation.ParkPlace.Row - 1).Row.ElementAt(reservation.ParkPlace.Cel - 1).fitlerDateTime = SelectedDateTime; SelectedParkingView.Rows.ElementAt(reservation.ParkPlace.Row - 1).Row.ElementAt(reservation.ParkPlace.Cel - 1).Reservation.Add(reservation); } } }
private void OnParkPlaceReceived(ParkPlaceView parkplace) { if (parkplace.Building == null || parkplace.Parking == null) { ParkPlaceDataService dbParkPlace = new ParkPlaceDataService(); SelectedParkPlace = dbParkPlace.GetParkPlaceWithFKView(parkplace); } else { SelectedParkPlace = parkplace; } // get reservations if (SelectedParkPlace != null) { ReservationDataService db = new ReservationDataService(); Reservations = db.GetReservationParkPlace(SelectedParkPlace); } }