public PatienFileTab(string patientName, Doctor doctor, int id) { InitializeComponent(); idExam = id; txtbox1.Text = DateTime.Now.ToShortDateString(); logInDoctor.Text = doctor.Username; d = doctor; showName.Text = patientName; name = patientName; PatientCard pc = new PatientCard(); string[] ss = showName.Text.Split(' '); pc = ap.ViewPatientCard(ss[ss.Length - 1]); patientCard = pc; txtAlergije.Text = pc.Alergies; txtDatumRodjenja.Text = pc.patient.DateOfBirth.ToShortDateString(); txtKrvnaGrupa.Text = pc.BloodType.ToString(); txtRhFaktor.Text = pc.RhFactor.ToString(); txtLbo.Text = pc.Lbo.ToString(); List <Drug> drugs = new List <Drug>(); drugs = dcon.ViewConfirmedDrugs(); List <DrugDTO> dDTOs = new List <DrugDTO>(); foreach (Drug d in drugs) { DrugDTO dDTO = new DrugDTO(); dDTO.Id = d.Id; dDTO.Name = d.Name; dDTO.Quantity = d.Quantity; dDTO.drugType = d.drugType.Type; dDTOs.Add(dDTO); } DataGrid3.ItemsSource = dDTOs; //po default-u danasnji datum dataExam.SelectedDate = DateTime.Today.Date; dataExam.DisplayDateStart = DateTime.Today; dataExam.DisplayDateEnd = (new DateTime(2020, 12, 31)); //dataOd.SelectedDate = DateTime.Today.Date; //da.DisplayDateStart = DateTime.Today; dataOd.SelectedDate = DateTime.Today.Date; dataOd.DisplayDateEnd = (new DateTime(2020, 12, 31)); dataDo.DisplayDateEnd = (new DateTime(2020, 12, 31)); //po default-u prva smjena first.IsSelected = true; // opsti.IsSelected = true; }
public DrugDTO(DrugDTO d) { this.ingredient = d.ingredient; this.drugType = d.drugType; this.Name = d.Name; this.Id = d.Id; this.Quantity = d.Quantity; this.ExpirationDate = d.ExpirationDate; this.Producer = d.Producer; }
private void txtSearch_KeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { string unos = txtSearch.Text; List <Drug> searchedDrugs = new List <Drug>(); List <Drug> drugs = dcon.ViewConfirmedDrugs(); List <DrugDTO> dDTOs = new List <DrugDTO>(); if (unos.Equals("")) { foreach (Drug d in drugs) { DrugDTO dDTO = new DrugDTO(); dDTO.Id = d.Id; dDTO.Name = d.Name; dDTO.Quantity = d.Quantity; dDTO.drugType = d.drugType.Type; dDTOs.Add(dDTO); } DataGrid3.ItemsSource = dDTOs; return; } foreach (Drug d in drugs) { if (d.Name.ToUpper().Contains(unos.ToUpper())) { searchedDrugs.Add(d); } } foreach (Drug d in searchedDrugs) { DrugDTO dDTO = new DrugDTO(); dDTO.Id = d.Id; dDTO.Name = d.Name; dDTO.Quantity = d.Quantity; dDTO.drugType = d.drugType.Type; dDTOs.Add(dDTO); } DataGrid3.ItemsSource = dDTOs; } }
private void Button_Click_3(object sender, RoutedEventArgs e) { if (String.IsNullOrEmpty(txtDrug.Text)) { MessageBox.Show("Morate selektovati lijek u tabeli koji želite propisati.", "Upozorenje!", MessageBoxButton.OK, MessageBoxImage.Warning); txtDrug.Focus(); return; } else if (String.IsNullOrEmpty(txtbox2.Text)) { MessageBox.Show("Morate unijeti tok bolesti na prethodnom tabu.", "Upozorenje!", MessageBoxButton.OK, MessageBoxImage.Warning); txtbox2.Clear(); txtbox2.Focus(); return; } drugSelected.Quantity = --drugQuantity; dcon.EditConfirmedDrug(drugSelected); List <Drug> drugs = new List <Drug>(); drugs = dcon.ViewConfirmedDrugs(); List <DrugDTO> dDTOs = new List <DrugDTO>(); foreach (Drug d in drugs) { DrugDTO dDTO = new DrugDTO(); dDTO.Id = d.Id; dDTO.Name = d.Name; dDTO.Quantity = d.Quantity; dDTO.drugType = d.drugType.Type; dDTOs.Add(dDTO); } DataGrid3.ItemsSource = dDTOs; if (String.IsNullOrEmpty(txtbox2.Text)) { MessageBox.Show("Morate unijeti tok bolesti.", "Upozorenje!", MessageBoxButton.OK, MessageBoxImage.Warning); txtbox2.Clear(); txtbox2.Focus(); return; } else if (String.IsNullOrEmpty(txtbox3.Text)) { MessageBox.Show("Morate unijeti terapiju", "Upozorenje!", MessageBoxButton.OK, MessageBoxImage.Warning); txtbox3.Clear(); txtbox3.Focus(); return; } try { string date = txtbox1.Text; string disease = txtbox2.Text; string therapy11 = txtbox3.Text; PatientCard pc = new PatientCard(); string[] ss = showName.Text.Split(' '); pc = ap.ViewPatientCard(ss[ss.Length - 1]); string mh = pc.MedicalHistory; pc.MedicalHistory = mh + date + ":" + disease + ":" + therapy11 + ";"; ap.EditPatientCard(pc); } catch (Exception ex) { MessageBox.Show(ex.Message); } ScheduleExaminaton win = new ScheduleExaminaton(); win.Show(); txtbox2.Clear(); txtbox3.Clear(); drugSelCell = -1; }