예제 #1
0
        public IntelleChartSpider(string practice, string username, string password)
        {
            this.practice = practice;
            this.username = username;
            this.password = password;
            crawler = new BaseCrawler();
            patientManager = new PatientManager(crawler, baseURL, base2URL);
            string content = "";
            Task<string> returnedContent;
            returnedContent = crawler.doGet(baseURL);
            content = returnedContent.Result;
            Dictionary<string, string> theParams = new Dictionary<string, string>();
            theParams.Add("ui_TxtBxPractice", practice);
            theParams.Add("ui_TxtBxUsername", username);
            theParams.Add("ui_TxtBxPassword", password);
            theParams.Add("uiBtnLogin", "Login");
            theParams.Add("__VIEWSTATE", Util.getValueInput("__VIEWSTATE", content));
            theParams.Add("__VIEWSTATEGENERATOR", Util.getValueInput("__VIEWSTATEGENERATOR", content));

            // returnedContent = crawler.doPost(baseURL, theParams);
            // content = returnedContent.Result;


            returnedContent = crawler.doPost(baseURL, theParams);
            content = returnedContent.Result;

            theParams = new Dictionary<string, string>();
            theParams.Add("__VIEWSTATE", Util.getValueInput("__VIEWSTATE", content));
            theParams.Add("__VIEWSTATEGENERATOR", Util.getValueInput("__VIEWSTATEGENERATOR", content));
            theParams.Add("__EVENTVALIDATION", Util.getValueInput("__EVENTVALIDATION", content));
            theParams.Add("uiBtnLogin", "Submit");
            theParams.Add("ui_DDLocation", "1");
            theParams.Add("ui_DDDept", "1");
            theParams.Add("hfLocalDateTime", DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt"));

            string work = Util.getValue("action", content);
            returnedContent = crawler.doPost(base2URL + work, theParams);
            content = returnedContent.Result;

            theParams = new Dictionary<string, string>();
            theParams.Add("__VIEWSTATE", Util.getValueInput("__VIEWSTATE", content));
            theParams.Add("__VIEWSTATEGENERATOR", Util.getValueInput("__VIEWSTATEGENERATOR", content));
            work = Util.getValue("action", content);
            returnedContent = crawler.doPost(base2URL + work, theParams);
            content = returnedContent.Result;

            theParams = new Dictionary<string, string>();
            returnedContent = crawler.doGet(base2URL + "Default.aspx?Date=" + DateTime.Now.ToString("MM/dd/yyyy"));
            content = returnedContent.Result;


            returnedContent = crawler.doGet(base2URL + "LoadWF.aspx?Date=" + DateTime.Now.ToString("MM/dd/yyyy"));
            content = returnedContent.Result;
        }
예제 #2
0
 public PatientManager(BaseCrawler aCrawler, string baseURL, string base2URL)
 {
     this.crawler = aCrawler;
     this.baseURL = baseURL;
     this.base2URL = base2URL;
 }