private async void DialogControllerImportarPlanilha_Accepting(object sender, DialogControllerAcceptingEventArgs e) { DataTableCollection dtcollectionImport = null; ((DialogController)sender).AcceptAction.Enabled["NoEnabled"] = false; //Necessário para não fechar a janela após a conclusão do processamento e.Cancel = true; e.AcceptActionArgs.Action.Caption = "Procesando"; var parametros = (ParametrosImportComponentEJunta)e.AcceptActionArgs.SelectedObjects[0]; MemoryStream stream = new MemoryStream(); stream.Seek(0, SeekOrigin.Begin); var arquivo = parametros.Padrao; arquivo.SaveToStream(stream); stream.Seek(0, SeekOrigin.Begin); using (var excelReader = new ExcelDataReaderHelper.Excel.Reader(stream)) { dtcollectionImport = excelReader.CreateDataTableCollection(false); } var import = new ImportComponentEJunta(objectSpaceProvider, parametrosImportComponentEJunta); var progress = new Progress <ImportProgressReport>(import.LogTrace); var simpleProgress = new Progress <string>(); await Observable.Start(() => import.ImportarComponente(dtcollectionImport["Piece"], progress)); parametros.ConcluidoComponente = true; await Observable.Start(() => import.ImportarJuntas(dtcollectionImport["Joints"], progress)); parametros.ConcluidoJuntas = true; //var gerador = new Calculator.ProcessoLoteLPPM.GerarLoteLPPM(objectSpaceProvider); //await gerador.GerarLoteLPPMAsync(simpleProgress); //parametros.ConcluidoLoteLPPM = true; objectSpace.CommitChanges(); e.AcceptActionArgs.Action.Caption = "Finalizado"; ((DialogController)sender).AcceptAction.Enabled["NoEnabled"] = true; }
private async void DialogControllerImportarPlanilha_Accepting(object sender, DialogControllerAcceptingEventArgs e) { ((DialogController)sender).AcceptAction.Enabled["NoEnabled"] = false; //Necessário para não fechar a janela após a conclusão do processamento e.Cancel = true; e.AcceptActionArgs.Action.Caption = "Procesando"; var parametros = (ParametrosAtualizacaoTabelasAuxiliares)e.AcceptActionArgs.SelectedObjects[0]; MemoryStream stream = new MemoryStream(); stream.Seek(0, SeekOrigin.Begin); var arquivo = parametros.Padrao; arquivo.SaveToStream(stream); stream.Seek(0, SeekOrigin.Begin); using (var excelReader = new ExcelDataReaderHelper.Excel.Reader(stream)) { dtcollectionImport = excelReader.CreateDataTableCollection(false); } var itba = new ImportTabelaAuxiliares(objectSpace, parametrosAtualizacaoTabelasAuxiliares); var progress = new Progress <ImportProgressReport>(itba.LogTrace); await Observable.Start(() => itba.ImportarDiametro(dtcollectionImport["TabDiametro"], progress)); await Observable.Start(() => itba.ImportarSchedule(dtcollectionImport["Schedule"], progress)); await Observable.Start(() => itba.ImportarPercInspecao(dtcollectionImport["PercInspecao"], progress)); await Observable.Start(() => itba.ImportarProcessoSoldagem(dtcollectionImport["ProcessoSoldagem"], progress)); await Observable.Start(() => itba.ImportarContrato(dtcollectionImport["Contrato"], progress)); await Observable.Start(() => itba.ImportarEAP(dtcollectionImport["EAPPipe"], progress)); objectSpace.CommitChanges(); e.AcceptActionArgs.Action.Caption = "Finalizado"; ((DialogController)sender).AcceptAction.Enabled["NoEnabled"] = true; }
private async void DialogControllerImportarPlanilha_Accepting(object sender, DialogControllerAcceptingEventArgs e) { DataTableCollection dtcollectionImport = null; ((DialogController)sender).AcceptAction.Enabled["NoEnabled"] = false; //Necessário para não fechar a janela após a conclusão do processamento e.Cancel = true; e.AcceptActionArgs.Action.Caption = "Procesando"; var parametros = (ParametrosImportSpoolJuntaExcel)e.AcceptActionArgs.SelectedObjects[0]; MemoryStream stream = new MemoryStream(); stream.Seek(0, SeekOrigin.Begin); var arquivo = parametros.Padrao; arquivo.SaveToStream(stream); stream.Seek(0, SeekOrigin.Begin); using (var excelReader = new ExcelDataReaderHelper.Excel.Reader(stream)) { dtcollectionImport = excelReader.CreateDataTableCollection(false); } var import = new ImportSpoolEJunta(objectSpace, parametrosImportSpoolJuntaExcel); var progress = new Progress <ImportProgressReport>(import.LogTrace); await Observable.Start(() => import.ImportarSpools(dtcollectionImport["SGS"], progress)); await Observable.Start(() => import.ImportarJuntas(dtcollectionImport["SGJ"], progress)); objectSpace.CommitChanges(); e.AcceptActionArgs.Action.Caption = "Finalizado"; ((DialogController)sender).AcceptAction.Enabled["NoEnabled"] = true; }