private void patientVisitToolStripMenuItem_Click(object sender, EventArgs e) { PatientVisit frm = new PatientVisit(null, null, null); frm.MdiParent = this; frm.Dock = DockStyle.Fill; frm.Show(); }
private void dtGrid_CellClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; updateID = dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString(); if (e.ColumnIndex == 11) { if (dtGrid.Rows[e.RowIndex].Cells["Paid for consulation"].Value.ToString() != "Yes") { if (MessageBox.Show("YES or No?", "Payments not yet made would you like to continue ? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { } else { return; } } if (MessageBox.Show("YES or No?", "Is visit complete? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { //Global._queues.RemoveAll(x => x.Id == updateID); //DBConnect.Delete("queue", dtGrid.Rows[e.RowIndex].Cells[3].Value.ToString()); _queue = new Queue(updateID, _queues.First(x => x.Id.Contains(updateID)).Follow, _queues.First(x => x.Id.Contains(updateID)).PatientID, _queues.First(x => x.Id.Contains(updateID)).UserID, _queues.First(x => x.Id.Contains(updateID)).RoomID, _queues.First(x => x.Id.Contains(updateID)).ClinicID, "Complete", _queues.First(x => x.Id.Contains(updateID)).Dated, DateTime.Now.ToString("dd-MM-yyyy H:mm:ss"), _queues.First(x => x.Id.Contains(updateID)).Department, "", "", "", "", "", "", "", "", "", Helper.orgID, dtGrid.Rows[e.RowIndex].Cells["type"].Value.ToString()); DBConnect.Update(_queue, updateID); Global._queues.RemoveAll(x => x.Id == updateID); Global._queues.Add(_queue); MessageBox.Show("Information updated"); LoadData(); } } if (e.ColumnIndex == 10) { if (dtGrid.Rows[e.RowIndex].Cells["Paid for consulation"].Value.ToString() != "Yes") { if (MessageBox.Show("YES or No?", "Payments not yet made would you like to continue ? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { } else { return; } } string visitID = dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString(); string patientID = dtGrid.Rows[e.RowIndex].Cells["patientID"].Value.ToString(); string practitionerID = dtGrid.Rows[e.RowIndex].Cells["practitionerID"].Value.ToString(); string department = dtGrid.Rows[e.RowIndex].Cells["Department"].Value.ToString(); if (department.Contains("ent")) { DentalForm frm = new DentalForm(visitID, patientID, practitionerID); frm.MdiParent = MainForm.ActiveForm; frm.Dock = DockStyle.Fill; frm.Show(); } else { PatientVisit frm = new PatientVisit(visitID, patientID, practitionerID); frm.MdiParent = MainForm.ActiveForm; frm.Dock = DockStyle.Fill; frm.Show(); } } if (e.ColumnIndex == 16) { if (dtGrid.Rows[e.RowIndex].Cells["Paid for consulation"].Value.ToString() != "Yes") { if (MessageBox.Show("YES or No?", "Payments not yet made would you like to continue ? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { } else { return; } } string visitID = dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString(); string patientID = dtGrid.Rows[e.RowIndex].Cells["patientID"].Value.ToString(); string practitionerID = dtGrid.Rows[e.RowIndex].Cells["practitionerID"].Value.ToString(); OutPatient frm = new OutPatient(visitID, patientID, practitionerID); frm.MdiParent = MainForm.ActiveForm; frm.Dock = DockStyle.Fill; frm.Show(); } if (e.ColumnIndex == dtGrid.Columns["Remove"].Index && e.RowIndex >= 0) { if (MessageBox.Show("YES or No?", "Remove Patient from Queue ? ", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { DBConnect.Delete("queue", dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString()); Global._queues.RemoveAll(w => w.Id.Contains(dtGrid.Rows[e.RowIndex].Cells["id"].Value.ToString())); MessageBox.Show("Information deleted"); LoadData(); LoadItem(); } } }