private void LoadAct() { ShowAct.Children.Clear(); ShowAct.RowDefinitions.Clear(); ShowAct.ColumnDefinitions.Clear(); ShowAct.SetRowFromGrid(MyTools.GL_Auto); Button add = new Button { Content = "Добавить акт" }; //var samples = Values.Select(x => Logic.LogicInstances.SampleLogic.FirstOrDefault(x.SampleID)).ToArray();\ var samples = selectionWell.Sample.SelectionWells.ToArray(); add.Click += (sender, e) => { var _querry = G.Volume.QUERRY() .SHOW .WHERE .C(C.Volume.Sample, samples.First().ID); for (int i = 1; i < samples.Length; i++) { _querry.OR.C(C.Volume.Sample, samples[i].ID); } _querry.DO(); SearchGrid_Window sg = new SearchGrid_Window(G.Volume, null, null, new C_SettingSearchDataGrid(DefDeleg: true)); sg.ShowDialog(); if (sg.SelectID > 0) { MyTools.AddRowFromTable(G.NormDoc, new KeyValuePair <int, object>(C.NormDoc.Volume, sg.SelectID)); } LoadAct(); }; ShowAct.SetFromGrid(add); if (samples.Any()) { var querry = G.NormDoc.QUERRY() .SHOW .WHERE .ARC(C.NormDoc.Volume, C.Volume.Sample, C.Sample.YM).EQUI.BV(DateControl_Class.SelectMonth); querry.AND.OB().ARC(C.NormDoc.Volume, C.Volume.Sample).EQUI.BV(samples.First().ID); for (int i = 1; i < samples.Length; i++) { querry.OR.ARC(C.NormDoc.Volume, C.Volume.Sample).EQUI.BV(samples[i].ID); } querry.DO(); List <NormDoc> normDocs = new List <NormDoc>(); int count = G.NormDoc.Rows.Count; for (int i = 0; i < count; i++) { ShowAct.SetRowFromGrid(MyTools.GL_Auto); normDocs.Add(Logic.LogicInstances.NormDocLogic.FirstOrDefault(G.NormDoc.Rows.GetID(i))); ShowAct.SetFromGrid(normDocs.Last().GetEditor(new MyTools.C_SettingFromRowEdit(MyTools.EPosition.Vertical))); } } }
private void LoadAct() { ShowAct.Children.Clear(); ShowAct.RowDefinitions.Clear(); ShowAct.ColumnDefinitions.Clear(); ShowAct.SetRowFromGrid(MyTools.GL_Auto); Button add = new Button { Content = "Добавить акт" }; add.Click += Act_Click; ShowAct.SetFromGrid(add); var normDocs = Helpers.LogicHelper.NormDocLogic.Find(selectionWell.SampleID); foreach(var normDoc in normDocs) { ShowAct.SetRowFromGrid(MyTools.GL_Auto); ShowAct.SetFromGrid(normDoc.GetEditor(new MyTools.C_SettingFromRowEdit(MyTools.EPosition.Vertical))); } }