protected override void internalStart() { #region 644 book = TemplateStorage.WorkBook; if (CreateStyle()) { name = "644"; sheet = book.GetSheet("Реестр"); Progress_ = new Progress_Form($"Сбор по {name}", new CreateTable()); Progress_.ShowDialog(); LoadCap(name); Print("Реестр", $"Реестр {name} {MyTools.YearMonth_From_YM(DateControl_Class.SelectMonth)}", EPathPrint.Documents); } #endregion #region 621 book = TemplateStorage.WorkBook; if (CreateStyle()) { name = "621"; sheet = book.GetSheet("Реестр"); Progress_ = new Progress_Form($"Сбор по {name}", new CreateTable()); Progress_.ShowDialog(); LoadCap(name); Print("Реестр", $"Реестр {name} {MyTools.YearMonth_From_YM(DateControl_Class.SelectMonth)}", EPathPrint.Documents); } #endregion }
public override bool StartLoad() { aObject = new progressSetAdd(); compares = new List <Compare>(); _progress = new Progress_Form(aObject); _progress.ShowDialog(); MessageBox.Show("Загрузка окончена!"); if (message != string.Empty) { MessageBox.Show($"Не найденные записи в базе: {message.Trim(' ', ',')}"); } if (compares.Count > 0) { CustomMessage_Window customMessage = new CustomMessage_Window(new CustomMessage_Window.SettingWindow("Показатели не совпавшие по значениям", WindowStartupLocation.CenterScreen, CanResize: true)); DataGrid DG = new DataGrid(); List <MyTools.C_DGColumn_Bind> list = new List <MyTools.C_DGColumn_Bind>(); list.Add(new MyTools.C_DGColumn_Bind(ColCompare.replace, MyTools.E_TypeColumnDG.CheckBox, "Select", new MyTools.C_Setting_DGColumn(System.Windows.Data.BindingMode.TwoWay))); list.Add(new MyTools.C_DGColumn_Bind(ColCompare.select, MyTools.E_TypeColumnDG.Text, "Number", setting)); list.Add(new MyTools.C_DGColumn_Bind(ColCompare.wes, MyTools.E_TypeColumnDG.Text, "Wes", setting)); list.Add(new MyTools.C_DGColumn_Bind(ColCompare.become, MyTools.E_TypeColumnDG.Text, "Become", setting)); foreach (var one in list) { DG.Columns.Add(one.Column); } DG.AutoGenerateColumns = false; DG.ItemsSource = compares; customMessage.ShowControl.SetFromGrid(DG); Button bPrint = new Button(); bPrint.Content = "Распечатать"; bPrint.Click += (sender, e) => { MyTools.PrintList(compares, $"{Directory.GetCurrentDirectory()}\\Отчёты\\Синхронизация", $"Отчёт{DateTime.Now.ToShortDateString()}"); }; customMessage.wpButtons.Children.Add(bPrint); Button bForceDownload = new Button(); bForceDownload.Content = "Загрузить принудительно"; bForceDownload.Click += (sender, e) => { ForceDownload = true; StartLoad(); if (compares.Count > 0) { DG.ItemsSource = null; DG.ItemsSource = compares; } else { bForceDownload.IsEnabled = false; } }; customMessage.wpButtons.Children.Add(bForceDownload); customMessage.ShowDialog(); } CanReStart(); return(true); }
private void LoadSelection() { G.SelectionWell.QUERRY() .SHOW .WHERE .ARC(C.SelectionWell.Sample, C.Sample.YM).EQUI.BV(YM - 1) .DO(); calcs = new calc[G.SelectionWell.Rows.Count]; load_sw openFile = new load_sw(calcs.Length, new Func <int, bool>( IndexRow => { calcs[IndexRow] = new calc(G.SelectionWell.Rows.GetID(IndexRow)); return(true); })); _progress = new Progress_Form(openFile); _progress.ShowDialog(); }
protected override void Start() { string dat = SearthCellFromMark("Выгрузка от:", false).StringCellValue; YM = (int)MyTools.StringDATE_In_intDate(dat.Substring(dat.IndexOf(':') + 1), MyTools.EInputDate.YM, MyTools.EInputDate.YM); TextBlock text = new TextBlock(); text.Background = Brushes.LightCoral; text.FontSize = 20; text.Text = dat; wpText.Children.Add(text); shows = new List <show>(); progressOpenFile openFile = new progressOpenFile(sheet.LastRowNum - StartRow, new Func <int, bool>( RowIndex => { IRow row = sheet.GetRow(RowIndex); int select = 0; Dictionary <string, decimal> value = new Dictionary <string, decimal>(); foreach (var one in ColumnsBook) { if (one.Key == col.select) { select = row.GetCell(one.Value).ToString().TryParseInt(); } else { if (one.Value > 0 && row.GetCell(one.Value).ToString() != "0") { value.Add(one.Key, row.GetCell(one.Value).ToString().TryParseDecimal()); } } } if (select != 0) { shows.Add(new show(select, value)); } return(true); })); _progress = new Progress_Form(openFile); _progress.ShowDialog(); DG.ItemsSource = shows; }
public override bool StartLoad() { G.NormDoc.QUERRY() .SHOW .WHERE .ARC(C.NormDoc.Volume, C.Volume.Sample, C.Sample.YM).EQUI.BV(YM - 1) .DO(); NormDoc[] normDocs = new NormDoc[G.NormDoc.Rows.Count]; for (int i = 0; i < normDocs.Length; i++) { normDocs[i] = new NormDoc(G.NormDoc.Rows.GetID(i)); } show[] _temp = shows.ToArray(); load_sw load = new load_sw(_temp.Length, new Func <int, bool>( IndexRow => { show temp = _temp[IndexRow]; if (temp.VolumeID > 0) { if (normDocs.FirstOrDefault(x => temp.act == x.Act && temp.invoces == x.Invoces && temp.score == x.Score) == null) { MyTools.AddRowFromTable(G.NormDoc, new KeyValuePair <int, object>(C.NormDoc.Act, temp.act), new KeyValuePair <int, object>(C.NormDoc.Score, temp.score), new KeyValuePair <int, object>(C.NormDoc.Invoces, temp.invoces), new KeyValuePair <int, object>(C.NormDoc.Volume, temp.VolumeID), new KeyValuePair <int, object>(C.NormDoc.Date, temp._date), new KeyValuePair <int, object>(C.NormDoc.Summ, temp.summ), new KeyValuePair <int, object>(C.NormDoc.Resolution, PollutionBase_Class.AllResolution.First(x => x.CurtName.Contains(temp.type_calc)).ID) ); } shows.Remove(temp); } return(true); })); _progress = new Progress_Form(load); _progress.ShowDialog(); DG.ItemsSource = null; DG.ItemsSource = shows; return(true); }
protected override void Start() { string dat = SearthCellFromMark("Дата начала: ", false).StringCellValue; YM = (int)MyTools.StringDATE_In_intDate(dat.Substring(dat.IndexOf(':') + 1), MyTools.EInputDate.YMDHMS, MyTools.EInputDate.YM); LoadSelection(); shows = new List <show>(); progressOpenFile openFile = new progressOpenFile(sheet.LastRowNum - StartRow, new Func <int, bool>( RowIndex => { IRow row = sheet.GetRow(RowIndex); calc[] _calc = null; Dictionary <string, object> value = new Dictionary <string, object>(); foreach (var one in ColumnsBook) { string val = row.GetCell(one.Value).ToString(); if (one.Key == col.ls) { if (!val.Contains('\'')) { throw new Exception($"Колонка {col.ls} не содержит символ: \'"); } val = val.Replace("\'", ""); _calc = calcs.Where(x => x.objecte.Accounts.Contains(val)).ToArray(); } if (_calc.Length == 0 && one.Key == col.inn) { _calc = calcs.Select(x => new { client = x.client, calc = x }).Where(x => x.client.INN == val).Select(x => x.calc).ToArray(); } value.Add(one.Key, val); } shows.Add(new show(_calc, value)); return(true); })); _progress = new Progress_Form(openFile); _progress.ShowDialog(); DG.ItemsSource = shows; }