Exemple #1
0
        public static void ListCarsLatestServiceBill()
        {
            Service service;
            char    keyEntered;

            do
            {
                keyEntered = ' ';
                string heading = "Show bill for a Car's latest Service";
                MenuHelper.DisplayEnterReg(heading);
                String regNo = Console.ReadLine().ToUpper().Trim();
                service = ServicesService.GetServiceDetailsForCar(regNo, ref keyEntered)
                          .LastOrDefault();
                if (service == null)
                {
                    MenuHelper.DisplayReturnOrTryAgain();
                    char.TryParse(Console.ReadLine(), out keyEntered);
                }
            } while (service == null && keyEntered != '0');

            if (service.Id != 0)
            {
                ServiceDisplayHelper.DisplayServiceDetails(service);
            }
        }
Exemple #2
0
        public static void ListDetailsForAService()
        {
            Service service = new Service();
            char    keyEntered;

            do
            {
                keyEntered = ' ';
                MenuHelper.DisplayEnterServiceId();
                string serviceIdString = Console.ReadLine().Trim();

                service = ServicesService.GetServiceByIdString(serviceIdString);
                if (service.Id == 0)
                {
                    MenuHelper.DisplayReturnOrTryAgain();
                    char.TryParse(Console.ReadLine(), out keyEntered);
                }
            } while (service.Id == 0 && keyEntered != '0');

            if (service.Id != 0)
            {
                ServiceDisplayHelper.DisplayServiceDetails(service);
            }
        }