예제 #1
0
        public void TestData()
        {
            DbHandler     handler = new DbHandler();
            List <string> regnums = new List <string>();

            DateTime now = DateTime.Now;

            for (int i = 0; i < 50; i++)
            {
                string regNum  = "QUE" + "-00" + i.ToString();
                int    carType = (i % 2) + 1;
                handler.CheckInVehicle(regNum, carType);
                regnums.Add(regNum);
                DateTime inDate = now.AddHours(-i * 10);
                Thread.Sleep(10);
                ChangeInDate(regNum, inDate);
                Thread.Sleep(10);

                handler.CheckOutVehicle(regNum);
                Thread.Sleep(10);
                ChangeInDateHistory(regNum, inDate, inDate.AddHours(1), (decimal)CalculatePrice.GetCost(inDate, inDate.AddHours(1), carType == 1 ? true : false));
                Thread.Sleep(10);
            }

            //handler.CheckOutVehicle(regNum);
        }
예제 #2
0
        private static void CheckIn()
        {
            DbHandler handler       = new DbHandler();
            int       carType       = MenuUtils.AlternetivesMenu(0, new string[] { "Bil", "Mc" }, "Vilken typ av fordon är det?") + 1;
            string    regNumber     = MenuUtils.AskForStringWithoutSpecialChar("Vänligen skriv in reg-numret för fordonet som ska checkas in.").ToUpper();
            string    checkOutOrder = handler.CheckInVehicle(regNumber, carType);

            Console.Clear();
            Console.WriteLine(checkOutOrder);

            MenuUtils.PauseUntilFeedback(OrderMessage);
        }