private void patientToolStripMenuItem_Click(object sender, EventArgs e) { frmPatient frm = new frmPatient(); frm.lblUser.Text = lblUser.Text; frm.Reset(); frm.Show(); }
private void dgw_MouseClick(object sender, MouseEventArgs e) { try { if (lblOperation.Text == "Patient Master") { DataGridViewRow dr = dgw.SelectedRows[0]; this.Hide(); frmPatient frm = new frmPatient(); frm.Show(); frm.txtID.Text = dr.Cells[0].Value.ToString(); frm.txtPatientID.Text = dr.Cells[1].Value.ToString(); frm.txtPatientName.Text = dr.Cells[2].Value.ToString(); if (dr.Cells[3].Value.ToString() == "Male") { frm.rbMale.Checked = true; } else { frm.rbFemale.Checked = true; } frm.dtpDOB.Text = dr.Cells[4].Value.ToString(); frm.txtEmailID.Text = dr.Cells[5].Value.ToString(); frm.txtContactNo.Text = dr.Cells[6].Value.ToString(); frm.txtInsuranceCompany.Text = dr.Cells[7].Value.ToString(); frm.txtAddress.Text = dr.Cells[8].Value.ToString(); frm.txtBillingContactPerson.Text = dr.Cells[9].Value.ToString(); frm.txtTelephoneNo.Text = dr.Cells[10].Value.ToString(); frm.btnUpdate.Enabled = true; frm.btnDelete.Enabled = true; frm.btnSave.Enabled = false; frm.lblUser.Text = lblUser.Text; lblOperation.Text = ""; } if (lblOperation.Text == "Procedure") { DataGridViewRow dr = dgw.SelectedRows[0]; this.Hide(); frmProcedure frm = new frmProcedure(); frm.Show(); frm.txtP_ID.Text = dr.Cells[0].Value.ToString(); frm.txtPatientID.Text = dr.Cells[1].Value.ToString(); frm.txtPatientName.Text = dr.Cells[2].Value.ToString(); frm.lblUser.Text = lblUser.Text; lblOperation.Text = ""; frm.auto(); } if (lblOperation.Text == "Invoice") { DataGridViewRow dr = dgw.SelectedRows[0]; this.Hide(); frmInvoice frm = new frmInvoice(); frm.Show(); frm.txtP_ID.Text = dr.Cells[0].Value.ToString(); frm.txtPatientID.Text = dr.Cells[1].Value.ToString(); frm.txtPatientName.Text = dr.Cells[2].Value.ToString(); frm.lblUser.Text = lblUser.Text; lblOperation.Text = ""; frm.auto(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }