private void LoadData()
        {
            Intervals intervals = new Intervals(_type);
            List <Intervals.IntervalStruct> list = intervals.GetIntervals();
            int i = 0;

            dataGridView1.Rows.Clear();
            foreach (var l in list)
            {
                dataGridView1.Rows.Add();
                dataGridView1.Rows[i].Cells["Number"].Value = i + 1;
                dataGridView1.Rows[i].Cells["Year"].Value   = l.Year;
                dataGridView1.Rows[i].Cells["Period"].Value = l.Period;
                i++;
            }
        }
Beispiel #2
0
        private void LoadData()
        {
            _intervals = new Intervals(_type);
            List <Intervals.IntervalStruct> intervalsList = _intervals.GetIntervals();
            int i = 0;

            dataGridView1.Rows.Clear();
            foreach (var l in intervalsList)
            {
                dataGridView1.Rows.Add();
                dataGridView1.Rows[i].Cells["Number"].Value = i + 1;
                dataGridView1.Rows[i].Cells["Year"].Value   = l.Year;
                dataGridView1.Rows[i].Cells["Period"].Value = l.Period;
                dataGridView1.Rows[i].Cells["Check"].Value  = false;
                i++;
            }

            dataGridView2.Rows.Add(2);
            dataGridView2.Rows[0].Cells["N"].Value     = "";
            dataGridView2.Rows[0].Cells["Code"].Value  = "Year";
            dataGridView2.Rows[0].Cells["PName"].Value = "Год";
            dataGridView2.Rows[1].Cells["N"].Value     = "";
            dataGridView2.Rows[1].Cells["Code"].Value  = "Period";
            dataGridView2.Rows[1].Cells["PName"].Value = "Период";

            _paramsList = new ParamsList(_type);
            List <Params> paramsList = _paramsList.GetNameList();

            i = 2;
            foreach (var l in paramsList)
            {
                dataGridView2.Rows.Add();
                dataGridView2.Rows[i].Cells["N"].Value     = i - 1;
                dataGridView2.Rows[i].Cells["Code"].Value  = l.Code;
                dataGridView2.Rows[i].Cells["PName"].Value = l.Name;
                i++;
            }
        }