private void btnReCheck_Click(object sender, EventArgs e) { int selectedRowCount = dgvPatient.Rows.GetRowCount(DataGridViewElementStates.Selected); if (selectedRowCount <= 0) { return; } int rowIndex = dgvPatient.SelectedRows[selectedRowCount - 1].Index; string pId = dgvPatient.Rows[rowIndex].Cells["SickNum"].Value.ToString().Trim(); Patient patient = new Patient().getPatientByNum(pId); string numId = String.Format("{0:D6}", helper.getIdCheck()); string pName = patient.NameProperty; string pAge = patient.AgeProperty.ToString(); string pCause = patient.CauseCheckProperty; string doctor = Session.Instance.UserName; string folderImgPath = dgvPatient.Rows[rowIndex].Cells["DataPath"].Value.ToString().Trim(); this.Hide(); CheckAndView checkFr = new CheckAndView(numId, pId, pName, pAge, pCause, doctor, folderImgPath); checkFr.ShowDialog(); this.Close(); }
private void btnChupHinh_Click(object sender, EventArgs e) { if (dgvBenhNhan.SelectedRows.Count <= 0) { MessageBox.Show("Chưa có bệnh nhân nào được chọn. Vui lòng chọn bệnh nhân trước khi chụp ảnh!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.Hide(); currRowIndex = dgvBenhNhan.SelectedRows[0].Index; string patientId = dgvBenhNhan.Rows[currRowIndex].Cells["SickNum"].Value.ToString().Trim(); string dataPath = dgvBenhNhan.Rows[currRowIndex].Cells["DataPath"].Value.ToString().Trim(); string pName = txtName.Text.Trim(); string pAge = txtAge.Text.Trim(); string pInsurance = txtInsureId.Text.Trim(); string doctor = ""; string checkId = txtId.Text.Trim(); //check dataPat is exist if (Directory.Exists(dataPath) == false) { //create new data path dataPath = helper.creatPatientFolder(patientId); //save new datapath to database if (dataPath != null) { updateDataPath(patientId, dataPath); } } CheckAndView cavfr = new CheckAndView(checkId, patientId, pName, pAge, txtCauseCheck.Text.Trim(), doctor, dataPath); cavfr.ShowDialog(); this.Show(); //set focus to new row dgvBenhNhan.Rows[tbSick.Rows.Count].Selected = true; }
public FullScreen(CheckAndView checkView) { InitializeComponent(); checkView.initCamera(pictureBox1); }