Esempio n. 1
0
        // Initializing Of Fields
        private void InitializingOfFields()
        {
            //
            // Reading Settings
            //

            /*
             * string PathToSettings = @"C:\Pharmaceutical Information\Server\Bin\Settings.xml";
             * //
             * System.Data.DataTable Settings = new System.Data.DataTable("Settings");
             * Settings.ReadXml(PathToSettings);
             * Settings.PrimaryKey = new System.Data.DataColumn[1] { Settings.Columns[0] };
             * //
             * string FTPServer = Settings.Rows.Find("FTP")["Value"].ToString();
             * string DBServer = Settings.Rows.Find("DB")["Value"].ToString();
             */
            //
            // Initialize String Of Connection
            //

            XmlDocument doc = new XmlDocument();

            doc.Load("ServiceConfg.xml");

            StringOfConnection = doc.DocumentElement["StringOfConnection"].InnerText;

            StringOfConnection02 = doc.DocumentElement["StringOfConnection02"].InnerText;

            //
            // Initializing Settings Of Logs
            //
            string PathOfStarting = System.Windows.Forms.Application.StartupPath;

            //
            //ServerOfPharmInf
            this.PathToLogFile = PathOfStarting + "\\LogsOfServer.txt";
            //
            this.CountOfRowsInLogFile = 50000; //80000; //65000;900;//
            this.EnableScrapingLog    = true;
            this.ShowingMessages      = false;
            //
            //PathOfArchivesOfPriceList = Path.GetDirectoryName(PathOfStarting) + "\\ArchivesOfPriceList\\";
            //PathOfArchivesOfLogFiles = Path.GetDirectoryName(PathOfStarting) + "\\ArchivesOfLogFiles\\";
            PathOfArchivesOfImporting = Path.GetDirectoryName(PathOfStarting) + "\\ArchivesOfImporting\\";
            //                                                                   ArchivesOfUpdating
            PathOfTMPFolder        = Path.GetDirectoryName(PathOfStarting) + "\\TMP\\";
            PathOfArchivingProgram = PathOfStarting + "\\Rar.exe";
            //
            // Access To Store Of Data
            //
            string AccessToStoreOfData = doc.DocumentElement["AccessToStoreOfData"].InnerText;;

            //
            // Initializing Paths Of FTP
            //

            PathOfImportingData         = doc.DocumentElement["PathOfImportingData"].InnerText;
            PathOfImportingOfIodineFace = doc.DocumentElement["PathOfImportingOfIodineFace"].InnerText;
            //
            // Initializing Path Of Exporting
            //
            PathOfExportingDataOfFTP       = doc.DocumentElement["PathOfExportingDataOfFTP"].InnerText;
            PathToExportingPriceListsOnFTP = doc.DocumentElement["PathToExportingPriceListsOnFTP"].InnerText;
            PathOfExportingScriptsOfFTP    = doc.DocumentElement["PathOfExportingScriptsOfFTP"].InnerText;
            PathOfExportingUpdatingOneSite = doc.DocumentElement["PathOfExportingUpdatingOneSite"].InnerText;

            //
            // Initialize ExchangeFTPAndSystemDataBase
            //
            ExchangeFTPAndDataBase = new
                                     PharmaceuticalInformation.Server.ExchangeBetweenSystemAndQueues(StringOfConnection, this.PathToLogFile);
            //

            /*
             * SynchronizationOfData = new
             *  PharmaceuticalInformation.Server.SynchronizationOfDataOfDataBases(StringOfConnection02, StringOfConnection, this.PathToLogFile);
             */
            //
            // Settings Of ExchangeFTPAndSystemDataBase
            //
            ExchangeFTPAndDataBase.AccessToStoreOfData = AccessToStoreOfData;
            //ExchangeFTPAndDataBase.PathOfImportingData = PathOfImportingData;
            //ExchangeFTPAndDataBase.PathToImportingManData = PathOfImportingManData;
            ExchangeFTPAndDataBase.PathOfImportingDataFromQueue = PathOfImportingData;
            ExchangeFTPAndDataBase.PathOfImportingOfIodineFace  = PathOfImportingOfIodineFace;
            //
            ExchangeFTPAndDataBase.PathToExportingDataOfFTP        = PathOfExportingDataOfFTP;
            ExchangeFTPAndDataBase.PathToExportingPriceListsOnFTP  = PathToExportingPriceListsOnFTP;
            ExchangeFTPAndDataBase.PathOfExportingUpdatingAllSites = PathOfExportingScriptsOfFTP;
            ExchangeFTPAndDataBase.PathOfExportingUpdatingOneSite  = PathOfExportingUpdatingOneSite;
            //
            ExchangeFTPAndDataBase.PathOfArchivingProgram = PathOfArchivingProgram;
            ExchangeFTPAndDataBase.PathOfTMPFolder        = PathOfTMPFolder;
            //
            //ExchangeFTPAndDataBase.PathOfArchivesOfLogFiles = PathOfArchivesOfLogFiles;
            //ExchangeFTPAndDataBase.PathOfArchivesOfPriceList = PathOfArchivesOfPriceList;
            ExchangeFTPAndDataBase.PathOfArchivesOfImporting = PathOfArchivesOfImporting;
            //
            // Initializing Working
            //
            InWork = false;
            HourOfLastExportingOfScripts = DateTime.Now.Hour;
            HourOfLastExportingOfData    = DateTime.Now.Hour;
            HourOfNextPrivateImporting   = 0;
            //CountOfRepeatedEnteringInProcedure = 0;
            CountOfIterationWithLastScraping = 0;
        }
