public SingleResponse <RoomType> GetDailyValueByRoomTypeID(int id)
        {
            SingleResponse <RoomType> responseProducts = roomTypeDAO.GetDailyValueByRoomTypeID(id);

            RoomType room = new RoomType();

            room.DailyValue.ToString("C2");

            return(responseProducts);
        }
Ejemplo n.º 2
0
        public void PenaltyCalculation(CheckinClient checkin, CheckoutClient checkout)
        {
            if (checkin.ExitDate == checkout.ExitDate)
            {
                checkout.ExitOnTime = true;
                checkout.Penalty    = 0;
            }
            else if (checkin.ExitDate > checkout.ExitDate)
            {
                checkout.ExitOnTime = true;
                checkout.Penalty    = 0;
            }
            else
            {
                int roomTypeID = Convert.ToInt32(roomDAO.GetRoomTypeIDByRoomID(checkin.RoomID).Data);

                double dailyValue = Convert.ToDouble(roomTypeDAO.GetDailyValueByRoomTypeID(roomTypeID).Data);

                int days = checkout.ExitDate.Day - checkin.ExitDate.Day;

                checkout.ExitOnTime = false;
                checkout.Penalty    = dailyValue * days;
            }
        }