public Appointments() { currentExamination = null; MyEvents.ShowMessageBoxEventHandler.CustomEvent += ShowMessageBox; MyEvents.CloseMessageBoxEventHandler.CustomEvent += CloseMessageBox; MyEvents.ShowLanguage.CustomEvent += showLanguage; MyEvents.CloseLanguage.CustomEvent += closeLanguage; var app = Application.Current as App; appointemntController = app.appointmentController; medicalRecordController = app.medicalRecordController; examinationSurgeryController = app.examinationSurgeryController; reportController = app.reportController; DateTime todaysDate = DateTime.ParseExact("01.05.2020.", "dd.MM.yyyy.", null); foreach (Appointment appointment in appointemntController.NotFinishedByDoctorAndDay(MainWindow.doctor, DateTime.Today)) { Patient patient = medicalRecordController.GetMedicalRecord(appointment.MedicalRecord.IdRecord).Patient; todayAppointments.Add(new ModelHCI.AppointmentHCI() { Gender = patient.Gender == Model.Users.Gender.FEMALE ? "ŽENSKI" : "MUŠKI", Age = ((DateTime.Today.Year - (medicalRecordController.GetMedicalRecord(appointment.MedicalRecord.IdRecord)).Patient.DateOfBirth.Year).ToString()), Date = appointment.StartTime.Date, FullName = patient.Name + " " + patient.Surname, HealthProblem = appointment.ShortDescription, appointment = appointment, RoomNumber = appointment.Room.RoomNumber, timeString = appointment.StartTime.ToString("HH:mm"), patient = new ModelHCI.Patient() { record = new ModelHCI.MedicalRecordHCI() { MedicalRecord = appointment.MedicalRecord } } }); } InitializeComponent(); SetPatients(); }
private void ButtonList_SelectionChanged(object sender, SelectionChangedEventArgs e) { int index; if (demoOn) { index = 1; } else { index = ButtonList.SelectedIndex; } if (index != -1) { if (buttoni[index].appointment.patient.record.MedicalRecord.Patient.ProfileImage != null) { Profile.Source = new BitmapImage(new Uri(buttoni[0].appointment.patient.record.MedicalRecord.Patient.ProfileImage, UriKind.Relative)); } FullName.Text = buttoni[index].appointment.FullName; DateAppointment.Text = buttoni[index].appointment.Date.ToString("dd.MM.yyyy."); StringTime.Text = buttoni[index].appointment.timeString; Record_Number.Text = buttoni[index].appointment.patient.record.MedicalRecord.IdRecord.ToString(); Gender.Text = buttoni[index].appointment.Gender; ID_Number.Text = buttoni[index].appointment.patient.record.MedicalRecord.Patient.IdentificationNumber; DateOfBirth.Text = buttoni[index].appointment.patient.record.MedicalRecord.Patient.DateOfBirth.ToString("dd.MM.yyyy."); Curr_Residence.Text = buttoni[index].appointment.patient.record.MedicalRecord.Patient.CurrResidence.City.Name; State.Text = buttoni[index].appointment.patient.record.MedicalRecord.Patient.CurrResidence.City.State.Name; MedicalRecord.Informations.currentRecord = buttoni[index].appointment.patient.record; MyEvents.ChangeInformation.RaiseMyCustomEvent(this, new MyEvents.PatientSelectionChanged()); currentExamination = buttoni[index]; currentExamination.record = buttoni[index].appointment.patient.record; recordDemo = buttoni[index].appointment.patient.record; Frejm.Navigate(new Uri("/Pages/MedicalRecord/Informations.xaml", UriKind.Relative)); } }