Esempio n. 1
0
        private void btnAddBooking_Click(object sender, EventArgs e)
        {
            if (bookingRoomDetails.Count == 0)
            {
                MessageBox.Show("Please add booking room", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            var newBooking = new BookingDTO()
            {
                BookingId  = BookingBUS.NextId(),
                EmployeeId = this.employee.EmployeeId,
                Customer   = new CustomerDTO()
                {
                    CustomerId = CustomerBUS.NextId(),
                    Name       = txtName.Text,
                    Address    = txtAddress.Text,
                    Phone      = txtPhone.Text,
                    Fax        = txtFax.Text,
                    Telex      = txtTelex.Text
                },
                CreatedDate    = DateTime.Now,
                BookingDetails = this.bookingRoomDetails
            };

            newBooking.BookingDetails.ForEach(b => b.Room = null);
            BookingBUS.AddBooking(newBooking);
            this.bookingDTOBindingSource.DataSource = BookingBUS.GetBookings();
            this.ReloadGridViewRoomAndBookingDetail();
        }
Esempio n. 2
0
        public void NextBookingIdTest_TC2()
        {
            var actual   = BookingBUS.NextId();
            var expected = "B0003";

            Assert.AreEqual(expected, actual);
        }