Esempio n. 1
0
        public bool HaveNewRecords(IResponse checkResponse)
        {
            haveNewRecords = false;
            if (!haveNewRecords)
            {
                NewRecords = DoOneCheck((CenterrResponse)checkResponse, true);
                if (NewRecords != null)
                {
                    if (NewRecords.Count() > 0)
                    {
                        haveNewRecords = true;
                    }
                }
            }
            return(haveNewRecords);

            /*
             * NewRecords = DoOneCheck((CenterrResponse)checkResponse);
             *
             * if (NewRecords != null)
             *  if (NewRecords.Count() > 0)
             *      return true;
             *
             * return false;
             */
        }
Esempio n. 2
0
        public string NewRecordsOutput(IResponse checkResponse = null, bool html = true)
        {
            if (!haveNewRecords)
            {
                if (!HaveNewRecords(checkResponse))
                {
                    if (MyRequest.LastError() != null)
                    {
                        return("ERROR: " + MyRequest.LastError().Message);
                    }
                    else
                    {
                        return("");
                    }
                }
            }

            string itemsTable = CreateTableForMailing(html);

            return(PrepareMailBody(itemsTable, NewRecords.Count(), html));

            /*
             * if (HaveNewRecords(checkResponse))
             * {
             *  string itemsTable = CreateTableForMailing(html);
             *  return PrepareMailBody(itemsTable, NewRecords.Count(), html);
             * }
             * return MyRequest.LastError.Message;
             */
        }
Esempio n. 3
0
 /// <summary>
 /// Проверка на наличие новых результатов
 /// </summary>
 /// <param name="checkResponse">Старый запрос для сравнения</param>
 /// <returns>Истина - есть новые результаты, Ложь - если новых результатов нет</returns>
 public bool HaveNewRecords(IResponse checkResponse)
 {
     haveNewRecords = false;
     if (!haveNewRecords)
     {
         NewRecords = DoOneCheck((IResponse)checkResponse, true);
         if (NewRecords != null)
         {
             if (NewRecords.Count() > 0)
             {
                 haveNewRecords = true;
             }
         }
     }
     return(haveNewRecords);
 }