예제 #1
0
        void LoadGuest()
        {
            GuestBUS     gdb       = new GuestBUS();
            List <Guest> guestList = gdb.getAllGuestStay();

            editGuestInfo edit = new editGuestInfo();

            edit = editGuestInfo1;
            edit.setEditGuestInfo("Nguyen Cuong", 225677720, "Agoda", "VN", "0928 526 240");

            /*foreach(Guest item in guestList){
             *   editGuestInfo edit = new editGuestInfo();
             *   edit = editGuestInfo1;
             *
             * }*/
        }
예제 #2
0
        public void btnEdit_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            editGuestInfo editGuest = new editGuestInfo();

            editGuest.Visible = true;
            foreach (Control c in this.Parent.Controls)
            {
                editGuest = c as editGuestInfo;
                if (editGuest != null)
                {
                    break;
                }
            }

            if (editGuest != null)
            {
                editGuest.Visible = true;
            }
        }
예제 #3
0
        public void loadInfo(DTO.Booking b)
        {
            Appointment app  = schedulerStorage1.CreateAppointment(AppointmentType.Normal);
            BookingBUS  bBus = new BookingBUS();
            GuestBUS    gBUS = new GuestBUS();
            RoomBUS     rBUS = new RoomBUS();
            string      id   = b.BookingID.ToString();
            Guest       g    = gBUS.getGuestByID(b.GuestID);
            Room        r    = rBUS.getRoomByID(b.RoomID);
            RoomType    rt   = rBUS.getRoomTypeByID(r.RoomType);

            String roomID = b.RoomID;
            String name   = g.FullName.Trim();
            int    bookID = b.BookingID;
            string typeID = r.RoomType;
            //Console.WriteLine(g.FullName);

            string   guestID  = b.GuestID;
            int      status   = r.Status;
            string   bookType = b.BookingTypeID.Trim();
            DateTime checkIn  = app.Start;
            DateTime checkOut = b.CheckOut;
            int      price    = rt.Price;



            editGuestInfo edit = new editGuestInfo();

            edit = editGuestInfo1;
            edit.guestNameTextBox.Text = name;
            edit.guestIdTextBox.Text   = guestID;
            edit.dateOfBirth.Text      = g.DOB.ToString();
            edit.nationTextBox.Text    = g.Nationality;

            BookingInformation bookInfo = new BookingInformation();

            bookInfo = bookingInformation1;
            bookInfo.daysLabel.Text        = bookInfo.getDays(checkIn, checkOut);
            bookInfo.bookID.Text           = bookID.ToString();
            bookInfo.nationTB.Text         = g.Nationality;
            bookInfo.roomTypeComboBox.Text = typeID;


            bookInfo.guestNameLabel.Text = name;
            bookInfo.roomIdLabel.Text    = "Room" + roomID;

            if (bookType.Equals("001"))
            {
                bookInfo.bookingTypeCombobox.Text = "AGODA";
            }
            else if (bookType.Equals("002"))
            {
                bookInfo.bookingTypeCombobox.Text = "BOOKING";
            }
            else
            {
                bookInfo.bookingTypeCombobox.Text = "FREE";
            }
            //bookInfo.bookingTypeCombobox.Text

            switch (status)
            {
            case 1:
                bookInfo.statusComboBox.Text = "Reserved";
                break;

            case 2:
                bookInfo.statusComboBox.Text = "Occupied";
                break;

            case 3:
                bookInfo.statusComboBox.Text = "Checked-out";
                break;

            default:
                bookInfo.statusComboBox.Text = "Available";
                break;
            }

            bookInfo.fromDateLabel.Text = checkIn.ToString("dd.MM.yyyy");
            bookInfo.toDayLabel.Text    = checkOut.ToString("dd.MM.yyyy");
            bookInfo.priceLabel.Text    = price.ToString();
        }
예제 #4
0
        private void gridControl1_Click(object sender, EventArgs e)
        {
            bookingInformation1.Visible = true;
            newBooking1.Visible         = false;
            if (gridView1.GetFocusedRowCellValue("bookingID") != null)
            {
                string      id     = gridView1.GetFocusedRowCellValue("bookingID").ToString();
                string      typeid = gridView1.GetFocusedRowCellValue("bookingTypeID").ToString();
                BookingBUS  bBus   = new BookingBUS();
                GuestBUS    gBUS   = new GuestBUS();
                RoomBUS     rBUS   = new RoomBUS();
                DTO.Booking b      = bBus.getBookingByID(id, typeid);
                Guest       g      = gBUS.getGuestByID(b.GuestID);
                Room        r      = rBUS.getRoomByID(b.RoomID);
                RoomType    rt     = rBUS.getRoomTypeByID(r.RoomType);

                int      bookID    = b.BookingID;
                string   guestID   = b.GuestID;
                string   typeID    = r.RoomType;
                String   guestName = g.FullName.Trim();
                String   roomID    = b.RoomID;
                int      status    = r.Status;
                string   bookType  = b.BookingTypeID.Trim();
                DateTime checkIn   = b.CheckIn;
                DateTime checkOut  = b.CheckOut;
                int      price     = rt.Price;
                string   roomType  = r.RoomType;


                editGuestInfo edit = new editGuestInfo();
                edit = editGuestInfo1;
                edit.guestNameTextBox.Text = guestName;
                edit.guestIdTextBox.Text   = guestID;
                edit.dateOfBirth.Text      = g.DOB.ToString();
                edit.nationTextBox.Text    = g.Nationality;

                BookingInformation bookInfo = new BookingInformation();

                bookInfo = bookingInformation1;
                bookInfo.daysLabel.Text        = bookInfo.getDays(checkIn, checkOut);
                bookInfo.bookID.Text           = bookID.ToString();
                bookInfo.nationTB.Text         = g.Nationality;
                bookInfo.roomTypeComboBox.Text = typeID;


                bookInfo.guestNameLabel.Text = guestName;
                bookInfo.roomIdLabel.Text    = "Room" + roomID;

                if (bookType.Equals("001"))
                {
                    bookInfo.bookingTypeCombobox.Text = "AGODA";
                }
                else if (bookType.Equals("002"))
                {
                    bookInfo.bookingTypeCombobox.Text = "BOOKING";
                }
                else
                {
                    bookInfo.bookingTypeCombobox.Text = "FREE";
                }
                //bookInfo.bookingTypeCombobox.Text

                switch (status)
                {
                case 1:
                    bookInfo.statusComboBox.Text = "Reserved";
                    break;

                case 2:
                    bookInfo.statusComboBox.Text = "Occupied";
                    break;

                case 3:
                    bookInfo.statusComboBox.Text = "Checked-out";
                    break;

                default:
                    bookInfo.statusComboBox.Text = "Available";
                    break;
                }

                bookInfo.fromDateLabel.Text = checkIn.ToString("dd.MM.yyyy");
                bookInfo.toDayLabel.Text    = checkOut.ToString("dd.MM.yyyy");
                PayBUS pBUS = new PayBUS();
                bookInfo.priceLabel.Text = pBUS.getTotalPrice(b).ToString();
            }
        }