public ui_nurse_landing(String id) { InitializeComponent(); n_id = id; dataTable = DBhelper.read("select * from nurse where n_id='" + n_id + "'"); DataRow dataRow = dataTable.Rows[0]; name = dataRow["NNAME"].ToString(); ward = dataRow["WNAME"].ToString(); lbl_nurse_name.Text = name; lbl_nurse_ward.Text = ward; lbl_ward_count.Text = wardcount + " patients in ward"; this.Text = id; loadPatients(); }
public ui_doctor_landing(String id) { InitializeComponent(); d_id = id; dataTable = DBhelper.read("select * from doctor where d_id='" + d_id + "'"); DataRow dataRow = dataTable.Rows[0]; name = dataRow["NAME"].ToString(); dept = dataRow["DEPTNAME"].ToString(); queue = dataRow["ASSIGNED_PATIENTS"].ToString(); lbl_doc_name.Text = name; lbl_doc_dept.Text = dept; lbl_patient_queue.Text = queue; this.Text = d_id; loadPatients(); }
private void btn_discharge_Click(object sender, EventArgs e) { if (grid_patient_ward.SelectedCells.Count > 0) { int selectedrowindex = grid_patient_ward.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = grid_patient_ward.Rows[selectedrowindex]; string dischargedPatient = Convert.ToString(selectedRow.Cells["ID"].Value); DialogResult dialogResult = MessageBox.Show("Discharge " + dischargedPatient + "?", "Confirm discharge", MessageBoxButtons.OKCancel); if (dialogResult == DialogResult.OK) { DBhelper.discharge(dischargedPatient, ward); lbl_ward_count.Text = (int.Parse(lbl_ward_count.Text) - 1).ToString(); loadPatients(); } } }
private void btn_discharge_doc_Click(object sender, EventArgs e) { if (grid_patients_dept.SelectedCells.Count > 0) { int selectedrowindex = grid_patients_dept.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = grid_patients_dept.Rows[selectedrowindex]; string dischargedPatient = Convert.ToString(selectedRow.Cells["ID"].Value); DialogResult dialogResult = MessageBox.Show("Discharge " + dischargedPatient + "?", "Confirm discharge", MessageBoxButtons.OKCancel); if (dialogResult == DialogResult.OK) { DBhelper.discharge_doc(dischargedPatient, dept); lbl_patient_queue.Text = (int.Parse(lbl_patient_queue.Text) - 1).ToString(); DBhelper.update("update doctor set assigned_patients=assigned_patients-1 where d_id='" + d_id + "'"); loadPatients(); } } }