Esempio n. 1
0
        public void DropDownChange(VehicleDetails svDetails)
        {
            _dbLayerObj = new DALayer();
            ParkingBookingHistory pbhObj = new ParkingBookingHistory();

            pbhObj      = _dbLayerObj.VehicleCheckOut(svDetails);
            DriverName  = pbhObj.VehicleDetails.DriverName;
            ParkingTime = (DateTime.Now - pbhObj.TimeIn).Duration();
            TimeOut     = DateTime.Now;
            Timein      = pbhObj.TimeIn;
            ParkingSlot = pbhObj.ParkingSpace.SlotName;
            VehicleType = pbhObj.VehicleDetails.VehicleType.VehicleTypeName;
        }
Esempio n. 2
0
        public void CheckOutVehicle()
        {
            if (svDetails != null)
            {
                _dbLayerObj = new DALayer();
                ParkingBookingHistory pbhObj = new ParkingBookingHistory();
                pbhObj = _dbLayerObj.VehicleCheckOut(svDetails);

                if (ParkingTime.Hours == 0 && svDetails.VehicleTypeID == 1)
                {
                    Message = "Total Parking Fee is 20 \n" + "Parking Slot : " + ParkingSlot + " is Available";
                    pbhObj.TotalParkingFee = 20;
                }
                else if (ParkingTime.Hours == 0 && svDetails.VehicleTypeID == 2)
                {
                    Message = "Total Parking Fee is 40 \n" + "Parking Slot : " + ParkingSlot + " is Available";
                    pbhObj.TotalParkingFee = 40;
                }
                else if (ParkingTime.Hours == 1 && svDetails.VehicleTypeID == 1)
                {
                    Message = "Total Parking Fee is 40 \n" + "Parking Slot : " + ParkingSlot + " is Available";
                    pbhObj.TotalParkingFee = 40;
                }
                else if (ParkingTime.Hours == 1 && svDetails.VehicleTypeID == 2)
                {
                    Message = "Total Parking Fee is 50 \n" + "Parking Slot : " + ParkingSlot + " is Available";
                    pbhObj.TotalParkingFee = 50;
                }
                else if (ParkingTime.Hours > 1 && svDetails.VehicleTypeID == 1)
                {
                    Message = "Total Parking Fee is 60 \n" + "Parking Slot : " + ParkingSlot + " is Available";
                    pbhObj.TotalParkingFee = 60;
                }
                else if (ParkingTime.Hours > 1 && svDetails.VehicleTypeID == 2)
                {
                    Message = "Total Parking Fee is 70 \n" + "Parking Slot : " + ParkingSlot + " is Available";
                    pbhObj.TotalParkingFee = 70;
                }


                pbhObj.TimeOut       = TimeOut;
                pbhObj.OccupancyTime = ParkingTime.ToString();
                _dbLayerObj.CheckOutVehicle(pbhObj);
            }
            else
            {
                Message = "Please Select the Vehicle Number From Dropdown";
            }
        }