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);
        }
        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);
        }
        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")}");
 }