Beispiel #1
0
        private void diagIssueButt_Click(object sender, EventArgs e)
        {
            List <List <object> > formulas = new List <List <object> >();
            List <object>         formIds  = new List <object>();
            List <List <object> > list     = new List <List <object> >();
            List <object>         names    = new List <object>();

            for (int i = 0; i < addedIssueSerias.Items.Count; i++)
            {
                formulas = dbManager.GetRows("calculations_result",
                                             "id_of_formula", "calculation_number = " + addedIssueSerias.Items[i]);
            }

            for (int i = 0; i < formulas.Count; i++)
            {
                formIds.Add(formulas[i][0]);
            }

            IEnumerable <object> ids = formIds.Distinct();

            foreach (object i in ids)
            {
                list.Add(getResult(i));
                names.Add(dbManager.GetValue("formulas", "name_of_formula", "id_of_formula = " + i));
            }

            List <Object> listOfSerias = new List <object>();

            for (int i = 0; i < addedIssueSerias.Items.Count; i++)
            {
                listOfSerias.Add(addedIssueSerias.Items[i]);
            }

            chart = new ChartM("Значення формули у серії", "range");
            chart.drawIssue(listOfSerias, list, names);
            chart.ShowDialog();
        }
Beispiel #2
0
        // рисуем диаграму проблемы
        private void diagIssueButt_Click(object sender, EventArgs e)
        {
            if (problemBox.SelectedItem != null & addedIssueSerias.Items.Count != 0 & formulasList.CheckedItems.Count != 0)
            {
                List <List <object> > formulas = new List <List <object> >();
                List <object>         formIds  = new List <object>();
                List <List <object> > list     = new List <List <object> >();
                List <string>         names    = new List <string>();

                List <Object> ids = new List <object>();
                for (int i = 0; i < formulasList.CheckedItems.Count; i++)
                {
                    ids.Add(dbManager.GetValue("formulas", "id_of_formula", "name_of_formula = '" + formulasList.CheckedItems[i] + "'" + " AND id_of_expert =" + id_of_expert));
                }

                foreach (object i in ids)
                {
                    list.Add(getResult(i));
                    names.Add(dbManager.GetValue("formulas", "name_of_formula", "id_of_formula = " + i + " AND id_of_expert =" + id_of_expert) + " (" +
                              dbManager.GetValue("formulas", "measurement_of_formula", "id_of_formula = " + i + " AND id_of_expert =" + id_of_expert) + ")");
                }

                List <Object> listOfSerias = new List <object>();
                for (int i = 0; i < addedIssueSerias.Items.Count; i++)
                {
                    listOfSerias.Add(addedIssueSerias.Items[i]);
                }

                chart = new ChartM("Значення формули у серії", "range");
                chart.drawIssue(listOfSerias, list, names);
                chart.ShowDialog();
            }
            else
            {
                MessageBox.Show("Поля не заповнені");
            }
        }