コード例 #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();
        }
コード例 #2
0
ファイル: CustomerBUSTests.cs プロジェクト: baotoq/SE
        public void NextCustomerIdTest_TC2()
        {
            var actual   = CustomerBUS.NextId();
            var expected = "C0003";

            Assert.AreEqual(expected, actual);
        }