Example #1
0
        private void btnThemCTDV_Click(object sender, RoutedEventArgs e)
        {
            // kiểm tra combobox phải có chọn dữ liệu
            DichVu dv = (DichVu)cmbDichVu.SelectedItem;

            if (cmbDichVu.SelectedValue.ToString() == "-1" || dv == null)
            {
                MessageBox.Show("Phải chọn dịch vụ!");
                return;
            }
            // kiểm tra dịch vụ vẫn chưa có trong dsCT
            foreach (CTDKDichVu b in dsCTDKDV)
            {
                if (b.DichVuID == dv.IDDichVu)
                {
                    MessageBox.Show("Đã tồn tại dịch vụ này trong chi tiết!");
                    return;
                }
            }
            CTDKDichVu ct = new CTDKDichVu();

            ct.DichVu = dv;
            dsCTDKDV.Add(ct);
            dgCTDKDV.ItemsSource = xlPDKK.getDSPhieuDKKhamByDS(dsCTDKDV).ToList();
        }
Example #2
0
        private void getDS()
        {
            if (Common.maPhongBacSi != null)
            {
                dgPDKK.ItemsSource       = xlPDDK.getDSPhieuDKKhamByDS(xlPDDK.getDSPDKKChuaKham(Common.maPhongBacSi)).ToList();
                dgPDKK.SelectedValuePath = "MaPhieuDKKham";

                dgPKB.ItemsSource       = xlPKB.getDSPhieuKhamBenhByDS(xlPKB.getDSPhieuKhamBenhByUser(Common.maNhanVien, DateTime.Now)).ToList();
                dgPKB.SelectedValuePath = "MaPhieuKB";
            }
        }
Example #3
0
        private void getDS()
        {
            //if (Common.vaiTroNhanVien != null)
            //{
            //    if (Common.vaiTroNhanVien == Common.BacSi)
            //    {

            //    }
            //}
            //clearControl();
            dg.ItemsSource = xlPDDK.getDSPhieuDKKhamByDS(xlPDDK.getDSPhieuDKKhamByUser(Common.maNhanVien.ToString(), DateTime.Now)).ToList();
            //dg.ItemsSource = xlPDDK.getDSPhieuDKKham();
            dg.SelectedValuePath = "MaPhieuDKKham";

            cmbChuyenKhoa.ItemsSource       = xlCK.getDSChuyenKhoa();
            cmbChuyenKhoa.DisplayMemberPath = "TenChuyenKhoa";
            cmbChuyenKhoa.SelectedValuePath = "IDChuyenKhoa";
            cmbChuyenKhoa.SelectedIndex     = 0;

            //cmbPhongKham.ItemsSource = xlPK.TimMaPKO(Common.ConvertToInt(cmbChuyenKhoa.SelectedValue));
            cmbPhongKham.ItemsSource       = xlPK.getDSPhongKham();
            cmbPhongKham.DisplayMemberPath = "TenPhongKham";
            cmbPhongKham.SelectedValuePath = "IDPhongKham";
            cmbPhongKham.SelectedIndex     = 0;

            cmbLoaiDichVu.ItemsSource       = xlLDV.getDSLoaiDichVu();
            cmbLoaiDichVu.DisplayMemberPath = "TenLoaiDV";
            cmbLoaiDichVu.SelectedValuePath = "IDLoaiDV";
            cmbLoaiDichVu.SelectedIndex     = 0;

            //cmbDichVu.ItemsSource = xlDV.TimMaDV(Common.ConvertToInt(cmbLoaiDichVu.SelectedValue));
            if (cmbLoaiDichVu.SelectedItem != null)
            {
                cmbDichVu.ItemsSource       = xlDV.getDSDichVuByLoaiDV(int.Parse(cmbLoaiDichVu.SelectedValue.ToString()));
                cmbDichVu.DisplayMemberPath = "TenDichVu";
                cmbDichVu.SelectedValuePath = "IDDichVu";
                cmbDichVu.SelectedIndex     = 0;
            }

            dgCTDKDV.SelectedValuePath = "DichVuID";
            dgCTDKPK.SelectedValuePath = "PhongKhamID";

            txtMaPDDK.Text = xlPDDK.taoMaPK();
            dpNgayLap.Text = DateTime.Now.ToShortDateString();

            if (Common.maBenhNhan != null)
            {
                txtMaBenhNhan.Text  = Common.maBenhNhan.ToString();
                epdLPDKK.IsExpanded = true;
                txtTenBenhNhan.Text = Common.objBenhNhanM.HoTen.ToString();
            }
            if (Common.maNhanVien != null)
            {
                txtNhanVienLP.Text  = Common.maNhanVien.ToString();
                epdLPDKK.IsExpanded = true;
            }

            //test
            //if (Common.maNhanVien != null)
            //    txtNhanVienLP.Text = Common.maNhanVien.ToString();
            //txtNhanVienLP.Text = "bhvu";
            //txtMaBenhNhan.Text = "BN002";
        }