/// <param name="project">ID projektu</param> /// <param name="year">Rok prognozy</param> /// <param name="variant">Ewentualne ID wariantu</param> /// <param name="model">ID modelu – ma znaczenie dla wydawanych parametrów</param> public DBReaderBatch(BlaRequest request, RoReporter rep = null, byte?connID = null) { Reporter = rep ?? new RoReporter(); Results = new Dictionary <byte, Stream>(); try { Reporter.AddMessage(new RoReMessage { Caller = "Inicjalizacja", EvType = RoReEventType.ModuleCall, Message = "Inicjalizacja systemu" }); __conn = _.SetupConnection(connID); Reporter.AddMessage(new RoReMessage { Caller = "Inicjalizacja", Message = $"DBServer: {__conn.Server}, Database: {__conn.Database}", EvType = RoReEventType.Info }); __storage = new BlaCommonStorage(__conn, request); __storage.Reporter = Reporter; __storage.Variant = new BlaDBVariantDefinition(__conn, request); } catch (Exception e) { Reporter.AddException(e, "Inicjalizacja"); } }
internal void WriteLog() { try { Reporter.SaveLog(Path.ChangeExtension(XMLFile, "log")); } catch (Exception e) { Reporter.AddException(e, "CLI"); } }
internal bool SaveResults() { try { DBReader.WriteStreamsToFiles(WrokPath, Request, Reporter, "CLI"); } catch (Exception e) { Reporter.AddException(e, "CLI"); } return(Reporter.IsOK); }
internal bool Perform() { try { var n = new DBReader(Reporter); n.Execute(Request, __connID); } catch (Exception E) { Reporter.AddException(E, "CLI"); } return(Reporter.IsOK); }
public bool LoadXMLRequest() { if (string.IsNullOrWhiteSpace(XMLFile)) { Reporter.AddMessage(new RoReMessage { Caller = "CLI", Message = "Nieprawidłowa nazwa pliku", EvType = RoReEventType.Error }); return(Reporter.IsOK); } if (!File.Exists(XMLFile)) { Reporter.AddMessage(new RoReMessage { Caller = "CLI", Message = "Plik XML nie istnieje", EvType = RoReEventType.Error }); return(Reporter.IsOK); } try { Reporter.AddMessage(new RoReMessage { Caller = "CLI", EvType = RoReEventType.Info, Message = "Odczyt pliku XML" }); Request = BlaRequest.LoadFromFile(XMLFile); Reporter.AddMessage(new RoReMessage { Caller = "CLI", EvType = RoReEventType.Info, Message = "Odczytano pliku XML" }); } catch (Exception e) { Reporter.AddException(e, "CLI"); } return(Reporter.IsOK); }