private void doctorVisitViewExamDetailsButton_Click(object sender, EventArgs e) { if (doctorVisitViewCurrExamDataGrid.RowCount == 0 || doctorVisitViewCurrExamDataGrid.SelectedCells.Count == 0) { //MessageBox.Show("No visit selected", "Error"); MessageBox.Show("No examination selected !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (doctorVisitViewCurrExamDataGrid.SelectedRows.Count > 1) { //MessageBox.Show("Selected too many visits, please select just one", "Error"); MessageBox.Show("Selected too many examinations ! \nPlease select just one...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { int examinationIndex = doctorVisitViewCurrExamDataGrid.CurrentRow.Index; int idExam = Int32.Parse(doctorVisitViewCurrExamDataGrid.Rows[examinationIndex].Cells[7].Value.ToString()); if (doctorVisitViewCurrExamDataGrid.Rows[examinationIndex].Cells[1].Value.Equals("Laboratory")) { LabolatoryExaminationForm examinationView = new LabolatoryExaminationForm(idExam); examinationView.ShowDialog(this); } else { DoctorExaminationViewForm examinationView = new DoctorExaminationViewForm(this.idVisit, idExam); examinationView.ShowDialog(this); } } }
private void labManagerEditButton_Click(object sender, EventArgs e) { if (labMWDataGridView.CurrentRow != null && labMWDataGridView.SelectedRows.Count == 1) { //kzp : do przekazania proponuję id_laboraory_examination i username int tmp_id_exam = (int)labMWDataGridView.CurrentRow.Cells[0].Value; // id zaznaczonego badania w gridzie if (roles.Equals("LABM")) { // roles -> rola czyli "LABM" lub "LABW", id_worker -> id managera z "Laboratory_manager", username - user_name z "User" //LabolatoryExaminationForm labExamView = new LabolatoryExaminationForm(roles, id_manager, username, tmp_id_exam); LabolatoryExaminationForm labExamView = new LabolatoryExaminationForm(tmp_id_exam); if (labMWDataGridView.CurrentRow.Cells[7].Value.Equals("DONE")) { labExamView.SetLabManagerMode(id_manager.Value); } labExamView.ShowDialog(this); RefreshGrid(); } else if (roles.Equals("LABW")) { // roles -> rola czyli "LABM" lub "LABW", id_worker -> id workera z "Laboratory_worker", username - user_name z "User" //LabolatoryExaminationForm labExamView = new LabolatoryExaminationForm(roles, id_worker, username, tmp_id_exam); LabolatoryExaminationForm labExamView = new LabolatoryExaminationForm(tmp_id_exam); if (labMWDataGridView.CurrentRow.Cells[7].Value.Equals("ORD")) { labExamView.SetLabWorkerMode(id_worker.Value); } labExamView.ShowDialog(this); RefreshGrid(); } } else { MessageBox.Show("Select laboratory examination !", "Select row ...", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }