Пример #1
0
        public void getCurTimezoneOffsetRDGExcelValues(AdminTransTG source)
        {
            m_listCurTimezoneOffsetRDGExcelValues = new List <RDGStruct[]> ();

            for (int i = 0; i < source.m_listCurTimezoneOffsetRDGExcelValues.Count; i++)
            {
                m_listCurTimezoneOffsetRDGExcelValues.Add(new AdminTS.RDGStruct[source.m_listCurTimezoneOffsetRDGExcelValues [i].Length]);
                source.m_listCurTimezoneOffsetRDGExcelValues [i].CopyTo(m_listCurTimezoneOffsetRDGExcelValues [i], 0);
            }
        }
Пример #2
0
        protected override void Start()
        {
            int i = -1;

            EditFormConnectionSettings("connsett_tg.ini", true);

            int    iConfigDB       = -1;
            string keyTypeConfigDB = @"ТипБДКфгНазначение";

            //FileINI fileINI = new FileINI(@"setup.ini");
            //string sec = "Main (" + ProgramBase.AppName + ")";
            iConfigDB = Int32.Parse(m_sFileINI.GetMainValueOfKey(keyTypeConfigDB));

            //TYPE_DATABASE_CFG iTypeConfigDB = TYPE_DATABASE_CFG.UNKNOWN;

            //for (TYPE_DATABASE_CFG t = TYPE_DATABASE_CFG.CFG_190; t < TYPE_DATABASE_CFG.UNKNOWN; t++)
            //{
            //    if (t.ToString().Contains(iConfigDB.ToString()) == true)
            //    {
            //        iTypeConfigDB = t;
            //        break;
            //    }
            //    else
            //        ;
            //}

            bool bIgnoreTECInUse = false;

            HMark markQueries = new HMark(new int[] { (int)StatisticCommon.CONN_SETT_TYPE.ADMIN, (int)StatisticCommon.CONN_SETT_TYPE.PBR });
            //markQueries.Marked((int)StatisticCommon.CONN_SETT_TYPE.ADMIN);
            //markQueries.Marked((int)StatisticCommon.CONN_SETT_TYPE.PBR);

            int idListener = DbSources.Sources().Register(s_listFormConnectionSettings[(int)StatisticCommon.CONN_SETT_TYPE.CONFIG_DB].getConnSett(), false, @"CONFIG_DB");

            for (i = 0; i < (Int16)CONN_SETT_TYPE.COUNT_CONN_SETT_TYPE; i++)
            {
                if (i == (Int16)CONN_SETT_TYPE.SOURCE)
                {
                    m_arAdmin[i] = new AdminTransTG(new bool [] { false, false });
                }
                else
                if (i == (Int16)CONN_SETT_TYPE.DEST)
                {
                    m_arAdmin[i] = new AdminTransTG(new bool[] { false, true });
                }
                else
                {
                    ;
                }

                try {
                    ((AdminTS)m_arAdmin[i]).InitTEC(idListener, FormChangeMode.MODE_TECCOMPONENT.ANY, /*iTypeConfigDB, */ markQueries, bIgnoreTECInUse, new int[] { 0, (int)TECComponent.ID.LK });
                    RemoveTEC(m_arAdmin[i]);
                }
                catch (Exception e)
                {
                    Logging.Logg().Exception(e, "FormMainTransTG::FormMainTransTG ()", Logging.INDEX_MESSAGE.NOT_SET);
                    //ErrorReport("Ошибка соединения. Перехож в ожидание.");
                    //setUIControlConnectionSettings(i);
                    break;
                }
                //((AdminTS)m_arAdmin[i]).connSettConfigDB = m_formConnectionSettings.getConnSett();
                //((AdminTS)m_arAdmin[i]).m_typeFields = AdminTS.TYPE_FIELDS.DYNAMIC;
                if (i == (Int16)CONN_SETT_TYPE.SOURCE)
                {
                    m_arAdmin[i].m_ignore_date = false;
                }
                else
                if (i == (Int16)CONN_SETT_TYPE.DEST)
                {
                    m_arAdmin[i].m_ignore_date = true;
                }
                else
                {
                    ;
                }

                //m_arAdmin[i].m_ignore_connsett_data = true; //-> в конструктор
            }

            DbSources.Sources().UnRegister(idListener);

            if (!(i < (Int16)CONN_SETT_TYPE.COUNT_CONN_SETT_TYPE))
            {
                setUIControlConnectionSettings((Int16)CONN_SETT_TYPE.DEST);

                for (i = 0; i < (Int16)CONN_SETT_TYPE.COUNT_CONN_SETT_TYPE; i++)
                {
                    m_arAdmin[i].SetDelegateWait(delegateStartWait, delegateStopWait, delegateEvent);
                    //m_arAdmin[i].SetDelegateWait(new DelegateFunc(StartWait), new DelegateFunc(StopWait), delegateEvent);
                    m_arAdmin[i].SetDelegateReport(ErrorReport, WarningReport, ActionReport, ReportClear);

                    m_arAdmin[i].SetDelegateData(setDataGridViewAdmin, errorDataGridViewAdmin);
                    m_arAdmin[i].SetDelegateSaveComplete(saveDataGridViewAdminComplete);

                    m_arAdmin[i].SetDelegateDatetime(setDatetimePicker);

                    //m_arAdmin [i].mode (FormChangeMode.MODE_TECCOMPONENT.GTP);

                    m_arAdmin[i].Start();
                }

                /*
                 * // This needs to be declared in a place where it will not go out of scope.
                 * // For example, it would be a class variable in a form class.
                 * System.IO.FileSystemWatcher watcher = new System.IO.FileSystemWatcher();
                 * // This code would go in one of the initialization methods of the class.
                 * watcher.Path = "c:\\";
                 * // Watch only for changes to *.txt files.
                 * watcher.Filter = "*.txt";
                 * watcher.IncludeSubdirectories = false;
                 * // Enable the component to begin watching for changes.
                 * watcher.EnableRaisingEvents = true;
                 * // Filter for Last Write changes.
                 * watcher.NotifyFilter = System.IO.NotifyFilters.LastWrite;
                 * // Example of watching more than one type of change.
                 * watcher.NotifyFilter = System.IO.NotifyFilters.LastWrite | System.IO.NotifyFilters.Size;
                 *
                 * //Асинхронно
                 * watcher.Changed += new System.IO.FileSystemEventHandler(this.watcher_Changed);
                 *
                 * //Сихронно
                 * watcher.WaitForChanged(System.IO.WatcherChangeTypes.All);
                 */

                //panelMain.Visible = false;

                start();
            }
            else
            {
                ;
            }
        }