private void LoadData(string title, PhieuKhamGUI phieuKham, BenhNhan benhNhan)
        {
            //set title cho form
            Text            = title;
            btnAddEdit.Text = "Cập nhật";
            // load data cho các textbox
            txtHoTen.Text      = phieuKham.HoTen;
            txtSDT.Text        = benhNhan.SoDT;
            txtDanToc.Text     = phieuKham.DanToc;
            txtDiaChi.Text     = phieuKham.DiaChi;
            txtNgaySinh.Text   = phieuKham.NgaySinh.ToString("dd-MM-yyyy");
            txtTienSuBenh.Text = benhNhan.TienSu;
            txtCMND.Text       = benhNhan.SoCMND;
            rtbChuanDoan.Text  = phieuKham.ChuanDoan;
            //load cbbBacSi
            cbbBacSi.SelectedIndex = cbbBacSi.Items.IndexOf(phieuKham.BacSi);

            //load cbbHinhThucKham
            if (benhNhan.GioiTinh.Equals("Nam"))
            {
                rdoNam.Checked = true;
            }
            else
            {
                rdoNu.Checked = true;
            }
        }
        public fAddEditPhieuKham(string title, PhieuKhamGUI phieuKham, BenhNhan benhNhan)
        {
            InitializeComponent();
            isNew          = false;
            this.phieuKham = phieuKham;
            this.benhNhan  = benhNhan;
            libraryService = ServiceFactory.GetLibraryService(LibraryParameter.persistancestrategy);
            //load data cho các textbox
            LoadData(title, this.phieuKham, benhNhan);

            LoadDanhSachBacSi(phieuKham.BacSi);
            LoadHinhThucKham(phieuKham.HinhThucKham);
        }
Exemplo n.º 3
0
        public List <PhieuKhamGUI> TimKiemLichSuTiepNhan(int maNV, string column, string value)
        {
            DataTable           table = DataProvider.Instane.ExecuteReader("EXEC dbo.TimKiemLichSuTiepNhan @MaNV ,  @TruongDuLieu  , @ThongTin ", new object[] { maNV, column, value });
            List <PhieuKhamGUI> list  = new List <PhieuKhamGUI>();

            foreach (DataRow item in table.Rows)
            {
                PhieuKhamGUI phieuKhamGUI = new PhieuKhamGUI(item);
                list.Add(phieuKhamGUI);
            }

            return(list);
        }
Exemplo n.º 4
0
        public List <PhieuKhamGUI> LichSuTiepNhanByID(int id)
        {
            DataTable           table = DataProvider.Instane.ExecuteReader("EXEC dbo.SP_LoadLichSuTiepNhanByID @MANV", new object[] { id });
            List <PhieuKhamGUI> list  = new List <PhieuKhamGUI>();

            foreach (DataRow item in table.Rows)
            {
                PhieuKhamGUI phieuKhamGUI = new PhieuKhamGUI(item);
                list.Add(phieuKhamGUI);
            }

            return(list);
        }
Exemplo n.º 5
0
        /// <summary>
        /// hàm load danh sách phiếu khám cho fTiepNhanBenhNhan
        /// </summary>
        /// <param name="dateTime"></param>
        /// <returns></returns>
        public List <PhieuKhamGUI> DanhSachPhieuKhamGUI(DateTime dateTime)
        {
            List <PhieuKhamGUI> list = new List <PhieuKhamGUI>();

            DataTable table = DataProvider.Instane.ExecuteReader("EXEC  dbo.SP_DanhSachKham_fKhamBenNhan @NgayKham ", new object[] { dateTime });

            foreach (DataRow row in table.Rows)
            {
                PhieuKhamGUI phieuKhamGUI = new PhieuKhamGUI(row);
                list.Add(phieuKhamGUI);
            }

            return(list);
        }
 private void btnCapNhatPhieuKham_Click(object sender, EventArgs e)
 {
     if (dgvDanhSachKham.SelectedRows.Count != 0)
     {
         DataGridViewRow row = dgvDanhSachKham.SelectedRows[0];
         //MessageBox.Show(row.Cells[2].Value.ToString());
         PhieuKhamGUI      phieuKham = listPhieuKham.Single(p => p.MaPhieuKham == (int)row.Cells[2].Value);
         BenhNhan          benhNhan  = listBenhNhan.Single(p => p.MaBN == (int)row.Cells[1].Value);
         fAddEditPhieuKham f         = new fAddEditPhieuKham("Cập nhật phiếu khám", phieuKham, benhNhan);
         f.ShowDialog();
         if (f.DialogResult == DialogResult.OK)
         {
             listPhieuKham = libraryService.DanhSachPhieuKhamGUI(DateTime.Now);
             LoadPhieuKham(listPhieuKham);
         }
     }
 }