Esempio n. 1
0
 private void LichSuKhamTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Return)
     {
         Bussiness.getLichSuKham(LichSuKhamTextBox.Text);
     }
 }
Esempio n. 2
0
 private void ThongKeThuocTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Return)
     {
         Bussiness.getThongKeThuoc(ThongKeThuocTextBox.Text);
     }
 }
Esempio n. 3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            bool isObserve = false;

            if (Bussiness.currentLuotKhamID == -1)
            {
                isObserve = true;
            }
            LuotThuoc lt = new LuotThuoc();

            lt.LuotKham = Bussiness.currentLuotKhamID;
            lt.Thuoc    = (ThemThuocListView.SelectedItem as Thuoc).TenThuoc;
            ThemLuotThuocDialog dialog = new ThemLuotThuocDialog(lt, isObserve);

            if (dialog.ShowDialog() == true)
            {
                try
                {
                    Bussiness.addLuotThuoc(lt.Thuoc, (int)lt.SoLuong);
                    LuotKham lk = LuotKhamDAO.getLuotKham(Bussiness.currentLuotKhamID);
                    TienKhamTxtBlock.Text          = "Tien kham: " + lk.TienKham.ToString();
                    TienThuocTxtBlock.Text         = "Tien thuoc: " + lk.TienThuoc.ToString();
                    TongChiPhiTxtBlock.Text        = "Tong chi phi: " + lk.ChiPhi.ToString();
                    ThongTinLuotKhamTab.IsSelected = true;
                }
                catch (Exception ex) { MessageBox.Show(ex.ToString()); }
            }
        }
Esempio n. 4
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            Bussiness.removeLuotThuoc((LuotThuocListView.SelectedItem as LuotThuoc).ID);
            LuotKham lk = LuotKhamDAO.getLuotKham(Bussiness.currentLuotKhamID);

            TienKhamTxtBlock.Text   = "Tien kham: " + lk.TienKham.ToString();
            TienThuocTxtBlock.Text  = "Tien thuoc: " + lk.TienThuoc.ToString();
            TongChiPhiTxtBlock.Text = "Tong chi phi: " + lk.ChiPhi.ToString();
        }
Esempio n. 5
0
        private void LuotKhamRemoveBtn_Click(object sender, RoutedEventArgs e)
        {
            if (DSLuotKhamListView.SelectedIndex == -1)
            {
                return;
            }
            resetLuotKhamTab();
            BenhNhan bn = DSLuotKhamListView.SelectedItem as BenhNhan;
            LuotKham lk = LuotKhamDAO.getLuotKhamBaseOnDateAndPatient(DateTime.Today.ToString("dd/MM/yyyy"), bn.CMND);

            Bussiness.removeLuotKham(lk.ID);
        }
Esempio n. 6
0
        private void ThongKeDoanhThuBtn_Click(object sender, RoutedEventArgs e)
        {
            Bussiness.getThongKeDoanhThu(ThongKeDoanhThuTextBox.Text);
            double tongDoanhThu   = 0;
            int    tongSoBenhNhan = 0;

            foreach (ThongKeLuotKham tk in Bussiness.listThongKeLuotkham)
            {
                tongDoanhThu   += tk.doanhThu;
                tongSoBenhNhan += tk.soBenhNhan;
            }
            DoanhThuThangTxtBlock.Text = "Tong doanh thu: " + tongDoanhThu + " - Tong luot kham: " + tongSoBenhNhan;
        }
Esempio n. 7
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);
                }
            }
        }
Esempio n. 8
0
 private void OKBtn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Bussiness.tienKham        = double.Parse(TienKhamTxt.Text.ToString());
         Bussiness.gioiHanLuotKham = int.Parse(GioiHanTxt.Text.ToString());
         Bussiness.saveSettings();
         MessageBox.Show("Thay doi cai dat thanh cong!");
     }
     catch (Exception ex) {
         MessageBox.Show("Cac gia tri khong hop le!");
         return;
     }
 }
Esempio n. 9
0
        private void ThemThuocBtn_Click(object sender, RoutedEventArgs e)
        {
            Thuoc           thuoc  = new Thuoc();
            ThemThuocDialog dialog = new ThemThuocDialog(thuoc);

            if (dialog.ShowDialog() == true)
            {
                try
                {
                    int res = Bussiness.addOrUpdateThuoc(thuoc.TenThuoc, thuoc.DonVi, thuoc.CachDung, (double)thuoc.DonGia);
                }
                catch (Exception ex) { MessageBox.Show(ex.ToString()); }
            }
        }
Esempio n. 10
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);
        }
Esempio n. 11
0
 private void ThongKeDoanhThuTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Return)
     {
         Bussiness.getThongKeDoanhThu(ThongKeDoanhThuTextBox.Text);
         double tongDoanhThu   = 0;
         int    tongSoBenhNhan = 0;
         foreach (ThongKeLuotKham tk in Bussiness.listThongKeLuotkham)
         {
             tongDoanhThu   += tk.doanhThu;
             tongSoBenhNhan += tk.soBenhNhan;
         }
         DoanhThuThangTxtBlock.Text = "Tong doanh thu: " + tongDoanhThu + " - Tong luot kham: " + tongSoBenhNhan;
     }
 }
