Esempio n. 1
0
 public static void LogHeader()
 {
     IBLogger.Write(LOG_OPTION.INFO, "");
     IBLogger.Write(LOG_OPTION.INFO, "");
     IBLogger.Write(LOG_OPTION.INFO, "------------------------------------------------------------------------");
     IBLogger.Write(LOG_OPTION.INFO, "----------------- (: Interblocks - Statement API :) ------------------");
     IBLogger.Write(LOG_OPTION.INFO, "------------------------------------------------------------------------");
     IBLogger.Write(LOG_OPTION.INFO, "Starting Application on Date : " + DateTime.Now.ToString("dd/MMM/yyyy HH:mm:ss"));
     IBLogger.Write(LOG_OPTION.INFO, "Card Schema Name       : " + SystemConfiguration.CARD_SCHEMA_NAME);
     IBLogger.Write(LOG_OPTION.INFO, "PCI Enable             : " + SystemConfiguration.PCI_ENABLE);
     IBLogger.Write(LOG_OPTION.INFO, "DB Host ServiceName    : " + SystemConfiguration.DB_HOST_SERVICE_NAME);
     IBLogger.Write(LOG_OPTION.INFO, "DB DSN                 : " + SystemConfiguration.DB_DSN);
     IBLogger.Write(LOG_OPTION.INFO, "DB DBMS                : " + SystemConfiguration.DB_DBMS);
     IBLogger.Write(LOG_OPTION.INFO, "DB File Name           : " + SystemConfiguration.DB_FILE_NAME);
     IBLogger.Write(LOG_OPTION.INFO, "DB File Path           : " + SystemConfiguration.DB_FILE_PATH);
     IBLogger.Write(LOG_OPTION.INFO, "DB Catalog Name        : " + SystemConfiguration.DB_CATALOG_NAME);
     IBLogger.Write(LOG_OPTION.INFO, "DB DataBase Name       : " + SystemConfiguration.DB_DATABASE_NAME);
     IBLogger.Write(LOG_OPTION.INFO, "DB Schema Name         : " + SystemConfiguration.DB_SCHEMA_NAME);
     IBLogger.Write(LOG_OPTION.INFO, "DB User Name           : " + SystemConfiguration.DB_USER_NAME);
     IBLogger.Write(LOG_OPTION.INFO, "DB Host IP             : " + SystemConfiguration.DB_HOST_IP);
     IBLogger.Write(LOG_OPTION.INFO, "DB Host Port           : " + SystemConfiguration.DB_HOST_PORT);
     IBLogger.Write(LOG_OPTION.INFO, "Listen IP              : " + SystemConfiguration.LISTEN_IP);
     IBLogger.Write(LOG_OPTION.INFO, "Listen Port            : " + SystemConfiguration.LISTEN_PORT);
     IBLogger.Write(LOG_OPTION.INFO, "Customer Print Staus   : " + SystemConfiguration.CUSTOMER_PRINT);
     IBLogger.Write(LOG_OPTION.INFO, "Customer RePrint Staus : " + SystemConfiguration.CUSTOMER_REPRINT);
     IBLogger.Write(LOG_OPTION.INFO, "Merchant Print Staus   : " + SystemConfiguration.MERCHANT_PRINT);
     IBLogger.Write(LOG_OPTION.INFO, "Merchant RePrint Staus : " + SystemConfiguration.MERCHANT_REPRINT);
     IBLogger.Write(LOG_OPTION.INFO, "SVC Card Print Staus   : " + SystemConfiguration.SVC_PRINT);
     IBLogger.Write(LOG_OPTION.INFO, "SVC Card RePrint Staus : " + SystemConfiguration.SVC_REPRINT);
     IBLogger.Write(LOG_OPTION.INFO, "Version (Product)      : " + SystemConfiguration.PRODUCT);
     IBLogger.Write(LOG_OPTION.INFO, "Version (OTHER)        : " + SystemConfiguration.OTHER);
     IBLogger.Write(LOG_OPTION.INFO, "");
 }
