public frmDetailKQKB(int KhamBenh_Id) { InitializeComponent(); var obj = new KQKBBUS(this).NVGetByKhamBenhId(KhamBenh_Id); if (obj != null) { TenBenhNhan.FormatTextFromTag(obj.TenBenhNhan); MaYTe.FormatTextFromTag(obj.MaYTe); Tuoi.FormatTextFromTag(obj.Tuoi); GioiTinh.FormatTextFromTag(obj.GioiTinh); DiaChi.FormatTextFromTag(obj.DiaChi); SDT.FormatTextFromTag(obj.SoDienThoai); THoiGianKham.FormatTextFromTag(obj.ThoiGianKham); NoiDungKham.FormatTextFromTag(obj.NoiDungKham); TrieuChungLamSang.FormatTextFromTag(obj.TrieuChungLamSang); ChuanDoanLamSang.FormatTextFromTag(obj.ChanDoanKhoaKham); TenPhongBan.FormatTextFromTag(obj.TenPhongBan); HuyeAp.FormatTextFromTag(obj.HuyetAp); Mach.FormatTextFromTag(obj.Mach); NhietDo.FormatTextFromTag(obj.NhietDo); NhipTho.FormatTextFromTag(obj.NhipTho); ChieuCao.FormatTextFromTag(obj.ChieuCao); CanNang.FormatTextFromTag(obj.CanNang); SoBHYT.FormatTextFromTag(obj.SoBHYT); NguoiLienHe.FormatTextFromTag(obj.NguoiLienHe); NgayhentaiKham.FormatTextFromTag(obj.NgayHenTaiKham); MaBenh.FormatTextFromTag(obj.MaBenh); MaBenhPhu.FormatTextFromTag(obj.MaBenhPhu); } }
public void XoaTrangO() { int MaBenh; dgv_benh.CurrentCell.Selected = false; txt_ten.Text = ""; int k = BENH_BUS.LoadBenh().Rows.Count;//đếm số hàng của datagridview if (k > 0) { MaBenh = (int)BENH_BUS.LoadBenh().Rows[k - 1][0];//lấy mã bệnh nhân hiện tại } else { MaBenh = 0; } MaBenh++;//mã bệnh nhân tiếp theo if (MaBenh < 10) { txt_ma.Text = "BE00" + MaBenh.ToString(); } else if (MaBenh < 100 && MaBenh >= 10) { txt_ma.Text = "BE0" + MaBenh.ToString(); } else if (MaBenh >= 100) { txt_ma.Text = "BE" + MaBenh.ToString(); } txt_ten.Focus(); }