private void UpdateData() { if (m_SoLuuTru.Trim() == "") return; clsBenhAn objBenhAn = new clsBenhAn(); try { m_SoLuuTru = txtSoLuuTru.Text; objBenhAn.GetBySoLuuTru(m_SoLuuTru,Code); objBenhAn.SoLuuTru = txtSoLuuTru.Text; objBenhAn.MaYTe = txtMaYTe.Text; objBenhAn.HoTen = txtHoTen.Text; objBenhAn.GioiTinh = int.Parse(cboGioiTinh.SelectedValue.ToString()); objBenhAn.Tuoi = txtTuoi.IntValue; objBenhAn.DanToc = txtDanToc.Text; objBenhAn.DiaChi = txtDiaChi.Text; objBenhAn.QuocTich = txtQuocTich.Text; objBenhAn.GiaTriTu = txtGiaTriTu.GetDate; objBenhAn.GiaTriDen = txtGiaTriDen.GetDate; objBenhAn.SoTheBHYT = txtSoTheBHYT.Text; objBenhAn.MaCSKCB = conf.MaCSKCB; DateTime? datetimeNgayVao = new DateTime?(); DateTime? datetimeNgayRa = new DateTime?(); if (txtNgayVaoVien.GetDate != null) datetimeNgayVao = txtNgayVaoVien.GetDate.Value.AddHours(txtGioVaoVien.IntValue).AddMinutes(txtPhutVaoVien.IntValue); if (txtNgayRaVien.GetDate != null) datetimeNgayRa = txtNgayRaVien.GetDate.Value.AddHours(txtGioRaVien.IntValue).AddMinutes(txtPhutRaVien.IntValue); objBenhAn.NgayVao = datetimeNgayVao; objBenhAn.NgayRa = datetimeNgayRa; objBenhAn.Loai = "GiayRaVien"; objBenhAn.ChanDoan = txtChanDoan.Text; objBenhAn.ChanDoanGPBL=txtChanDoanGPBL.Text; objBenhAn.LoiDanThayThuoc=txtLoiDanThayThuoc.Text; objBenhAn.PhuongPhap = txtPhuongPhapDieuTri.Text; int kq = objBenhAn.Update(); if (kq > 0) { //MessageBox.Show("Thêm mới bảng kê thành công", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); lblThongBao.Text = "Cập nhật giấy ra viện thành công."; timerThongBao.Enabled = true; } else { MessageBox.Show("Cập nhật giấy ra viện không thành công.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show("Cập nhật giấy ra viện không thành công.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); //lblThongBao.Text = "Thêm mới bảng kê không thành công"; //timerThongBao.Enabled = true; } }
private void LoadData(int intLoai) { if (IsRunCheck == true) return; clsBenhAn objBenhAn = new clsBenhAn(); if (TrangThai == "" && intLoai == 1) objBenhAn.GetBySoLuuTru(txtSoLuuTru.Text,Code); else objBenhAn.GetBySoLuuTru(m_SoLuuTru,Code); if (objBenhAn.BenhAn_Id > 0) { m_SoLuuTru = objBenhAn.SoLuuTru; IsRunCheck = true; txtSoLuuTru.Text = objBenhAn.SoLuuTru; txtMaYTe.Text = objBenhAn.MaYTe; txtHoTen.Text = objBenhAn.HoTen; cboGioiTinh.SelectedValue = objBenhAn.GioiTinh.ToString(); txtTuoi.Text = objBenhAn.Tuoi.ToString(); txtDanToc.Text = objBenhAn.DanToc; txtDiaChi.Text = objBenhAn.DiaChi; txtQuocTich.Text = objBenhAn.QuocTich; txtGiaTriTu.Text = string.Format("{0:dd/MM/yyyy}", objBenhAn.GiaTriTu); txtGiaTriDen.Text = string.Format("{0:dd/MM/yyyy}", objBenhAn.GiaTriDen); ; txtSoTheBHYT.Text = objBenhAn.SoTheBHYT; txtChanDoan.Text = objBenhAn.ChanDoan; txtChanDoanGPBL.Text = objBenhAn.ChanDoanGPBL; txtLoiDanThayThuoc.Text = objBenhAn.LoiDanThayThuoc; txtPhuongPhapDieuTri.Text = objBenhAn.PhuongPhap; if (objBenhAn.NgayVao != null) { txtGioVaoVien.Text = objBenhAn.NgayVao.Value.Hour.ToString(); txtPhutVaoVien.Text = objBenhAn.NgayVao.Value.Minute.ToString(); txtNgayVaoVien.Text = string.Format("{0:dd/MM/yyyy}", objBenhAn.NgayVao); ; } if (objBenhAn.NgayRa != null) { txtGioRaVien.Text = objBenhAn.NgayRa.Value.Hour.ToString(); txtPhutRaVien.Text = objBenhAn.NgayRa.Value.Minute.ToString(); txtNgayRaVien.Text = string.Format("{0:dd/MM/yyyy}", objBenhAn.NgayRa); ; } //txtSoLuuTru.Focus(); IsRunCheck = false; } else ResetControl(); }
private void UpdateData() { if (m_SoLuuTru.Trim() == "") return; clsBenhAn objBenhAn = new clsBenhAn(); try { m_SoLuuTru = txtSoLuuTru.Text; objBenhAn.GetBySoLuuTru(m_SoLuuTru, Code); objBenhAn.SoLuuTru = txtSoLuuTru.Text; objBenhAn.MaYTe = txtMaYTe.Text; objBenhAn.HoTen = txtHoTen.Text; objBenhAn.GioiTinh = int.Parse(cboGioiTinh.SelectedValue.ToString()); objBenhAn.NoiChuyenDen = txtNoiChuyenDen.Text; objBenhAn.Tuoi = txtTuoi.IntValue; objBenhAn.DanToc = txtDanToc.Text; objBenhAn.DiaChi = txtDiaChi.Text; objBenhAn.QuocTich = txtQuocTich.Text; objBenhAn.NgheNghiep = txtNgheNghiep.Text; objBenhAn.NoiLamViec = txtNoiLamViec.Text; objBenhAn.GiaTriTu = txtGiaTriTu.GetDate; objBenhAn.GiaTriDen = txtGiaTriDen.GetDate; objBenhAn.SoTheBHYT = txtSoTheBHYT.Text; objBenhAn.TenCSKCB = lblCSKCB.Text; objBenhAn.MaCSKCB = conf.MaCSKCB; objBenhAn.NgayVao = txtTuNgay.GetDate; objBenhAn.NgayRa = txtDenNgay.GetDate; objBenhAn.DauHieu = txtDauHieuLamSang.Text; objBenhAn.KetQua = txtKetQuaXetNghiem.Text; objBenhAn.ChanDoan = txtChanDoan.Text; objBenhAn.PhuongPhap = txtPhuongPhap.Text; objBenhAn.TinhTrang = txtTinhTrang.Text; objBenhAn.LyDo = rdoDuDieuKien.Checked ? 1 : 0; DateTime? datetime = new DateTime?(); if (txtNgayChuyenTuyen.GetDate != null) datetime = txtNgayChuyenTuyen.GetDate.Value.AddHours(txtGio.IntValue).AddMinutes(txtPhut.IntValue); objBenhAn.ChuyenTuyenHoi = datetime; objBenhAn.HuongDieuTri = txtHuongDieuTri.Text; objBenhAn.PhuongTienVanChuyen = txtPhuongTienVanChuyen.Text; objBenhAn.NguoiHoTong = txtNguoiHoTong.Text; objBenhAn.Loai = "GiayChuyenTuyen"; //objBenhAn.ChanDoanGPBL=; //objBenhAn.LoiDanThayThuoc=; objBenhAn.LyDoStr = rdoDuDieuKien.Checked ? rdoDuDieuKien.Text : rdoKhongDuDieuKien.Text; int kq = objBenhAn.Update(); if (kq > 0) { //MessageBox.Show("Thêm mới bảng kê thành công", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); lblThongBao.Text = "Cập nhật giấy chuyển tuyến thành công."; timerThongBao.Enabled = true; } else { MessageBox.Show("Cập nhật giấy chuyển tuyến không thành công.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show("Cập nhật giấy chuyển tuyến không thành công.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); //lblThongBao.Text = "Thêm mới bảng kê không thành công"; //timerThongBao.Enabled = true; } }
private void btnXoa_Click(object sender, EventArgs e) { if (m_SoLuuTru.Trim() != "") { if (MessageBox.Show("Bạn có muốn xóa giấy ra viện này ?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { clsBenhAn objBenhAn = new clsBenhAn(); objBenhAn.GetBySoLuuTru(m_SoLuuTru,Code); if (objBenhAn.BenhAn_Id > 0) { int kq = objBenhAn.Delete(objBenhAn.BenhAn_Id); if (kq > 0) { //MessageBox.Show("Thêm mới bảng kê thành công", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); lblThongBao.Text = "Xóa giấy ra viện thành công."; timerThongBao.Enabled = true; ResetControl(); SetControlStatusReadOnly(true); } else { MessageBox.Show("Xóa giấy ra viện không thành công.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } else { MessageBox.Show("Chọn giấy ra viện.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void LoadData(int intLoai) { clsBenhAn objBenhAn = new clsBenhAn(); if (TrangThai == "" && intLoai == 1) objBenhAn.GetBySoLuuTru(txtSoLuuTru.Text,Code); else objBenhAn.GetBySoLuuTru(m_SoLuuTru,Code); if (objBenhAn.BenhAn_Id > 0) { m_SoLuuTru = objBenhAn.SoLuuTru; txtSoLuuTru.Text = objBenhAn.SoLuuTru; txtMaYTe.Text = objBenhAn.MaYTe; txtHoTen.Text = objBenhAn.HoTen; cboGioiTinh.SelectedValue = objBenhAn.GioiTinh.ToString(); txtNoiChuyenDen.Text = objBenhAn.NoiChuyenDen; txtTuoi.Text = objBenhAn.Tuoi.ToString(); txtDanToc.Text = objBenhAn.DanToc; txtDiaChi.Text = objBenhAn.DiaChi; txtQuocTich.Text = objBenhAn.QuocTich; txtNgheNghiep.Text = objBenhAn.NgheNghiep; txtNoiLamViec.Text = objBenhAn.NoiLamViec; txtGiaTriTu.Text = string.Format("{0:dd/MM/yyyy}", objBenhAn.GiaTriTu); txtGiaTriDen.Text = string.Format("{0:dd/MM/yyyy}", objBenhAn.GiaTriDen); ; txtSoTheBHYT.Text = objBenhAn.SoTheBHYT; lblCSKCB.Text = objBenhAn.TenCSKCB; txtTuNgay.Text = string.Format("{0:dd/MM/yyyy}", objBenhAn.NgayVao); txtDenNgay.Text = string.Format("{0:dd/MM/yyyy}", objBenhAn.NgayRa); ; txtDauHieuLamSang.Text = objBenhAn.DauHieu; txtKetQuaXetNghiem.Text = objBenhAn.KetQua; txtChanDoan.Text = objBenhAn.ChanDoan; txtPhuongPhap.Text = objBenhAn.PhuongPhap; txtTinhTrang.Text = objBenhAn.TinhTrang; if (objBenhAn.LyDo == 1) { rdoDuDieuKien.Checked = true; } else { rdoKhongDuDieuKien.Checked = true; } if (objBenhAn.ChuyenTuyenHoi != null) { txtGio.Text = objBenhAn.ChuyenTuyenHoi.Value.Hour.ToString(); txtPhut.Text = objBenhAn.ChuyenTuyenHoi.Value.Minute.ToString(); txtNgayChuyenTuyen.Text = string.Format("{0:dd/MM/yyyy}", objBenhAn.ChuyenTuyenHoi); ; } txtHuongDieuTri.Text = objBenhAn.HuongDieuTri; txtPhuongTienVanChuyen.Text = objBenhAn.PhuongTienVanChuyen; txtNguoiHoTong.Text = objBenhAn.NguoiHoTong; //txtSoLuuTru.Focus(); } else ResetControl(); }