Esempio n. 2
0
        /// <summary>
        ///     Generate the scripts.
        /// </summary>
        internal static bool Do()
        {
            _log = Program.GetInstance<IBLogger>();
            _params = Program.GetInstance<IParameters>();

            var frmConn = (NpgsqlConnection) _params[Constants.PgConnection];
            PostgresSchemaTables.CreateTables();

            var tblDict = ((Dictionary<string, DataTable>) _params[Constants.PgTables]);
            var schemaTable = tblDict[Constants.PgSchemaTable];

            if (schemaTable.Rows.Count == 0)
            {
                _log.Write('E', Constants.LogTsType, "There are no records to be processed.");
                return false;
            }

            GenerateSchemaScript(schemaTable);

            var typeTable = tblDict[Constants.PgTypeTable];
            var seqTable = tblDict[Constants.PgSeqTable];
            var fkTable = tblDict[Constants.PgFkTable];

            GenerateTableScripts(schemaTable, seqTable, frmConn);
            GenerateBuildIndexes(frmConn);
            GenerateFkConstraints(fkTable);

            if (typeTable.Rows.Count > 0 || seqTable.Rows.Count > 0)
                GenerateTypeScripts(typeTable, seqTable);

            return true;
        }
        /// <summary>
        /// 
        /// </summary>
        internal static void CreateTables()
        {
            _log = Program.GetInstance<IBLogger>();
            _params = Program.GetInstance<IParameters>();
            _pgConn = (NpgsqlConnection) _params[Constants.PgConnection];
            var inclPublic = bool.Parse(_params[Parameters.PostgresIncludePublic].ToString());
            var inList = "'pg_catalog', 'information_schema'";
            if (!inclPublic) inList += ", 'public'";

            CreateSchemaTable(inList);
            CreateTypeTable();
            CreateSequenceTable(inList);
            CreateFkTable();
            CreateCheckTable(inList);
        }
Esempio n. 4
0
        internal static void Do()
        {
            _log = Program.GetInstance<IBLogger>();
            _params = Program.GetInstance<IParameters>();

            var frmConn = (NpgsqlConnection) _params[Constants.PgConnection];
            var tblDict = ((Dictionary<string, DataTable>) _params[Constants.PgTables]);

            var dt = tblDict[Constants.PgSchemaTable];
            var view = new DataView(dt);
            var tables = view.ToTable(true, "schema_name", "table_name");

            CreateBulkFile(tables);
            if (!bool.Parse(_params[Parameters.PostgresProcessBulk].ToString())) return;

            CreateImportFiles(tables, frmConn);
        }
Esempio n. 5
0
        public static void LoggerInitialize()
        {
            //System Configuration
            IBKeyStore oStore = new IBKeyStore();

            SysKey = oStore.GetMasterKey(MainConfigurationPaths.SystemKeyPath);
            SystemConfiguration.Initialize(SysKey, MainConfigurationPaths.ConfigPath);

            //Log Configuration
            IBKeyStore oLogStore = new IBKeyStore();

            LogKey = oLogStore.GetMasterKey(MainConfigurationPaths.LogKeyPath);
            IBLogInstanceProperties oLogInstanceProp = new IBLogInstanceProperties(LogKey, MainConfigurationPaths.LogSysConfigPath);
            IBLogInstance           log = new IBLogInstance("001", oLogInstanceProp);

            IBLogger.AddInstance(log);
            IBLogger.Initialize(oLogInstanceProp);
        }
Esempio n. 6
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        internal static bool CheckParams(IParameters prms, IBLogger log)
        {
            var path = prms[Parameters.OtherWorkPath].ToString();

            try
            {
                if (!Directory.Exists(path)) Directory.CreateDirectory(path);

                path = prms[Parameters.OtherDumpPath].ToString();
                if (!Directory.Exists(path)) Directory.CreateDirectory(path);
            }
            catch (Exception ex)
            {
                log.WriteEx('E', Constants.LogTsType, ex);
                return false;
            }

            return true;
        }
Esempio n. 7
0
 /// <summary>
 ///     Something went very wrong: abort.
 /// </summary>
 internal static void Abort(string msg, IBLogger log = null)
 {
     log?.Write('F', 'T', "Program has aborted due to unrecoverable errors.");
     Environment.Exit(1);
 }
Esempio n. 8
0
        public static void LogSubHeader(string message)
        {
            var paddingone = message.PadLeft(30, '-').PadRight(70, '-');

            IBLogger.Write(LOG_OPTION.INFO, paddingone);
        }
Esempio n. 9
0
 public static void LogDebug(string _Field, string message)
 {
     IBLogger.Write(LOG_OPTION.DEBUG, _Field.PadRight(50, '-') + message);
 }
Esempio n. 10
0
 public static void LogError(string _Field, string message)
 {
     IBLogger.Write(LOG_OPTION.ERROR, _Field.PadRight(50, '-') + message);
 }
Esempio n. 11
0
 public static void LogInfo(string _Field, string message)
 {
     IBLogger.Write(LOG_OPTION.INFO, _Field.PadRight(50, '-') + message);
 }
Esempio n. 12
0
 public static void LogSeparater()
 {
     IBLogger.Write(LOG_OPTION.INFO, "------------------------------------------------------------------------");
 }
Esempio n. 13
0
 public static void LogEmpty()
 {
     IBLogger.Write(LOG_OPTION.INFO, "");
 }