Ejemplo n.º 1
0
        private void enterButton_Click(object sender, EventArgs e)
        {
            _refrigerator.ItemNo.Add(int.Parse(itemNoTextBox.Text));
            _refrigerator.ItemWeight.Add(double.Parse(itemWeightTextBox.Text));

            double totalWeight = _refrigerator.CalculateWeight(count);

            count++;

            if (_refrigerator.Validate(totalWeight))
            {
                currentWeightTextBox.Text   = _refrigerator.CurrentWeight(totalWeight) + "";
                remainingWeightTextBox.Text = _refrigerator.RemainingWeight() + "";

                showRichTextBox.Text = _refrigerator.ShowValue();
            }
            else
            {
                MessageBox.Show("Weight Overflow!!");
            }

            itemNoTextBox.Clear();
            itemWeightTextBox.Clear();
        }