コード例 #1
0
        private void LichSuXemBNBtn_Click(object sender, RoutedEventArgs e)
        {
            BenhNhan           bn     = LuotKhamDAO.getLuotKham((LichSuKhamListView.SelectedItem as LuotKham).ID).BenhNhan1;
            ThemLuotKhamDialog dialog = new ThemLuotKhamDialog(bn, 2);

            dialog.ShowDialog();
        }
コード例 #2
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;
                    }
                }
            }
        }
コード例 #3
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"));
            }
        }