//============================================================================* // OnEditChargeTest() //============================================================================* private void OnEditChargeTest(object sender, EventArgs e) { //----------------------------------------------------------------------------* // Get the selected charge test //----------------------------------------------------------------------------* cChargeTest OldChargeTest = (cChargeTest)ChargeTestListView.SelectedItems[0].Tag; //----------------------------------------------------------------------------* // Start the dialog //----------------------------------------------------------------------------* cChargeTestForm ChargeTestForm = new cChargeTestForm(OldChargeTest, m_Load, m_DataFiles); if (ChargeTestForm.ShowDialog() == DialogResult.OK) { //----------------------------------------------------------------------------* // Get the new Manufacturer Data //----------------------------------------------------------------------------* cChargeTest ChargeTest = ChargeTestForm.ChargeTest; //----------------------------------------------------------------------------* // Remove the old charge test and insert the new //----------------------------------------------------------------------------* m_Charge.TestList.Remove(OldChargeTest); m_Charge.TestList.Add(ChargeTest); PopulateChargeTestListView(); } }
//============================================================================* // OnAddChargeTest() //============================================================================* private void OnAddChargeTest(object sender, EventArgs e) { //----------------------------------------------------------------------------* // Start the dialog //----------------------------------------------------------------------------* cChargeTestForm ChargeTestForm = new cChargeTestForm(null, m_Load, m_DataFiles); if (ChargeTestForm.ShowDialog() == DialogResult.OK) { //----------------------------------------------------------------------------* // Get the new Manufacturer Data //----------------------------------------------------------------------------* cChargeTest ChargeTest = ChargeTestForm.ChargeTest; m_DataFiles.Preferences.LastChargeTest = ChargeTestForm.ChargeTest; //----------------------------------------------------------------------------* // See if the Charge already exists //----------------------------------------------------------------------------* m_Charge.TestList.Add(ChargeTest); PopulateChargeTestListView(); } }