private void frmDonTiep_Load(object sender, EventArgs e) { load(); cbx_BacSiGui.DataSource = load_bs(); cbx_BacSiGui.ValueMember = "BacSiID"; cbx_BacSiGui.DisplayMember = "HoTen"; cbx_GioiTinh.DataSource = Util.ResetControl.getTable_forCombo(new string[] { "ID", "Name" }, new string[] { "True", "False" }, new string[] { "Nam", "Nữ" }); cbx_GioiTinh.DisplayMember = "ID"; cbx_GioiTinh.ValueMember = "Name"; cbx_MaDoiTuong.DataSource = DoiTuong_Info.SelectAllTable(); cbx_MaDoiTuong.ValueMember = "TenDoiTuong"; cbx_MaDoiTuong.DisplayMember = "DoiTuongID"; Util.FormHandler.SetEnterKeyForAllControlsLevel(txtDiaChi.GetType(), this.Controls); Util.FormHandler.SetEnterKeyForAllControlsLevel(txtNamSinh.GetType(), this.Controls); Util.FormHandler.SetEnterKeyForAllControlsLevel(cdt_Ngayvaovien.GetType(), this.Controls); Util.ResetControl.SetEnterForUltraComboUltraTextBox(new UltraCombo[] { cbx_GioiTinh, cbx_MaDoiTuong }, new TextBox[] { txtGioiTinh, txtTenDoiTuong }); Util.ResetControl.SetSourceForGridCustomCollumns(gridDSDichVu, new string[] { "MaDichVu", "TenDichVu", "DonGia" }, new string[] { "Mã dịch vụ", "Tên dịch vụ", "Đơn giá" }); Util.ResetControl.SetSourceForGridCustomCollumns(gridDSDichVuKe, new string[] { "MaDichVu", "TenDichVu", "SoLuong", "DonGia" }, new string[] { "Mã dịch vụ", "Tên dịch vụ", "Số lượng", "Đơn giá" }); DataTable dataTable = DB_SQL.EXECUTE_SQL("select max(SoKham) as SoKham from LanKham"); bool flag = dataTable.Rows[0]["SoKham"].ToString() != ""; if (!flag) { txtSoKham.Text = "1"; } else { int i = Convert.ToInt32(dataTable.Rows[0]["SoKham"].ToString()) + 1; txtSoKham.Text = i.ToString(); } txtHoTenBenhNhan.Focus(); }
public frmKhamThem(BenhNhan_Info bn, LanKham_Info lk, DoiTuong_Info dt, BacSi_Info bs) { this.bn = bn; this.lk = lk; this.dt = dt; this.bs = bs; InitializeComponent(); }
private void btn_KhamThem_Click(object sender, EventArgs e) { if (GridBenhNhan.ActiveRow != null) { BenhNhan_Info bn = new BenhNhan_Info(); bn.DiaChi = txtDiaChi.Text; bn.DienThoai = txtDienThoai.Text; bn.GioiTinh = txtGT.Text == "Nam" ? true : false; bn.HoTen = txtHoTen.Text; bn.Tuoi = Convert.ToInt32(txtTuoi.Text); LanKham_Info lk = new LanKham_Info(); lk.NgayKham = Convert.ToDateTime(txtNgayKham.Text); lk.SoBH = txtMaTheBHYT.Text; lk.SoKham = Convert.ToInt32(txtMaBenhAn.Text); lk.LanKhamID = Convert.ToInt32(GridBenhNhan.ActiveRow.Cells["LanKhamID"].Value); if (GridBenhNhan.ActiveRow.Cells["BacSiGuiID"].Value.ToString() == "") { lk.BacSiGuiID = 0; } else { lk.BacSiGuiID = Convert.ToInt32(GridBenhNhan.ActiveRow.Cells["BacSiGuiID"].Value); } DoiTuong_Info dt = new DoiTuong_Info(); dt.TenDoiTuong = txtDoiTuong.Text; BacSi_Info bs = new BacSi_Info(); bs.HoTen = GridBenhNhan.ActiveRow.Cells["HoTenBacSi"].Value.ToString(); frmKhamThem f = new frmKhamThem(bn, lk, dt, bs); f.ShowDialog(); grid_DV.DataSource = LoadDV(lk.LanKhamID.ToString()); } else { MessageBox.Show("Chọn bệnh nhân để khám thêm"); } }
private void frmDonTiep_Load(object sender, EventArgs e) { load(); cbx_BacSiGui.DataSource = load_bs(); cbx_BacSiGui.ValueMember = "BacSiID"; cbx_BacSiGui.DisplayMember = "HoTen"; cbx_GioiTinh.DataSource = Util.ResetControl.getTable_forCombo(new string[] { "ID", "Name" }, new string[] { "True", "False" }, new string[] { "Nam", "Nữ" }); cbx_GioiTinh.DisplayMember = "ID"; cbx_GioiTinh.ValueMember = "Name"; cbx_MaDoiTuong.DataSource = DoiTuong_Info.SelectAllTable(); cbx_MaDoiTuong.ValueMember = "TenDoiTuong"; cbx_MaDoiTuong.DisplayMember = "DoiTuongID"; Util.FormHandler.SetEnterKeyForAllControlsLevel(txtDiaChi.GetType(), this.Controls); Util.FormHandler.SetEnterKeyForAllControlsLevel(txtNamSinh.GetType(), this.Controls); Util.FormHandler.SetEnterKeyForAllControlsLevel(txt_Ngay_Gio_vaovien.GetType(), this.Controls); Util.ResetControl.SetEnterForUltraComboUltraTextBox(new UltraCombo[] { cbx_GioiTinh, cbx_MaDoiTuong }, new TextBox[] { txtGioiTinh, txtTenDoiTuong }); Util.ResetControl.SetSourceForGridCustomCollumns(gridDSDichVu, new string[] { "MaDichVu", "TenDichVu", "DonGia" }, new string[] { "Mã dịch vụ", "Tên dịch vụ", "Đơn giá" }); Util.ResetControl.SetSourceForGridCustomCollumns(gridDSDichVuKe, new string[] { "MaDichVu", "TenDichVu", "SoLuong", "DonGia" }, new string[] { "Mã dịch vụ", "Tên dịch vụ", "Số lượng", "Đơn giá" }); // load text txtChuanDoan.Text = lk.ChuanDoan; txtDiaChi.Text = bn.DiaChi; txtGioiTinh.Text = bn.GioiTinh == true ? "Nam" : "Nữ"; txtHoTenBenhNhan.Text = bn.HoTen; txtMaTheBHYT.Text = lk.SoBH; txtNamSinh.Value = bn.Tuoi; txtSoDienThoai.Text = bn.DienThoai; txtSoKham.Text = lk.SoKham.ToString(); txtTenDoiTuong.Text = dt.TenDoiTuong; txt_Ngay_Gio_vaovien.Value = lk.NgayKham; cbx_BacSiGui.Text = lk.BacSiGuiID.ToString(); cbx_GioiTinh.Text = bn.GioiTinh.ToString(); cbx_MaDoiTuong.Text = lk.DoiTuongID.ToString(); txtBacSiID.Text = bs.BacSiID.ToString(); txtMaDichVu.Focus(); }
private void ChonBaoCao_Load(object sender, EventArgs e) { cbx_MaDoiTuong.DataSource = DoiTuong_Info.SelectAllTable(); cbx_MaDoiTuong.ValueMember = "DoiTuongID"; cbx_MaDoiTuong.DisplayMember = "TenDoiTuong"; }