Exemplo n.º 1
0
        private void diagrButt_Click(object sender, EventArgs e)
        {
            if (funcComboBox.SelectedItem != null)
            {
                Object[] arrayOfY = new Object[addSeriaList.Items.Count];
                Object[] arrayOfX = new Object[addSeriaList.Items.Count];

                for (int i = 0; i < addSeriaList.Items.Count; i++)
                {
                    arrayOfY[i] = addSeriaList.Items[i];
                    arrayOfX[i] = dbManager.GetValue("calculations_result", "result", "calculation_number = "
                                                     + addSeriaList.Items[i] + " AND id_of_formula = " +
                                                     dbManager.GetValue("formulas", "id_of_formula", "description_of_formula = '" +
                                                                        funcComboBox.Text + "'" + " AND id_of_expert =" + id_of_expert) + " AND id_of_expert =" + id_of_expert);
                }

                chart = new ChartM(dbManager.GetValue("formulas", "name_of_formula",
                                                      "description_of_formula = '" + funcComboBox.Text + "'" + " AND id_of_expert =" + id_of_expert).ToString()
                                   + " ("
                                   + dbManager.GetValue("formulas", "measurement_of_formula",
                                                        "description_of_formula = '" + funcComboBox.Text + "'" + " AND id_of_expert =" + id_of_expert).ToString()
                                   + ")",
                                   "range");
                chart.draw(arrayOfX, arrayOfY);
                chart.ShowDialog();
            }
            else
            {
                MessageBox.Show("Оберіть показник");
            }
        }
Exemplo n.º 2
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();
        }
Exemplo n.º 3
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("Поля не заповнені");
            }
        }
Exemplo n.º 4
0
        private void graphButt_Click(object sender, EventArgs e)
        {
            Object[] arrayOfY = new Object[addSeriaList.Items.Count];
            Object[] arrayOfX = new Object[addSeriaList.Items.Count];

            for (int i = 0; i < addSeriaList.Items.Count; i++)
            {
                arrayOfY[i] = addSeriaList.Items[i];
                arrayOfX[i] = dbManager.GetValue("calculations_result", "result", "calculation_number = "
                                                 + addSeriaList.Items[i] + " AND id_of_formula = " +
                                                 dbManager.GetValue("formulas", "id_of_formula", "description_of_formula = '" +
                                                                    funcComboBox.Text + "'"));
            }

            chart = new ChartM(dbManager.GetValue("formulas", "name_of_formula",
                                                  "description_of_formula = '" + funcComboBox.Text + "'").ToString()
                               + " ("
                               + dbManager.GetValue("formulas", "measurement_of_formula",
                                                    "description_of_formula = '" + funcComboBox.Text + "'").ToString()
                               + ")"
                               , "line");
            chart.draw(arrayOfX, arrayOfY);
            chart.ShowDialog();
        }