public void Initialiaze(PacientInfo patient)
        {
            _pacient     = patient;
            _polices     = new List <PolicyInfo>();
            ErrorMessage = string.Empty;

            _timer          = new Timer();
            _timer.Tick    += _timer_Tick;
            _timer.Interval = 200;
        }
Exemple #2
0
        /// <summary>
        /// Получает информацию по полисам
        /// </summary>
        /// <param name="pacient">Пациент, для которого ищем полиса</param>
        /// <returns></returns>
        public IEnumerable <PolicyInfo> GetPolicyInfos(PacientInfo pacient)
        {
            ErrorMessage = string.Empty;

            var result = FormWebBrowser.Start(pacient);

            if (result == null || result.Count == 0)
            {
                ErrorMessage = FormWebBrowser.GetErrorMessage();
            }
            return(result);
        }
 public static List <PolicyInfo> Start(PacientInfo pacient)
 {
     Completed = false;
     _instance = _instance ?? new FormWebBrowser();
     _instance.Initialiaze(pacient);
     _instance.Navigate();
     do
     {
         Thread.Sleep(100);
     } while (!Completed);
     return(_instance._polices);
 }