Пример #1
0
        private void LedWasteDetails_Load(object sender, EventArgs e)
        {
            dataGridView1.Rows.Clear();
            double usedA    = 0;
            double usedB    = 0;
            double droppedA = 0;
            double droppedB = 0;

            for (int i = 1; i < sourceTable.Rows.Count; i++)
            {
                usedA    += double.Parse(sourceTable.Rows[i]["Mont.A"].ToString());
                usedB    += double.Parse(sourceTable.Rows[i]["Mont.B"].ToString());
                droppedA += double.Parse(sourceTable.Rows[i]["Odp_A"].ToString());
                droppedB += double.Parse(sourceTable.Rows[i]["Odp_B"].ToString());
            }

            labelTitle.Text  = sourceTable.Rows[0][0].ToString() + Environment.NewLine;
            labelTitle.Text += "odpad A=" + Math.Round(droppedA / usedA * 100, 2) + "% odpad B=" + Math.Round(droppedB / usedB * 100, 2) + "%";

            sourceTable.Rows.RemoveAt(0);
            Charting.DrawLedWasteForDetailView(sourceTable, chartLedWasteDetails);
            dataGridView1.DataSource = sourceTable;
            sourceTable.Rows.Add("Total", "", "", "", usedA, droppedA, usedB, droppedB);

            SMTOperations.autoSizeGridColumns(dataGridView1);
        }