Esempio n. 2
0
        // Initializing Of Fields
        private void InitializingOfFields()
        {
            //
            // Reading Settings
            //
            //
            // Initialize String Of Connection
            //


            XmlDocument doc = new XmlDocument();

            doc.Load(Path.GetDirectoryName(System.AppDomain.CurrentDomain.BaseDirectory) + "\\ServiceConfg.xml");

            StringOfConnection = doc.DocumentElement["StringOfConnection"].InnerText;

            StringOfConnection02 = doc.DocumentElement["StringOfConnection02"].InnerText;

            NinjectDependencyResolver.AddBindings(StringOfConnection);

            //
            // Initializing Settings Of Logs
            //
            string PathOfStarting = System.Windows.Forms.Application.StartupPath;

            //
            //ServerOfPharmInf
            this.PathToLogFile = PathOfStarting + "\\LogsOfServer.txt";
            //
            this.CountOfRowsInLogFile = 50000; //80000; //65000;900;//
            this.EnableScrapingLog    = true;
            this.ShowingMessages      = false;
            //
            PathOfArchivesOfImporting = Path.GetDirectoryName(PathOfStarting) + "\\ArchivesOfImporting\\";

            PathOfTMPFolder        = Path.GetDirectoryName(PathOfStarting) + "\\TMP\\";
            PathOfArchivingProgram = PathOfStarting + "\\Rar.exe";
            //
            // Access To Store Of Data
            //
            string AccessToStoreOfData = doc.DocumentElement["AccessToStoreOfData"].InnerText;

            //
            // Initializing Paths Of FTP
            //

            PathOfImportingData         = doc.DocumentElement["PathOfImportingData"].InnerText;
            PathOfImportingOfIodineFace = doc.DocumentElement["PathOfImportingOfIodineFace"].InnerText;
            //
            // Initializing Path Of Exporting
            //
            PathOfExportingDataOfFTP       = doc.DocumentElement["PathOfExportingDataOfFTP"].InnerText;
            PathToExportingPriceListsOnFTP = doc.DocumentElement["PathToExportingPriceListsOnFTP"].InnerText;
            PathOfExportingScriptsOfFTP    = doc.DocumentElement["PathOfExportingScriptsOfFTP"].InnerText;
            PathOfExportingUpdatingOneSite = doc.DocumentElement["PathOfExportingUpdatingOneSite"].InnerText;

            //
            // Initialize ExchangeFTPAndSystemDataBase
            //
            ExchangeFTPAndDataBase = new
                                     PharmaceuticalInformation.Server.ExchangeBetweenSystemAndQueues(NinjectDependencyResolver.kernel.Get <IPharmacyInformation>(), this.PathToLogFile);
            //

            /*
             * SynchronizationOfData = new
             *  PharmaceuticalInformation.Server.SynchronizationOfDataOfDataBases(StringOfConnection02, StringOfConnection, this.PathToLogFile);
             */
            //
            // Settings Of ExchangeFTPAndSystemDataBase
            //
            ExchangeFTPAndDataBase.AccessToStoreOfData = AccessToStoreOfData;

            ExchangeFTPAndDataBase.PathOfImportingDataFromQueue = PathOfImportingData;
            ExchangeFTPAndDataBase.PathOfImportingOfIodineFace  = PathOfImportingOfIodineFace;
            //
            ExchangeFTPAndDataBase.PathToExportingDataOfFTP        = PathOfExportingDataOfFTP;
            ExchangeFTPAndDataBase.PathToExportingPriceListsOnFTP  = PathToExportingPriceListsOnFTP;
            ExchangeFTPAndDataBase.PathOfExportingUpdatingAllSites = PathOfExportingScriptsOfFTP;
            ExchangeFTPAndDataBase.PathOfExportingUpdatingOneSite  = PathOfExportingUpdatingOneSite;
            //
            ExchangeFTPAndDataBase.PathOfArchivingProgram = PathOfArchivingProgram;
            ExchangeFTPAndDataBase.PathOfTMPFolder        = PathOfTMPFolder;
            //
            ExchangeFTPAndDataBase.PathOfArchivesOfImporting = PathOfArchivesOfImporting;
            //
            // Initializing Working
            //
            InWork = false;
            HourOfLastExportingOfScripts = DateTime.Now.Hour;
            HourOfLastExportingOfData    = DateTime.Now.Hour;
            HourOfNextPrivateImporting   = 0;

            CountOfIterationWithLastScraping = 0;
        }