示例#1
0
 private void saveNewPriceBTN_Click(object sender, EventArgs e)
 {
     if (addNewPrice)
     {
         // adding new price to the database
         try
         {
             string title = newPriceNameTB.Text;
             //string c = newPriceCostTB.Text.Substring(1);
             double        cost      = (double)newPriceCostNUD.Value;
             string        setupTime = "0:0:0";
             int           countUp   = priceTypeStandardRBTN.Checked ? 0 : 1;
             RunningConfig rc        = new RunningConfig(0, title, cost, setupTime, countUp);
             db.NewConfiguration(rc);
             PopulateCurrentPriceOptions();
         } catch (FormatException)
         {
             newPriceNameTB.Text = "Invalid price entry. " + newPriceCostNUD.Value;
             //newPriceCostTB.Text = "$0.00";
         }
     }
     else
     {
     }
 }