private void SaveButton_Click(object sender, EventArgs e)
        {
            int maxweight = string.IsNullOrEmpty(maxWeightTextBox.Text) ? 0 : Convert.ToInt32(maxWeightTextBox.Text);

            aRefrigerator = new Refrigerator(maxweight);
            maxWeightTextBox.Clear();
        }
示例#2
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            double maxWeight = Convert.ToDouble(maxWeightTakeTextBox.Text);

            Refrigerator = new Refrigerator(maxWeight);
            maxWeightTakeTextBox.Text = "";
            Show();
        }
 private void SaveButton_Click(object sender, EventArgs e)
 {
     try
     {
         flag4        = true;
         refrigerator = new Refrigerator(Convert.ToDouble(maxWeightTakeTextBox.Text));
         maxWeightTakeTextBox.Clear();
     }
     catch (Exception m)
     {
         MessageBox.Show("Please input a double number only.");
     }
 }
示例#4
0
 private void SaveButton(object sender, EventArgs e)
 {
     refrigerator = new Refrigerator(Convert.ToDouble(maxWeightTakeTextBox.Text));
     maxWeightTakeTextBox.Clear();
 }