Пример #1
0
        /// <summary>
        ///     Synchronize a dataset
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void bw_DoSynchronization(object sender, DoWorkEventArgs e)
        {
            _synchController.InitTransactionsSummary();
            var datasetId = (int)e.Argument;

            _synchController.DoSynchronization(datasetId);
        }
Пример #2
0
        private static void Synchronize(int datasetId)
        {
            var synchController = new SynchController();

            try
            {
                Console.Out.WriteLine("INFO: Starting synchronization of datasetId " + datasetId);
                synchController.InitTransactionsSummary();
                synchController.DoSynchronization(datasetId);
                WriteTransactionSummary(synchController);
                Console.Out.WriteLine("INFO: Finished synchronization of datasetId " + datasetId);
            }
            catch (Exception e)
            {
                Console.WriteLine("ERROR: " + e.Message);
                //throw;
            }
        }
        public static string SynchronizeSingle(int datasetId)
        {
            var synchController = new SynchController();

            try
            {
                Console.Out.WriteLine(" Start SynchronizeSingle datasetId: " + datasetId);
                synchController.InitTransactionsSummary();
                synchController.DoSynchronization(datasetId);
                WriteTransactionSummary(synchController);
                var sTransactionSummary = GetTransactionSummary(synchController);
                Console.Out.WriteLine(" Finished SynchronizeSingle of datasetId " + datasetId);
                return(sTransactionSummary);
            }
            catch (Exception e)
            {
                var sErr = "Exception SynchronizeSingle datasetId: " + datasetId + ", Error desc: " + e.Message;
                Console.Out.WriteLine(sErr);
                return(sErr);
                //throw;
            }
        }