public void LoadSchedule(DTO.Booking b) { 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); schedulerControl1.ActiveViewType = DevExpress.XtraScheduler.SchedulerViewType.Month; schedulerControl1.OptionsCustomization.AllowInplaceEditor = DevExpress.XtraScheduler.UsedAppointmentType.None; String roomID = b.RoomID; String name = g.FullName.Trim(); DateTime checkin = b.CheckIn; DateTime checkout = b.CheckOut; Appointment app = schedulerStorage1.CreateAppointment(AppointmentType.Normal); DateTime start = checkin; DateTime end = checkout; app.Start = start; app.End = end; app.AllDay = false; app.LabelKey = 3; app.StatusKey = 1; app.Subject = "Room " + roomID + " - " + name; app.SetId(id); schedulerStorage1.Appointments.Add(app); }
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(); }
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(); } }