Esempio n. 1
0
 private void manufacturingOk_Click(object sender, EventArgs e)
 {
     if (manufacturingTxtComponent1.Text.Equals(ItemManufacturingRecordManager.UnspecifiedComponentId))
     {
         // When the first component is unspecified we assume the user intends
         // to delete the manufacturing recipe
         if (m_tableIO.getState().Equals(TableIO.State.View))
         {
             // Only delete on View since Add only creates the record during save
             m_tableIO.recordDelete();
         }
         this.Close();
     }
     else
     {
         DataValidation.Result dataValidationResult = m_tableIO.recordValid();
         if (dataValidationResult == null || dataValidationResult.isValid())
         {
             if (m_tableIO.recordSave(m_itemId))
             {
                 this.Close();
             }
         }
         else
         {
             dataValidationResult.showMessage();
         }
     }
     // Not every path leads to this.Close() and that is intentional
 }