Beispiel #1
0
        private void buttonCalc(object sender, EventArgs e)
        {
            FreightClassCalc fc = new FreightClassCalc();
            DimensionClass   dc = new DimensionClass();

            if (double.TryParse(textHeight.Text, out height) &&
                double.TryParse(textWidth.Text, out width) &&
                double.TryParse(textDepth.Text, out depth) &&
                double.TryParse(textWeight.Text, out weight))
            {
                textDensity.Text      = fc.getDensity(height, width, depth, weight, ref dc).ToString();
                textFreightClass.Text = fc.getFreightClass(fc.getDensity(height, width, depth, weight, ref dc)).ToString();
                dimensionsList.Add(dc);
                btnClear.Enabled = true;
            }
        }
Beispiel #2
0
        private void btnAdd(object sender, EventArgs e)
        {
            FreightClassCalc fc1 = new FreightClassCalc();

            String density = "Item Density: " + textDensity.Text;
            String freight = "Freight Class: " + textFreightClass.Text;

            textHeight.Clear();
            textWidth.Clear();
            textDepth.Clear();
            textWeight.Clear();
            historyLog.Items.Add(density);
            historyLog.Items.Add(freight);
            historyLog.Items.Add("");

            textTotalDensity.Text = fc1.getDensity(dimensionsList).ToString();
            textFreightTotal.Text = (fc1.getFreightClass(Double.Parse(textTotalDensity.Text))).ToString();
            textDensity.Clear();
            textFreightClass.Clear();
        }