Пример #1
0
        private void AddMashStepButton_Click(object sender, RoutedEventArgs e)
        {
            double temp;

            if (!double.TryParse(MashStepTempTextBox.Text, out temp))
            {
                return;
            }

            int stepTime;

            if (!int.TryParse(MashStepTimeTextBox.Text, out stepTime))
            {
                return;
            }

            int heatOverTime = 0;

            if (MashProfileList.Count > 0)
            {
                if (!int.TryParse(MashHeatOverTimeTextBox.Text, out heatOverTime))
                {
                    return;
                }
            }

            var mps = new Domain.MashProfileStep();

            mps.Temperature  = temp;
            mps.StepTime     = stepTime;
            mps.HeatOverTime = heatOverTime;
            MashProfileList.Add(mps);
            var ol = MashProfileList.OrderBy(x => x.Temperature).ToList();

            MashProfileList.Clear();
            foreach (Domain.MashProfileStep ms in ol)
            {
                MashProfileList.Add(ms);
            }

            AddMashStepButton.Content = "Add";
        }
Пример #2
0
        private void AddMashStepButton_Click(object sender, RoutedEventArgs e)
        {
            double temp;
            if (!double.TryParse(MashStepTempTextBox.Text, out temp))
                return;

            int stepTime;
            if (!int.TryParse(MashStepTimeTextBox.Text, out stepTime))
                return;

            int heatOverTime = 0;
            if (MashProfileList.Count > 0)
            {
                if (!int.TryParse(MashHeatOverTimeTextBox.Text, out heatOverTime))
                    return;
            }

            var mps = new Domain.MashProfileStep();
            mps.Temperature = temp;
            mps.StepTime = stepTime;
            mps.HeatOverTime = heatOverTime;
            MashProfileList.Add(mps);
            var ol = MashProfileList.OrderBy(x => x.Temperature).ToList();
            MashProfileList.Clear();
            foreach (Domain.MashProfileStep ms in ol)
            {
                MashProfileList.Add(ms);
            }

            AddMashStepButton.Content = "Add";

        }