Пример #1
0
        //Работа с уже занесенной записью
        /// <summary>
        /// Конструктор для работы с уже занессеной записью(использовать например для удаления DataBlock
        /// </summary>
        /// <param name="connectionStringTMP">строка подключения</param>
        /// <param name="dataBlockId">dataBlockId</param>
        /// <param name="Current_Language">Язык</param>
        public DataBlock(string connectionStringTMP, int dataBlockId, string Current_Language)
        {
            //тестовое подключение
            sqlDb = new SQLDB(connectionStringTMP);
            ///////

            SQLDB sqlDB = new SQLDB(connectionStringTMP);
            int dataIdTemp = sqlDB.checkTableExistence("fn_data_block", "DATA_BLOCK_ID", dataBlockId);
            if (dataIdTemp == 0)
                throw (new Exception("There is no Data Block with id " + dataBlockId.ToString()));

            connectionString = connectionStringTMP;
            DATA_BLOCK_ID = dataBlockId;
            DATA_BLOCK_ID_PREVIOUS = -1;
            CurrentLanguage = Current_Language;
            dataRecord = new DataRecords(connectionStringTMP, dataBlockId, Current_Language, sqlDb);
            vehicleUnitInfo = new VehicleUnitInfo(connectionString, Current_Language, sqlDb);
            cardUnitInfo = new CardUnitInfo(connectionString, Current_Language, sqlDb);
            plfUnitInfo = new PLFUnitInfo(connectionString, Current_Language, sqlDb);
            cardsTable = new CardsTable(connectionString, Current_Language, sqlDb);
            organizationTable = new OrganizationTable(connectionString, Current_Language, sqlDb);
            usersTable = new UsersTables(connectionString, CurrentLanguage, sqlDb);
            stringTable = new StringTable(connectionString, CurrentLanguage);
            vehiclesTables = new VehiclesTable(connectionString, CurrentLanguage, sqlDb);
            criteriaTable = new CriteriaTable(connectionString, CurrentLanguage, sqlDb);
            deviceTable = new DeviceTable(connectionString, CurrentLanguage, sqlDb);
            //historyTable = new HistoryTable(connectionString, CurrentLanguage, sqlDb);
            reportsTable = new ReportsTable(connectionString, CurrentLanguage, sqlDb);
            invoiceTable = new InvoiceTable(connectionString, CurrentLanguage, sqlDb);
            emailScheduleTable = new EmailScheduleTable(connectionString, CurrentLanguage, sqlDb);
            remindTable = new RemindTable(connectionString, CurrentLanguage, sqlDb);
            bannersTable = new BannersTable(connectionString, CurrentLanguage, sqlDb);
            currentCardType = -1;
            organizationID = 0;
        }
Пример #2
0
        /// <summary>
        /// Конструктор(рекомендовано пользоваться этим)
        /// </summary>
        /// <param name="connectionStringTMP">Строка подключения</param>
        /// <param name="Current_Language">Язык</param>
        public DataBlock(string connectionStringTMP, string Current_Language)
        {
            //тестовое подключение
            sqlDb = new SQLDB(connectionStringTMP);
            ///////

            connectionString = connectionStringTMP;
            DATA_BLOCK_ID = -1;
            DATA_BLOCK_ID_PREVIOUS = -1;
            CurrentLanguage = Current_Language;
            vehicleUnitInfo = new VehicleUnitInfo(connectionString, Current_Language, sqlDb);
            cardUnitInfo = new CardUnitInfo(connectionString, Current_Language, sqlDb);
            plfUnitInfo = new PLFUnitInfo(connectionString, Current_Language, sqlDb);
            cardsTable = new CardsTable(connectionString, Current_Language, sqlDb);
            organizationTable = new OrganizationTable(connectionString, Current_Language, sqlDb);
            usersTable = new UsersTables(connectionString, CurrentLanguage, sqlDb);
            stringTable = new StringTable(connectionString, CurrentLanguage);
            vehiclesTables = new VehiclesTable(connectionString, CurrentLanguage, sqlDb);
            criteriaTable = new CriteriaTable(connectionString, CurrentLanguage, sqlDb);
            deviceTable = new DeviceTable(connectionString, CurrentLanguage, sqlDb);
            //historyTable = new HistoryTable(connectionString, CurrentLanguage, sqlDb);
            reportsTable = new ReportsTable(connectionString, CurrentLanguage, sqlDb);
            invoiceTable = new InvoiceTable(connectionString, CurrentLanguage, sqlDb);
            emailScheduleTable = new EmailScheduleTable(connectionString, CurrentLanguage, sqlDb);
            remindTable = new RemindTable(connectionString, CurrentLanguage, sqlDb);
            bannersTable = new BannersTable(connectionString, CurrentLanguage, sqlDb);
            currentCardType = -1;
            organizationID = 0;
        }