Example #1
0
 private void tbx12New_TextChanged(object sender, EventArgs e)
 {
     if (tbx12New.Text.Length > 0)
     {
         if (Support.isNumeric(tbx12New.Text) && Support.isValidAmount(tbx12New.Text))
         {
             btnSave.Enabled = true;
             new12UnitPrice  = decimal.Parse(tbx12New.Text);
         }
         else if (tbxSingleNewPrice.Text.Length == 0)
         {
             btnSave.Enabled = false;
             tbx12New.Clear();
             new12UnitPrice = 0;
             MessageBox.Show("Value you entered is not valid!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             tbx12New.Clear();
             MessageBox.Show("Value you entered is not valid!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             new12UnitPrice = 0;
         }
     }
 }