using CallCenter.Utility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace CallCenter.QuartzService
{
   public    class Peoplewebsite : QuartzJob
    {

        public Peoplewebsite()
        {
            CronExpression = "0 0/30 * * * ?";
            DoWork += GetLY;
        }
      
        public void GetLY(object sender, EventArgs e)
        {
    
               //  WebClient web = new WebClient();
               //  web.Encoding = Encoding.UTF8;
                 // string Dataurl = web.DownloadString("http://localhost/APPS/GetLY" + "?display=1&searchState=wait_to_answer");
                var Dataurl = HttpMethods.HttpPost("http://localhost/APPS/GetLY" ,"display=1&searchState=wait_to_answer");
                LogFactory.GetLogger("33333").Warn(Dataurl);
                if (!string.IsNullOrEmpty(Dataurl))
                {
                    var Dataur2 = HttpMethods.HttpPost("http://localhost/APPS/GetLY" ,"display=2&searchState=wait_to_first_explain");
                  // string Dataur2 = web.DownloadString("http://localhost/APPS/GetLY" + "?display=2&searchState=wait_to_first_explain");

                    LogFactory.GetLogger("444444").Warn(Dataur2);
                    if (!string.IsNullOrEmpty(Dataur2))
                    {
                         var Dataur3 = HttpMethods.HttpPost("http://localhost/APPS/GetLY" , "display=2&searchState=wait_to_second_explain");

                       // string Dataur3 = web.DownloadString("http://localhost/APPS/GetLY" + "?display=2&searchState=wait_to_second_explain");
                        LogFactory.GetLogger("55555").Warn(Dataur3);
                    }
                }
            
           
        }
       
    }
}
