private void Button_Click_1(object sender, RoutedEventArgs e) { 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 therapy = 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 + ":" + therapy + ";"; ap.EditPatientCard(pc); } catch (Exception ex) { MessageBox.Show(ex.Message); } var s = new ScheduleExaminaton(); s.Show(); txtbox2.Clear(); txtbox3.Clear(); }
private void Button_Click_4(object sender, RoutedEventArgs e) { string s = dateTherapy.SelectedDate.ToString(); string[] lines = s.Split(' '); string datum = lines[0]; 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(txtPrescribe.Text)) { MessageBox.Show("Morate unijeti dnevnu dozu lijeka.", "Upozorenje!", MessageBoxButton.OK, MessageBoxImage.Warning); txtPrescribe.Clear(); txtPrescribe.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; } else if (String.IsNullOrEmpty(datum)) { MessageBox.Show("Morate izabrati datum do kog pacijent treba da koristi terapiju.", "Upozorenje!", MessageBoxButton.OK, MessageBoxImage.Warning); dateTherapy.Focus(); return; } int idTherapy = tc.getLastId(); Therapy therapy = new Therapy(); therapy.drug = drugSelected; therapy.patientCard = patientCard; therapy.StartDate = DateTime.Now; therapy.EndDate = (DateTime)dateTherapy.SelectedDate; therapy.DailyDose = Int32.Parse(txtPrescribe.Text); therapy.Anamnesis = txtbox2.Text; therapy.Id = ++idTherapy; tc.AddTherapy(therapy); Notification n = new Notification(); int idNotification = nc.getLastId(); n.Id = ++idNotification; n.Type = TypeOfNotification.Terapija; n.JmbgOfReceiver = patientCard.patient.Jmbg; n.Message = "Nova terapija: " + drugSelected.Name; nc.SendNotification(n); 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; }
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; }