Пример #1
0
        private void getDS()
        {
            ////clearControl();

            ////dg.ItemsSource = xlPDKK.getDSPhieuKhamBenh();
            //dg.ItemsSource = xlPKB.getDSPhieuKhamBenhByDS(xlPKB.getDSPhieuKhamBenh()).ToList();
            //dg.SelectedValuePath = "MaPhieuKB";

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

            //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;
            }
            cmbThuoc.ItemsSource       = xlT.getDSThuoc();
            cmbThuoc.DisplayMemberPath = "TenThuoc";
            cmbThuoc.SelectedValuePath = "IDThuoc";
            cmbThuoc.SelectedIndex     = 0;

            dgCTT.SelectedValuePath    = "ThuocID";
            dgCTDKDV.SelectedValuePath = "DichVuID";

            txtMaPKB.Text  = xlPKB.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;
            }
            txtSoLuong.Text = "1";

            ////test
            ////if (Common.maNhanVien != null)
            ////    txtNhanVienLP.Text = Common.maNhanVien.ToString();
            //txtNhanVienLP.Text = "bacsi1";
            //Common.vaiTroNhanVien = Common.BacSi;
            //Common.maNhanVien = "bacsi1";
            ////txtMaBenhNhan.Text = "BN002";

            LayTTPDKK();
        }
Пример #2
0
 private void getDS()
 {
     clearControl();
     dg.ItemsSource = xl.getDSThuoc();
     //dg.SelectedValuePath = "MaThuoc";
 }