private void rbBtnYes_CheckedChanged(object sender, EventArgs e) { RadioButton oRad = sender as RadioButton; if (oRad != null && formloaded) { if (oRad.Checked) { var selected = (TLDYE_DyeBatch)cmboBatchNo.SelectedItem; if (selected != null) { var machop = (TLADM_MachineOperators)cmboOperator.SelectedItem; if (machop == null) { MessageBox.Show("Please select an operator"); rbBtnNo.Checked = true; return; } frmDye_NonCompliance nonCom = new frmDye_NonCompliance(selected.DYEB_Pk, machop.MachOp_Pk, 1); nonCom.ShowDialog(this); } else { MessageBox.Show("Please select a dye batch"); rbBtnNo.Checked = true; } } } }
private void rbPassNo_CheckedChanged(object sender, EventArgs e) { RadioButton oRad = sender as RadioButton; if (oRad != null && formloaded) { if (oRad.Checked) { var DB = (TLDYE_DyeBatch)cmboBatchNumber.SelectedItem; if (DB == null) { MessageBox.Show("Please select a dye batch from the drop down list"); return; } var Selected = (TLADM_MachineOperators)cmboOperator.SelectedItem; if (Selected == null) { MessageBox.Show("Please select an operator from the drop down box"); return; } if (_StabAfterDrying) { frmDye_NonCompliance nonCom = new frmDye_NonCompliance(DB.DYEB_Pk, Selected.MachOp_Pk, 2); nonCom.ShowDialog(this); } else { frmDye_NonCompliance nonCom = new frmDye_NonCompliance(DB.DYEB_Pk, Selected.MachOp_Pk, 3); nonCom.ShowDialog(this); } } } }