private void btnMedicationLookup_Click(object sender, EventArgs e) { //load medication look up frmMedicationLookUp frmML = new frmMedicationLookUp(); //initialize variables frmML.v_medCode = medication_Codes; frmML.v_medName = txtMedicationNames.Text; frmML.v_medQty = medication_Qty; frmML.v_medPrice = medication_Price; frmML.v_medSubTotal = medication_SubTotal; //validate medication cost decimal medCost = 0; if (decimal.TryParse(txtMedicationCost.Text, out medCost)) { frmML.v_Total = decimal.Parse(txtMedicationCost.Text); } else { frmML.v_Total = 0; } //display the lookup frmML.ShowDialog(); //capture the data medication_Codes = frmML.v_medCode; txtMedicationNames.Text = frmML.v_medName; medication_Qty = frmML.v_medQty; medication_Price = frmML.v_medPrice; medication_SubTotal = frmML.v_medSubTotal; txtMedicationCost.Text = frmML.v_Total.ToString(); }
private void btnMedicationLookUp_Click(object sender, EventArgs e) { frmMedicationLookUp frmML = new frmMedicationLookUp(); frmML.v_medCode = this.lblMedCode.Text; frmML.v_medName = txtMedicationNames.Text; frmML.v_medQty = lblQty.Text; frmML.v_medPrice = lblPrice.Text; frmML.v_medSubTotal = lblSubTotal.Text; frmML.v_Total = decimal.Parse(txtMedicationCost.Text); frmML.ShowDialog(); lblMedCode.Text = frmML.v_medCode; txtMedicationNames.Text = frmML.v_medName; lblQty.Text = frmML.v_medQty; lblPrice.Text = frmML.v_medPrice; lblSubTotal.Text = frmML.v_medSubTotal; txtMedicationCost.Text = frmML.v_Total.ToString(); }