Exemplo n.º 1
0
        private void cbDepartement_DropDownClosed(object sender, EventArgs e)
        {
            Patient     p   = cbNSSPatient.SelectedItem as Patient;
            Departement dep = cbDepartement.SelectedItem as Departement;

            cbTypeLit.ItemsSource = MainWindow.bdHospital.TypeLits.ToList();

            if (p.DateNaissance.Value.AddYears(16) > DateTime.Today)
            {
                cbDepartement.SelectedIndex = 3;
            }
        }
Exemplo n.º 2
0
        private void cbTypeLit_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            TypeLit     tli = cbTypeLit.SelectedItem as TypeLit;
            Departement dep = cbDepartement.SelectedItem as Departement;

            try {
                cbNumeroLit.ItemsSource = MainWindow.bdHospital.Lits.Where(lit => lit.NumeroType == tli.NumeroType & lit.IdDepartement == dep.IdDepartement & lit.Occupe == false).ToList();
            }
            catch (Exception) {
                cbNumeroLit.ItemsSource = null;
            }
        }
Exemplo n.º 3
0
        public int typeLitFact(int typeUser)
        {
            int         res     = 1;
            Departement Dep     = cbDepartement.SelectedItem as Departement;
            List <Lit>  listlit = MainWindow.bdHospital.Lits.Where(l => l.IdDepartement == Dep.IdDepartement & l.Occupe == false).ToList();

            for (int i = 0; i < listlit.Count - 1; i++)
            {
                if (listlit[i].NumeroType < typeUser)
                {
                    res = typeUser;
                }
            }
            return(res);
        }