コード例 #1
0
        public virtual ObchodnyVestnik LastPublishedJournal(bool retry = true)
        {
            ObchodnyVestnik result = null;

            try
            {
                result        = ServiceClient.ZiskatPoslednyVydanyOV(Settings.UserName, Settings.Password);
                _retryCounter = 0;
            }
            catch (Exception)
            {
                ServiceClient.Abort();
                _serviceClient = null;

                if (AllowedRetriesCount < 0)
                {
                    throw;
                }
                else if (AllowedRetriesCount == 0)
                {
                    result = LastPublishedJournal(retry);
                }
                else
                {
                    _retryCounter++;
                    result = LastPublishedJournal(retry);
                }
            }

            return(result);
        }
コード例 #2
0
        public virtual List <ObchodnyVestnikKapitola> CheckJournalChanges(ObchodnyVestnik journal, bool retry = true)
        {
            List <ObchodnyVestnikKapitola> result = null;

            try
            {
                result = ServiceClient.SkontrolovatZmenyOV(Settings.UserName, Settings.Password, journal.Cislo, journal.Rocnik)
                         .ToList();
                _retryCounter = 0;
            }
            catch (Exception)
            {
                ServiceClient.Abort();
                _serviceClient = null;

                if (AllowedRetriesCount < 0)
                {
                    throw;
                }
                else if (AllowedRetriesCount == 0)
                {
                    result = CheckJournalChanges(journal, retry);
                }
                else
                {
                    _retryCounter++;
                    result = CheckJournalChanges(journal, retry);
                }
            }

            return(result);
        }
コード例 #3
0
        public string DownloadJournalBiddings(ObchodnyVestnik journal, bool retry = true)
        {
            var result = "";

            try
            {
                result        = ServiceClient.StiahnutPodaniaOV(Settings.UserName, Settings.Password, journal.Cislo, journal.Rocnik);
                _retryCounter = 0;
            }
            catch (Exception)
            {
                ServiceClient.Abort();
                _serviceClient = null;

                if (AllowedRetriesCount < 0)
                {
                    throw;
                }
                else if (AllowedRetriesCount == 0)
                {
                    result = DownloadJournalBiddings(journal, retry);
                }
                else
                {
                    _retryCounter++;
                    result = DownloadJournalBiddings(journal, retry);
                }
            }

            return(result);
        }
コード例 #4
0
 public static string FormatedName(this ObchodnyVestnik businessJournal)
 {
     return($"OV-{businessJournal.Rocnik}-{businessJournal.Cislo}-{businessJournal.DenVydania.ToString("dd.MM.yyyy")}");
 }