private void invoiceToolStripMenuItem_Click(object sender, EventArgs e) { frmInvoice frm = new frmInvoice(); frm.lblUser.Text = lblUser.Text; frm.Reset(); frm.Show(); }
private void dgw_MouseClick(object sender, MouseEventArgs e) { try { if (lblOperation.Text == "Invoice") { DataGridViewRow dr = dgw.SelectedRows[0]; this.Hide(); frmInvoice frm = new frmInvoice(); frm.Show(); frm.txtID.Text = dr.Cells[0].Value.ToString(); frm.txtInvoiceNo.Text = dr.Cells[1].Value.ToString(); frm.dtpInvoiceDate.Text = dr.Cells[2].Value.ToString(); frm.dtpDateFrom.Text = dr.Cells[3].Value.ToString(); frm.dtpDateTo.Text = dr.Cells[4].Value.ToString(); frm.txtP_ID.Text = dr.Cells[5].Value.ToString(); frm.txtPatientID.Text = dr.Cells[6].Value.ToString(); frm.txtPatientName.Text = dr.Cells[7].Value.ToString(); frm.txtCopayAmount.Text = dr.Cells[8].Value.ToString(); frm.txtCharges.Text = dr.Cells[9].Value.ToString(); frm.txtGrandTotal.Text = dr.Cells[10].Value.ToString(); frm.txtTotalPaid.Text = dr.Cells[11].Value.ToString(); frm.txtPaymentDue.Text = dr.Cells[12].Value.ToString(); frm.btnUpdate.Enabled = true; frm.btnDelete.Enabled = true; frm.btnSave.Enabled = false; frm.button2.Enabled = false; frm.dtpInvoiceDate.Enabled = false; frm.lblUser.Text = lblUser.Text; lblOperation.Text = ""; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
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); } }