コード例 #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()
        {
            //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";
        }