コード例 #1
0
ファイル: Synchronizer.cs プロジェクト: you839215622/SmartCA
        private static void ProcessReferenceData(
            ReferenceDataContract referenceData)
        {
            if (referenceData != null)
            {
                IReferenceDataRepository repository =
                    ReferenceDataRepositoryFactory.GetReferenceDataRepository();

                if (referenceData.Disciplines != null)
                {
                    repository.Add(referenceData.Disciplines);
                }
                if (referenceData.ItemStatuses != null)
                {
                    repository.Add(referenceData.ItemStatuses);
                }
                if (referenceData.Sectors != null)
                {
                    repository.Add(referenceData.Sectors);
                }
                if (referenceData.Segments != null)
                {
                    repository.Add(referenceData.Segments);
                }
                if (referenceData.SpecSections != null)
                {
                    repository.Add(referenceData.SpecSections);
                }
            }
        }
コード例 #2
0
ファイル: Synchronizer.cs プロジェクト: pachinko/NDDDCS
        private static void ProcessReferenceData(
            ReferenceDataContract referenceData)
        {
            if (referenceData != null)
            {
                IReferenceDataRepository repository = 
                    ReferenceDataRepositoryFactory.GetReferenceDataRepository();

                if (referenceData.Disciplines != null)
                {
                    repository.Add(referenceData.Disciplines);
                }
                if (referenceData.ItemStatuses != null)
                {
                    repository.Add(referenceData.ItemStatuses);
                }
                if (referenceData.Sectors != null)
                {
                    repository.Add(referenceData.Sectors);
                }
                if (referenceData.Segments != null)
                {
                    repository.Add(referenceData.Segments);
                }
                if (referenceData.SpecSections != null)
                {
                    repository.Add(referenceData.SpecSections);
                }
            }
        }
コード例 #3
0
ファイル: Synchronizer.cs プロジェクト: you839215622/SmartCA
        public static void Synchronize()
        {
            // Send pending transactions to the server
            SynchronizationServerProxy.SendTransactions(
                ClientTransactionService.GetPendingTransactions());

            // Get reference data from the server
            ReferenceDataContract referenceData =
                SynchronizationServerProxy.GetReferenceData(lastSynchronized);

            // Process the reference data
            Synchronizer.ProcessReferenceData(referenceData);

            // Get transactions from the server
            IList <ServerTransaction> serverTransactions =
                SynchronizationServerProxy.GetTransactions(lastSynchronized);

            // Process the server transactions
            Synchronizer.ProcessServerTransactions(serverTransactions);

            // If the synchronization was successful,
            // then record the timestamp
            Synchronizer.SetLastSynchronized();
        }