public override void Init()
        {
            QvxLog.SetLogLevels(true, true);

            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Notice, "Init()");

            var eventLogFields = new QvxField[]
            {
                new QvxField("Category", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("EntryType", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Message", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("CategoryNumber", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Index", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("MachineName", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Source", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("TimeGenerated", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
            };

            MTables = new List <QvxTable>
            {
                new QvxTable
                {
                    TableName = "ApplicationsEventLog",
                    GetRows   = GetApplicationEvents,
                    Fields    = eventLogFields
                }
            };
        }
        public override void Init()
        {
            QvxLog.SetLogLevels(false, true);

            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Notice, "Init()");

            var bucketsListFields = new QvxField[]
            {
                new QvxField("BucketName", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("CreationDate", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
            };

            var objectFields = new QvxField[]
            {
                new QvxField("BucketName", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("ETag", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Key", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("LastModified", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.INTEGER),
                new QvxField("OwnerName", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("OwnerId", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Size", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.INTEGER),
                new QvxField("StorageClass", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
            };

            var dummyFields = new QvxField[]
            {
                new QvxField("DummyField", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
            };


            MTables = new List <QvxTable>
            {
                new QvxTable
                {
                    TableName = "ListBuckets",
                    Fields    = bucketsListFields
                },
                new QvxTable
                {
                    TableName = "BucketObjects",
                    Fields    = objectFields
                },
                new QvxTable
                {
                    TableName = "DownloadObject",
                    Fields    = dummyFields
                }
                //new QvxTable
                //    {
                //        TableName = "UploadObject",
                //        Fields = dummyFields
                //    },
                //new QvxTable
                //    {
                //        TableName = "DeleteLocalObject",
                //        Fields = dummyFields
                //    }
            };
        }
        public QlikSimpleConnectorServer()
            : base()
        {
            QvxLog.SetLogLevels(true, true);

            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Debug, "+ QlikSimpleConnectorServer()");

            this.getPlugins();

            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Debug, "- QlikSimpleConnectorServer()");
        }
예제 #4
0
        public override string CreateConnectionString()
        {
            QvxLog.SetLogLevels(true, true);
            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Notice, "QvxServer.CreateConnectionString() avg");

            BaseConnector lo_baseConnector = CreateBaseConnector(go_qvConnector?.MParameters);

            lo_baseConnector.ShowDialog();

            if (lo_baseConnector.DialogResult.Equals(true))
            {
                if (lo_baseConnector.GetServerBase())
                {
                    if (string.IsNullOrEmpty(lo_baseConnector.GetUser()))
                    {
                        return(string.Format("Srvr={0};Ref={1};Query={2};QV_Table={3}",
                                             lo_baseConnector.GetBaseLocation(), lo_baseConnector.GetBaseName(),
                                             lo_baseConnector.GetQueryText(), lo_baseConnector.GetQvTable()
                                             ));
                    }
                    else
                    {
                        return(string.Format("Srvr={0};Ref={1};UserDB={2};PasswordDB={3};Query={4};QV_Table={5}",
                                             lo_baseConnector.GetBaseLocation(), lo_baseConnector.GetBaseName(),
                                             lo_baseConnector.GetUser(), lo_baseConnector.GetPassword(),
                                             lo_baseConnector.GetQueryText(), lo_baseConnector.GetQvTable()
                                             ));
                    }
                }
                else
                {
                    if (string.IsNullOrEmpty(lo_baseConnector.GetUser()))
                    {
                        return(string.Format("File={0};Query={1};QV_Table={2}",
                                             lo_baseConnector.GetBaseLocation(), lo_baseConnector.GetQueryText(),
                                             lo_baseConnector.GetQvTable()
                                             ));
                    }
                    else
                    {
                        return(string.Format("File={0};UserDB={1};PasswordDB={2};Query={3};QV_Table={4}",
                                             lo_baseConnector.GetBaseLocation(), lo_baseConnector.GetUser(),
                                             lo_baseConnector.GetPassword(), lo_baseConnector.GetQueryText(),
                                             lo_baseConnector.GetQvTable()
                                             ));
                    }
                }
            }
            return(string.Empty);
        }
예제 #5
0
        public override void Init()
        {
            QvxLog.SetLogLevels(true, true);
            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Notice, "Init()");

            var fields = BuildFields();

            MTables = new List <QvxTable>
            {
                new QvxTable
                {
                    TableName = "TestTable",
                    GetRows   = GetTestRows,
                    Fields    = fields
                }
            };
        }
        public QlikConnectorConnection(QlikConnectorServer qcs)
            : base()
        {
            QvxLog.SetLogLevels(true, true);

            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Debug, "+ QlikConnectorConnection()");

            try {
                this.parent = qcs;
            }
            catch (Exception e)
            {
                QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Error, "QlikConnectorConnection() : " + e.Message);
                throw e;
            }

            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Debug, "- QlikConnectorConnection()");
        }
        public override void Init()
        {
            QvxLog.SetLogLevels(false, true);

            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Notice, "Init()");

            this.MParameters.TryGetValue("jsonPath", out jsonPath);

            try
            {
                jsonCredentials = File.ReadAllText(jsonPath);
            } catch (Exception ex)
            {
                QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Error, ex.Message);
                throw new QvxPleaseSendReplyException(QvxResult.QVX_UNKNOWN_ERROR, String.Format("Unable to read {0}", jsonPath));
            }

            var bucketsListFields = new QvxField[]
            {
                new QvxField("Acl", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Billing", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Cors", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("ETag", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Encryption", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Id", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Kind", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Label", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Lifecycle", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Location", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Logging", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Name", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Owner", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
            };

            var objectFields = new QvxField[]
            {
                new QvxField("Acl", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Bucket", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("CacheControl", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("ComponentCount", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.INTEGER),
                new QvxField("ContentDisposition", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("ContentEncoding", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("ContentLanguage", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Crc32c", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("ETag", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Generation", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Id", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Kind", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("KmsKeyName", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Md5Hash", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("MediaLink", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Metadata", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Metageneration", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.INTEGER),
                new QvxField("Name", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Owner", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("SelfLink", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Size", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.INTEGER),
                new QvxField("StorageClass", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("TimeCreated", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("TimeDeleted", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("TimeStorageClassUpdated", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("Updated", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)

                //new QvxField("CustomerEncryption", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                //new QvxField("TimeCreatedRaw", QvxFieldType.QVX_SIGNED_INTEGER, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                //new QvxField("TimeDeletedRaw", QvxFieldType.QVX_SIGNED_INTEGER, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                //new QvxField("TimeStorageClassUpdated", QvxFieldType.QVX_SIGNED_INTEGER, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                //new QvxField("Updated", QvxFieldType.QVX_SIGNED_INTEGER, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
            };

            var dummyFields = new QvxField[]
            {
                new QvxField("DummyField", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
            };

            MTables = new List <QvxTable>
            {
                new QvxTable
                {
                    TableName = "ListBuckets",
                    Fields    = bucketsListFields
                },
                new QvxTable
                {
                    TableName = "BucketObjects",
                    Fields    = objectFields
                },
                new QvxTable
                {
                    TableName = "DownloadObject",
                    Fields    = dummyFields
                },
                new QvxTable
                {
                    TableName = "UploadObject",
                    Fields    = dummyFields
                },
                new QvxTable
                {
                    TableName = "DeleteLocalObject",
                    Fields    = dummyFields
                }
            };
        }
예제 #8
0
        public override void Init()
        {
            QvxLog.SetLogLevels(true, true);

            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Notice, "QvxConnection.Init() avg");

            if (MParameters == null)
            {
                return;
            }

            MParameters.TryGetValue("QV_Table", out go_qvTableName);
            MParameters.TryGetValue("Query", out go_query);
            MParameters.TryGetValue("name_connect", out string lo_connectionName);

            if (string.IsNullOrEmpty(go_qvTableName))
            {
                return;
            }

            if (string.IsNullOrEmpty(go_query))
            {
                return;
            }

            go_connString = ConnectString();
            List <string> lo_fieldsName = new List <string>();

            QvxField[] v8Fileds = null;


            /*смотрим, если есть сохраненные данные о подключении - грузим*/
            if (string.IsNullOrEmpty(lo_connectionName))
            {
                lo_connectionName = "QlikView";
            }

            ConnectData lo_connectData = null;

            if (ConnectData.IsExistJson(Properties.Settings.Default.QlikConnectJsonFolder + lo_connectionName))
            {
                QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Notice, "Load Json file");
                lo_connectData = ConnectData.LoadFromJson(Properties.Settings.Default.QlikConnectJsonFolder + lo_connectionName);

                /**/
                if (lo_connectData.ConnectionString.Equals(go_connString))
                {
                    go_query = lo_connectData.Query;

                    go_qvTableName = lo_connectData.go_tablesFields.Keys.ElementAt(0);
                    lo_fieldsName  = lo_connectData.go_tablesFields[go_qvTableName];
                }
            }

            /*если сохраненных данных нет - подключаемся и тащим*/
            if (lo_fieldsName.Count == 0)
            {
                QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Debug, "Connect 1c COM");
                Type oType = Type.GetTypeFromProgID("V83.COMConnector");
                using (Object1C lo_v8 = (oType == null) ? null : new Object1C(Activator.CreateInstance(oType))) {
                    if (lo_v8 == null)
                    {
                        QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Error, "Невозможно создать объект типа V83.COMConnector");
                        Debug.WriteLine("Невозможно создать объект типа V83.COMConnector");
                        return;
                    }

                    /*соединяемся с базой данных*/
                    using (Object1C lo_connection = lo_v8.ExecuteFunction("Connect", new object[] { go_connString })) {
                        if (lo_connection == null)
                        {
                            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Error, "Невозможно подключиться к системе: " + go_connString);
                            Debug.WriteLine("Невозможно подключиться к системе: " + go_connString);
                            return;
                        }

                        QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Debug, "Подключение к 1с выполнено успешно: ");
                        try {
                            using (Object1C lo_query = lo_connection.ExecuteFunctionEx("NewObject", new object[] { "ПостроительЗапроса" })) {
                                lo_query.SetProperty("Текст", new object[] { go_query });

                                using (Object1C lo_queryRes = lo_query.GetPropertyEx("Результат")) {
                                    using (Object1C lo_queryResColumn = lo_queryRes.GetPropertyEx("Колонки")) {
                                        /*количество колонок в таблице, которую вернет запрос*/
                                        int lv_countColumn = 0;
                                        using (Object1C lo_cntColumn = lo_queryResColumn.ExecuteFunctionEx("Количество")) {
                                            lv_countColumn = Convert.ToInt32(lo_cntColumn.ToString());
                                        }

                                        /*названия колонок*/
                                        for (int lv_i = 0; lv_i < lv_countColumn; ++lv_i)
                                        {
                                            string lo_columnName = string.Empty;

                                            using (Object1C lo_arrayField = lo_queryResColumn.ExecuteFunction("Получить", new object[] { lv_i })) {
                                                using (Object1C lo_fieldName = lo_arrayField.GetProperty("Имя")) {
                                                    lo_columnName = lo_fieldName.ToString();
                                                }
                                            }

                                            lo_fieldsName.Add(lo_columnName);
                                        }
                                    }
                                }
                            }
                        }
                        catch (Exception lo_ex) {
                            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Error, lo_ex.ToString());
                            Debug.WriteLine(lo_ex.ToString());
                        }
                        finally {
                            if (lo_connection != null)
                            {
                                lo_connection.Dispose();
                            }
                        }
                    }
                }

                try {
                    lo_connectData = new ConnectData {
                        ConnectionString = go_connString,
                        Query            = go_query,
                        go_tablesFields  = new Dictionary <string, List <string> > {
                            [go_qvTableName] = lo_fieldsName
                        }
                    };
                    lo_connectData.SaveToJson(Properties.Settings.Default.QlikConnectJsonFolder + lo_connectionName);
                }
                catch (Exception lo_ex) {
                    QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Error, lo_ex.ToString());
                    Debug.WriteLine(lo_ex.ToString());
                }
            }


            /*добавляем поля в таблицу Qlik View*/
            v8Fileds = new QvxField[lo_fieldsName.Count];
            for (int lv_i = 0; lv_i < lo_fieldsName.Count; ++lv_i)
            {
                v8Fileds.SetValue(
                    new QvxField(
                        lo_fieldsName[lv_i],
                        QvxFieldType.QVX_TEXT,
                        QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA,
                        FieldAttrType.ASCII
                        ), lv_i
                    );
            }

            MTables = new List <QvxTable> {
                new QvxTable {
                    TableName = go_qvTableName,
                    GetRows   = GetData,
                    Fields    = v8Fileds
                }
            };
        }
        // Has been hardcoded, should preferably be done programatically.
        public override void Init()
        {
            // Set to true true to get more logging.
            //QvxLog.SetLogLevels(false, false);
            QvxLog.SetLogLevels(true, true);
            QvxLog.Log(QvxLogFacility.Application, QvxLogSeverity.Notice, "Init()");

            _logger = new SimpleLogger("QvBigDataConn");
            _logger.EnableFileLogging(Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), log4net.Core.Level.Debug);

            _logger.LogMsg(log4net.Core.Level.Info, "Initializing QlikView API connection class.");

            _logger.LogMsg(log4net.Core.Level.Info, String.Format("Command queue path: [{0}].", Program.CommandPipe));


            VerifyCredentials();

            var billToCodesFields = new QvxField[]
            {
                new QvxField("billtocode", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("billtodesc", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("billtoeffdt", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
                new QvxField("billtoexpdt", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
            };

            /*
             * var applicationsEventLogFields = new QvxField[]
             *  {
             *      new QvxField("Category", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("EntryType", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("Message", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("CategoryNumber", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("Index", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("MachineName", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("Source", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("TimeGenerated", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
             *  };
             *
             * var systemEventLogFields = new QvxField[]
             *  {
             *      new QvxField("Category", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("EntryType", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("Message", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("CategoryNumber", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("Index", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("MachineName", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("Source", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII),
             *      new QvxField("TimeGenerated", QvxFieldType.QVX_TEXT, QvxNullRepresentation.QVX_NULL_FLAG_SUPPRESS_DATA, FieldAttrType.ASCII)
             *  };
             */
            MTables = new List <QvxTable> {
                new QvxTable {
                    TableName = "BillToCodes",
                    GetRows   = GetBillToCodes,
                    Fields    = billToCodesFields
                }
            };

            /*
             * MTables = new List<QvxTable> {
             *  new QvxTable {
             *      TableName = "ApplicationsEventLog",
             *      GetRows = GetApplicationEvents,
             *      Fields = applicationsEventLogFields
             *  },
             *  new QvxTable {
             *      TableName = "SystemEventLog",
             *      GetRows = GetSystemEvents,
             *      Fields = systemEventLogFields
             *  }
             * };
             */
        }