예제 #1
0
        public static void ChangePaymentStatus(SpaceParkContext context, Visitor VisitorToPay)
        {
            if (VisitorToPay.HasPaid == false)
            {
                VisitorToPay.HasPaid = true;

                var parking = VisitorParking.GetSpecificVisitorParking(context, VisitorToPay);

                var parkingLot = ParkingLot.GetSpecificParkingLot(context, parking);
                parkingLot.ParkingLotOccupied = false;

                context.SaveChanges();

                StandardMessaging.ThankYouForYourStay();
                Console.ReadLine();
            }
            else
            {
                StandardMessaging.NoValidInput("Couldn't find you in db. Or something just doesn't work ;)");
            }
        }
예제 #2
0
        private static void ExecuteUserChoice(SpaceParkContext context, string userChoice)
        {
            switch (userChoice)
            {
            case "1":
                RentParkingSpace(context);
                Console.Clear();
                break;

            case "2":
                UpdateVisitorAndParkingLot(context);
                Console.Clear();
                break;

            case "0":
                Environment.Exit(0);
                break;

            default:
                StandardMessaging.NoValidInput("You can only choose from the alternatives. Try again!");
                break;
            }
        }