Exemplo n.º 1
0
        void LoadBooking()
        {
//            List<DTO.Booking> bookList = BookDAO.Instance.LoadBookList();

            BookingInformation bookInfo = new BookingInformation();
            DateTime           from     = DateTime.Now;
            DateTime           to       = from.AddDays(4);

            bookInfo = bookingInformation1;
            bookInfo.setBookingInfo(17, "103", 123, 1, "Nguyen Cuong", 400, from, to);
            bookInfo.getDays(from, to);

            /*foreach(Booking item in bookList){
             *  BookingInformation bookInfo = new bookingInformation();
             *  bookInfo = bookingInformation1;
             *
             * }*/
        }
Exemplo n.º 2
0
        public void btnClose_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            BookingInformation bookingInfo = null;

            foreach (Control c in this.Parent.Controls)
            {
                bookingInfo = c as BookingInformation;
                if (bookingInfo != null)
                {
                    break;
                }
            }

            if (bookingInfo != null)
            {
                bookingInfo.Visible = true;
            }
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
            }
        }