/** * Constructor prepares element by initializing fields and filling appointment information * * @param parent an object implementing AppointmentBoxI interface * @param booking booking model * @param time */ public appointmentBox(AppointmentBoxI parent, BookingModel booking, string time) { InitializeComponent(); this.initializeFields(parent, booking, time); this.fillInAppointmentData(); this.booking = booking; }
/** * Constructor * * @param parent a view class implementing AppointmentBoxI interface * @param booking BookingModel */ public AttendanceEditWindow(AppointmentBoxI parent, BookingModel booking) { InitializeComponent(); this.booking = booking; this.parent = parent; fillInAppointmentData(); prepareAtendanceOptionsDropDown(); this.CenterToScreen(); }
/** * Contructor is responsible for creating the object, initializing fields and calling on methods generating schedule * * @param parent class implementing AppointmentBoxI interface * @param date */ public SingleScheduleDayWindow(AppointmentBoxI parent, string date) { InitializeComponent(); controller = new ScheduleController(date); surgeryInfo = new SurgeryInfo(); this.parent = parent; this.date = date; dateInfoLabel.Text = date; generateTimeTableHeader(); generateTimeTableSlots(); timetable.CellClick += new DataGridViewCellEventHandler(dataGridView2_CellClick); }
/** * Method initializes fields with values passed as parametrs * * @param parent an object implementing AppointmentBoxI interface * @param booking booking model * @param time */ private void initializeFields(AppointmentBoxI parent, BookingModel booking, string time) { this.typeOfAppointment = booking.getStaffModel().getStaffType(); this.stafffMembersFullName = booking.getStaffModel().getFullStaffName(); if (!String.IsNullOrEmpty(booking.getComment())) { this.comment = booking.getComment(); } else { this.comment = "No comment provided"; } this.attendanceStatus = controller.getAttendanceTextPerBooking(booking); this.date = booking.getScheduleModel().getDate(); this.time = time; this.bookingId = booking.getBookingId(); this.patient = booking.getUserModel().getFirstName() + " " + booking.getUserModel().getLastName(); this.parent = parent; this.confirmation = new CancelAppointmentConfirmation(this.date, this.time, this.stafffMembersFullName, this.typeOfAppointment, this); }