Beispiel #1
0
        public static bool removeBenh(String loai)
        {
            Benh benh = null;

            using (var context = new DataModel())
            {
                benh = context.Benhs.Find(loai);
                context.Benhs.Remove(benh);
                context.SaveChanges();
            }
            return(benh == null);
        }
Beispiel #2
0
        private void ThemBenhBtn_Click(object sender, RoutedEventArgs e)
        {
            Benh           benh   = new Benh();
            ThemBenhDialog dialog = new ThemBenhDialog(benh, false);

            if (dialog.ShowDialog() == true)
            {
                int res = Bussiness.addOrUpdateBenh(benh.LoaiBenh, benh.TrieuChung);
                if (res == 1)
                {
                    benhs.Add(benh.LoaiBenh);
                }
            }
        }
Beispiel #3
0
        private void BenhComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (Bussiness.currentLuotKhamID == -1)
            {
                return;
            }
            if ((BenhComboBox.SelectedItem as string).Equals("unidentified"))
            {
                Bussiness.updateLuotKham(Bussiness.currentLuotKhamID, "unidentified");
            }
            Benh benh = BenhDAO.getBenh(BenhComboBox.SelectedItem as string);

            TrieuChungTxtBlock.Text = benh.TrieuChung;
            Bussiness.updateLuotKham(Bussiness.currentLuotKhamID, benh.LoaiBenh);
        }
Beispiel #4
0
 public static bool containsSymptom(Benh benh, String trieuchung)
 {
     return(benh.TrieuChung.Contains(trieuchung));
 }