/// <summary>Заполнить лист хранилище</summary> private void DRAW_THIS() { PollutionBase_Class.LoadSelectedWells(DateControl_Class.SelectMonth); var actualSelectionWells = PollutionBase_Class.ListSelectionWell.Where(x => x.Number > 0).OrderBy(x => x.Number).ToArray(); foreach (var actialSelectionWell in actualSelectionWells) { List <KeyValuePair <string, decimal> > Summs = new List <KeyValuePair <string, decimal> >(); //расчеты if (!ColumnOff.Contains(ThisColumn.Summn)) { Sample samp = actialSelectionWell.Sample; Objecte obj = actialSelectionWell.Well.Objecte; KeyValuePair <uint, BaseCalc_Class.Summs>[] summs; Resolution resolution; #region 644 resolution = PollutionBase_Class.AllResolution.First(x => x.CurtName.Contains("644")); if (obj.CanResolution(resolution.ID)) { calc = new Calc_644(samp, obj, resolution); summs = calc.Calc(); Summs.AddRange(summs.Select(x => new KeyValuePair <string, decimal>("644:", x.Value.SummNDS))); } #endregion #region 621 resolution = PollutionBase_Class.AllResolution.First(x => x.CurtName.Contains("621")); if (obj.CanResolution(resolution.ID)) { calc = new Calc_621(samp, obj, resolution); summs = calc.Calc(); Summs.AddRange(summs.Select(x => new KeyValuePair <string, decimal>("621:", x.Value.SummNDS))); } #endregion } Dictionary <string, ValueWork> values = new Dictionary <string, ValueWork>(); //концентрации if (!ColumnOff.Contains(ThisColumn.Pollution)) { foreach (var pollution in PollutionBase_Class.AllPolutions) { values.Add(pollution.BindName, new ValueWork(pollution.ID, actialSelectionWell.ID)); } foreach (var selectionValue in actialSelectionWell.ValueSelections) { values[selectionValue.Pollution.BindName] = new ValueWork(selectionValue.ID); } } Values.Add(new SHOW(actialSelectionWell, Summs.ToArray(), values.Values.ToArray())); } }
/// <summary>Перерисовать колонки</summary> public void DrawColumns() { DG.Columns.Clear(); foreach (var one in columns) { if (one.Number > 0 && (ColumnOff.Contains(one.Number) || (ColumnOff.Contains(ThisColumn.Pollution) && one.Number >= ThisColumn.Pollution))) { continue; } DG.Columns.Add(one.Column); } DG.FrozenColumnCount = 9 - ColumnOff.Count; Draw(); }