Beispiel #1
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";
            }
        }
        /// <summary>
        /// Returns true if RequestTransportation instances are equal
        /// </summary>
        /// <param name="other">Instance of RequestTransportation to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RequestTransportation other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||

                     Type.Equals(other.Type)
                     ) &&
                 (
                     PtChangeDelay == other.PtChangeDelay ||

                     PtChangeDelay.Equals(other.PtChangeDelay)
                 ) &&
                 (
                     WalkingTime == other.WalkingTime ||

                     WalkingTime.Equals(other.WalkingTime)
                 ) &&
                 (
                     DrivingTimeToStation == other.DrivingTimeToStation ||

                     DrivingTimeToStation.Equals(other.DrivingTimeToStation)
                 ) &&
                 (
                     ParkingTime == other.ParkingTime ||

                     ParkingTime.Equals(other.ParkingTime)
                 ) &&
                 (
                     BoardingTime == other.BoardingTime ||

                     BoardingTime.Equals(other.BoardingTime)
                 ));
        }
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + Type.GetHashCode();

                hashCode = hashCode * 59 + PtChangeDelay.GetHashCode();

                hashCode = hashCode * 59 + WalkingTime.GetHashCode();

                hashCode = hashCode * 59 + DrivingTimeToStation.GetHashCode();

                hashCode = hashCode * 59 + ParkingTime.GetHashCode();

                hashCode = hashCode * 59 + BoardingTime.GetHashCode();
                return(hashCode);
            }
        }