Exemple #1
0
        public bool HandelNewInput(string[] date, out List <string> inputs, out bool DateExists, Canvas canvas)
        {
            inputs = new List <string>();
            EvaluateUpdate evaluateUpdate = new EvaluateUpdate();
            bool           OneOreMore     = false;

            DateExists = false;

            foreach (StackPanel items in ConfigProfile.WrapItems.Children)
            {
                DateExists = DateExists || ellipses[(items.Children[0] as TextBlock).Text].ContainsDate(date);
                if ((items.Children[1] as TextBox).Text != string.Empty)
                {
                    if ((items.Children[1] as TextBox).Text.Contains("."))
                    {
                        string[] input = (items.Children[1] as TextBox).Text.Split(".");
                        ellipses[(items.Children[0] as TextBlock).Text].Add(date, input, textOnCanvas.HorizontalText, textOnCanvas.HorizontalTextPositions, canvas);
                    }
                    else if ((items.Children[1] as TextBox).Text.Contains(","))
                    {
                        string[] input = (items.Children[1] as TextBox).Text.Split(",");
                        ellipses[(items.Children[0] as TextBlock).Text].Add(date, input, textOnCanvas.HorizontalText, textOnCanvas.HorizontalTextPositions, canvas);
                    }
                    else
                    {
                        string[] input = { (items.Children[1] as TextBox).Text, "00" };
                        ellipses[(items.Children[0] as TextBlock).Text].Add(date, input, textOnCanvas.HorizontalText, textOnCanvas.HorizontalTextPositions, canvas);

                        string toDebug = $"{(items.Children[0] as TextBlock).Text} : {(items.Children[1] as TextBox).Text}";
                        Debug.WriteLine(toDebug);
                    }
                    OneOreMore = true;
                }

                evaluateUpdate.evaluate(ellipses[(items.Children[0] as TextBlock).Text].Update, ellipses[(items.Children[0] as TextBlock).Text].changeMax, ellipses[(items.Children[0] as TextBlock).Text].changeMin,
                                        ellipses[(items.Children[0] as TextBlock).Text].CurrentMax, ellipses[(items.Children[0] as TextBlock).Text].CurrentMin);

                inputs.Add((items.Children[1] as TextBox).Text);
                (items.Children[1] as TextBox).Text = "";
            }

            if (evaluateUpdate.update(common))
            {
                UpdateChartForeNewInput();
            }

            return(OneOreMore);
        }
Exemple #2
0
        public bool HandelInputFromDB(List <List <string> > rows, Canvas canvas)
        {
            EvaluateUpdate evaluateUpdate = new EvaluateUpdate();

            foreach (List <string> row in rows)
            {
                string[] date = row[0].Split(".");

                int i = 1;
                foreach (StackPanel items in ConfigProfile.WrapItems.Children)
                {
                    if (row[i] != string.Empty)
                    {
                        if (row[i].Contains("."))
                        {
                            string[] input = row[i].Split(".");

                            ellipses[(items.Children[0] as TextBlock).Text].Add(date, input, textOnCanvas.HorizontalText, textOnCanvas.HorizontalTextPositions, canvas);
                        }
                        else if (row[i].Contains(","))
                        {
                            string[] input = row[i].Split(",");

                            ellipses[(items.Children[0] as TextBlock).Text].Add(date, input, textOnCanvas.HorizontalText, textOnCanvas.HorizontalTextPositions, canvas);
                        }
                        else
                        {
                            string[] input = { row[i], "00" };

                            ellipses[(items.Children[0] as TextBlock).Text].Add(date, input, textOnCanvas.HorizontalText, textOnCanvas.HorizontalTextPositions, canvas);
                        }
                        evaluateUpdate.evaluate(ellipses[(items.Children[0] as TextBlock).Text].Update, ellipses[(items.Children[0] as TextBlock).Text].changeMax, ellipses[(items.Children[0] as TextBlock).Text].changeMin,
                                                ellipses[(items.Children[0] as TextBlock).Text].CurrentMax, ellipses[(items.Children[0] as TextBlock).Text].CurrentMin);
                    }

                    i++;
                }
            }

            if (evaluateUpdate.update(common))
            {
                UpdateChartForeNewInput();
            }

            return(true);
        }