Exemplo n.º 1
0
        private bool AddLastBooking(Booking LastBooking)
        {
            //get last BookingID add them booking_room & + them payment!
            bool rs1 = ManagerDAL.AddNewRoomBooking(LastBooking.BookingID, CurrentRoom.RoomNumber);

            float newCost = CalcuDays(LastBooking.CheckIn, LastBooking.CheckOut, LastBooking.Breakfirst, LastBooking.Nights) + LastBooking.Amount;
            float newPaid = newCost * 0.3f;
            //lay fromDay & toDay cu, lay 2 gia cu de update
            bool rs2 = ManagerDAL.UpdatePaymentCost(LastBooking.BookingID, newCost, newPaid);

            if (rs1 && rs2)
            {
                ManagerDAL.AddNewLog(new Log()
                {
                    StaffID = StaffID, ActionTime = DateTime.Now,
                    Main    = "Booking the room: " + CurrentRoom.RoomNumber.ToString() + "to: " + LastBooking.BookingID
                });

                return(true);
            }
            else
            {
                return(false);
            }
        }