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 DrugsView() { InitializeComponent(); this.DataContext = this; Lekovi = new ObservableCollection <Lek>(); TempLekovi = new ObservableCollection <Lek>(); Kriterijumi = new ObservableCollection <string>(); Kriterijumi.Add("Naziv"); Kriterijumi.Add("Sifra"); SifraTb.IsEnabled = true; List <Drug> confirmedDrugs = dc.ViewConfirmedDrugs(); List <Drug> unconfirmedDrugs = dc.ViewUnconfirmedDrugs(); List <Ingredient> ingredients = new List <Ingredient>(); ingredients = dt.ViewIngridients(); List <string> ingStr = new List <string>(); foreach (Ingredient i in ingredients) { ingStr.Add(i.Name); } listBox1.DataContext = ingStr; List <DrugType> drugTypes = new List <DrugType>(); List <string> drugTypesStr = new List <string>(); drugTypes = dt.ViewDrugTypes(); foreach (DrugType d in drugTypes) { drugTypesStr.Add(d.Type); } TipTb.DataContext = drugTypesStr; if (confirmedDrugs != null) { foreach (Drug d in confirmedDrugs) { Lek lek = new Lek(); lek.Naziv = d.Name; lek.Kolicina = d.Quantity; lek.Proizvodjac = d.Producer; lek.RokTrajanja = d.ExpirationDate; lek.Sifra = d.Id; lek.Sastav = new List <string>(); foreach (Ingredient a in d.ingredient) { lek.Sastav.Add(a.Name); } lek.Tip = d.drugType.Type; Lekovi.Add(lek); } } if (unconfirmedDrugs != null) { foreach (Drug d in unconfirmedDrugs) { Lek lek = new Lek(); lek.Naziv = d.Name; lek.Kolicina = d.Quantity; lek.Proizvodjac = d.Producer; lek.RokTrajanja = d.ExpirationDate; lek.Sifra = d.Id; lek.Sastav = new List <string>(); foreach (Ingredient a in d.ingredient) { lek.Sastav.Add(a.Name); } lek.Tip = d.drugType.Type; Lekovi.Add(lek); } } //Lekovi.Add(new Lek() { Naziv = "Brufen\nBrufen\nBrufen\nBrufen\nBrufen\nBrufen\n", Kolicina = "3", Sifra = "djna" }); //Lekovi.Add(new Lek() { Naziv = "Para", Kolicina = "30", Sifra = "aadjna" }); //Lekovi.Add(new Lek() { Naziv = "AAAAA", Kolicina = "40", Sifra = "jdjna" }); //Lekovi.Add(new Lek() { Naziv = "Wbdk", Kolicina = "4000", Sifra = "ccdjna" }); //Lekovi.Add(new Lek() { Naziv = "Cjdla", Kolicina = "50", Sifra = "aadjna" }); foreach (var lek in Lekovi) { TempLekovi.Add(lek); } SelectedKriterijum = Kriterijumi[0]; NazivHint = "Unesi tekst"; KolicinaHint = "Unesi broj"; NamenaHint = "Unesi tekst"; SifraHint = "Unesi broj"; RokHint = "Izaberi datum"; TipHint = "Unesi tekst"; ProizvodjacHint = "Unesi tekst"; SastavHint = "Unesi tekst"; PretragaHint = "Unesi tekst za pretragu"; SelektovaniLek = null; }