Esempio n. 12
0
 private void ThemDonViTxt_Click(object sender, RoutedEventArgs e)
 {
     if (DonViTxt.Text.ToString().Equals(""))
     {
         return;
     }
     if (Bussiness.donViThuoc.Contains(DonViTxt.Text.ToString()))
     {
         MessageBox.Show("Loai don vi thuoc nay da ton tai!");
         return;
     }
     Bussiness.donViThuoc.Add(DonViTxt.Text.ToString());
     Bussiness.saveSettings();
     DonViTxt.Text = "";
     MessageBox.Show("Them don vi thuoc thanh cong!");
 }
Esempio n. 13
0
 private void start()
 {
     Bussiness.init();
     DSLuotKhamListView.ItemsSource      = Bussiness.listBenhNhan;
     LichSuKhamListView.ItemsSource      = Bussiness.listLuotKhamTrongNgay;
     ThongKeDoanhThuListView.ItemsSource = Bussiness.listThongKeLuotkham;
     ThongKeThuocListView.ItemsSource    = Bussiness.listThongKeLuotThuoc;
     ThemThuocListView.ItemsSource       = Bussiness.bindingListAllThuoc;
     LuotThuocListView.ItemsSource       = Bussiness.listLuotThuoc;
     benhs = new BindingList <string>();
     foreach (Benh b in Bussiness.listAllBenh)
     {
         benhs.Add(b.LoaiBenh);
     }
     BenhComboBox.ItemsSource = benhs;
     setUpTrieuChung();
 }
Esempio n. 14
0
        private void ChanDoanBenhBtn_Click(object sender, RoutedEventArgs e)
        {
            string temp  = "";
            int    index = 0;

            for (int i = 0; i < listTrieuChung.Count; i++)
            {
                if ((bool)listTrieuChung.ElementAt(i).IsChecked)
                {
                    if (index != 0)
                    {
                        temp += " - ";
                    }
                    temp += listTrieuChung.ElementAt(i).Content;
                    index++;
                }
            }
            ChanDoanBenhTextBlock.Text = Bussiness.ChanDoanBenh(temp);
        }
Esempio n. 15
0
        private void UpdateUserInfoBtn_Click(object sender, RoutedEventArgs e)
        {
            BenhNhan           bn     = LuotKhamDAO.getLuotKham(Bussiness.currentLuotKhamID).BenhNhan1;
            ThemLuotKhamDialog dialog = new ThemLuotKhamDialog(bn, 1);

            if (dialog.ShowDialog() == true)
            {
                Bussiness.addOrUpdateBenhNhan(bn.CMND, bn.HoTen, bn.SDT, bn.DiaChi, (byte)bn.GioiTinh);
                UserInfoTxtBlock.Text = bn.HoTen;
                foreach (BenhNhan b in Bussiness.listBenhNhan)
                {
                    if (b.CMND.Equals(bn.CMND))
                    {
                        b.diachi1   = bn.DiaChi;
                        b.sdt1      = bn.SDT;
                        b.gioitinh1 = (byte)bn.GioiTinh;
                        b.hoten1    = bn.HoTen;
                    }
                }
            }
        }
Esempio n. 16
0
        private void ThemTrieuChungTxt_Click(object sender, RoutedEventArgs e)
        {
            if (TrieuChungTxt.Text.ToString().Equals(""))
            {
                return;
            }
            if (Bussiness.trieuChung.Contains(TrieuChungTxt.Text.ToString()))
            {
                MessageBox.Show("Loai trieu chung nay da ton tai!");
                return;
            }
            Bussiness.trieuChung.Add(TrieuChungTxt.Text.ToString());
            Bussiness.saveSettings();
            CheckBox box = new CheckBox();

            box.Content = TrieuChungTxt.Text.ToString();
            list.Add(box);
            panel.Children.Add(box);
            TrieuChungTxt.Text = "";
            MessageBox.Show("Them trieu chung thanh cong!");
        }
Esempio n. 17
0
        private void ThemBenhNhanBtn_Click(object sender, RoutedEventArgs e)
        {
            if (Bussiness.listBenhNhan.Count > Bussiness.gioiHanLuotKham)
            {
                MessageBox.Show("So luong ca kham hom nay da vuot qua gioi han!");
                return;
            }
            BenhNhan           bn     = new BenhNhan();
            ThemLuotKhamDialog dialog = new ThemLuotKhamDialog(bn, 0);

            if (dialog.ShowDialog() == true)
            {
                foreach (BenhNhan b in Bussiness.listBenhNhan)
                {
                    if (b.CMND.Equals(bn.CMND))
                    {
                        MessageBox.Show("Benh nhan nay da duoc kham trong hom nay!");
                        return;
                    }
                }
                Bussiness.addOrUpdateBenhNhan(bn.CMND, bn.HoTen, bn.SDT, bn.DiaChi, (byte)bn.GioiTinh);
                Bussiness.addLuotKham(bn.CMND, DateTime.Today.ToString("dd/MM/yyyy"));
            }
        }
Esempio n. 18
0
 private void LichSuKhamBtn_Click(object sender, RoutedEventArgs e)
 {
     Bussiness.getLichSuKham(LichSuKhamTextBox.Text);
 }
Esempio n. 19
0
 private void ThongKeThuocBtn_Click(object sender, RoutedEventArgs e)
 {
     Bussiness.getThongKeThuoc(ThongKeThuocTextBox.Text);
 }