예제 #1
0
        private void ICEScheduleSteps()
        {
            ICESchedulerStatus.Content = "Running";
            if (ICEDownloaderSwitch.Value == 1)
            {
                downLoadStarter();
                ICEReconTimer.Interval = new TimeSpan(0, 1, 0);
            }
            if (olImporterSwitch.Value == 1)
            {
                ICEOLImporterTimer.Start();
                ICEReconTimer.Interval = new TimeSpan(0, 1, 0);
            }
            //Running it irrespective of switch coz we need to merge the ICE Files and update the queues. Switch check is in the scheduler method
            ICEReconTimer.Start();
            DateTime now = TimeZoneInfo.ConvertTimeFromUtc(System.DateTime.UtcNow, TimeZoneInfo.Local);

            ICESchedulerStatus.Content = "Last executed at " + now.ToString("dd-mmm-yy hh:mm:ss");
        }
예제 #2
0
        private void downLoadStarter()
        {
            //Console.Out;
            //string src =  IBrowser.GetSourceAsync(webPagePreview);
            //webPagePreview.ViewSource();
            //webPagePreview.GetMainFrame().ViewSource();
            if (ReconSwitch.Value == 1)
            {
                ICEReconTimer.Start();
            }
            ICEDownloaderStatus.Content = "Running";
            string cmd = @"document.getElementById('companyId').selectedIndex=0; ";

            cmd += @"var a = document.getElementsByTagName('a'); ";
            cmd += @"var c; for(i=0;i<a.length;i++) if(a[i].href=='https://www.theice.com/reports/DealReport.shtml?excel=') c=a[i]; c.click(); ";
            //cmd += @"alert(a[3].href);";
            //cmd += @"document.getElementById('companyId').selectedIndex=1; c.click()";
            //cmd += @"var a = document.getElementsByTagName('a'); ";
            //cmd += "for(i=0;i<a.length;i++) if(a[i].href==\"https://www.theice.com/reports/DealReport.shtml?excel=\") a[i].click(); ";

            cmd  = @"var a = document.getElementsByTagName('a'); var c; for (i = 0; i < a.length; i++) if (a[i].href == 'https://www.theice.com/reports/DealReport.shtml?excel=') c = a[i];";
            cmd += @"document.getElementById('companyId').selectedIndex = 0; c.click(); setTimeout(function(){ document.getElementById('companyId').selectedIndex = 1; c.click(); },15000);";
            IFrame frame = webPagePreview.GetMainFrame();

            frame.ExecuteJavaScriptAsync(cmd);
            frame.ExecuteJavaScriptAsync("document.getElementById('companyId').selectedIndex = 1;");
            //frame.ExecuteJavaScriptAsync("alert('ExecuteJavaScript works!');");
            //frame->GetURL(), 0);

            /*
             * var a = document.getElementsByTagName('a'); var c; for(i=0;i<a.length;i++) if(a[i].href=='https://www.theice.com/reports/DealReport.shtml?excel=') c=a[i];  setInterval(function(){
             * document.getElementById('companyId').selectedIndex=0; c.click(); console.log("0 Done"); setTimeout(function(){document.getElementById('companyId').selectedIndex=1; c.click();},5000);
             * }, 600000);
             */

            Debug.WriteLine("..........." + webPagePreview.Content.ToString());
            DateTime now = TimeZoneInfo.ConvertTimeFromUtc(System.DateTime.UtcNow, TimeZoneInfo.Local);

            ICEDownloaderStatus.Content = "Last executed at " + now.ToString("dd-mmm-yy hh:mm:ss");
            //Console.WriteLine("..........." + webPagePreview.Content.ToString());
        }
예제 #3
0
        private void reconSchedulerMethod(object sender, EventArgs e)
        {
            if (ICEDownloaderSwitch.Value == 1)
            {
                var a = new HTMLParser(@"C:\Users\Akhand\Documents\Visual Studio 2015\Projects\ExchangeRecon\ExchangeRecon\AppFiles\Download Data\ICE_CBNA.xls").Process().ToList();
                var b = new HTMLParser(@"C:\Users\Akhand\Documents\Visual Studio 2015\Projects\ExchangeRecon\ExchangeRecon\AppFiles\Download Data\ICE_CGML.xls").Process().ToList();
                foreach (DataTable t in b)
                {
                    a.Add(t);
                }
                Console.WriteLine("Num of tables extracted : " + a.Count);

                var data = new DataTable("ICE Data");
                MergeTables(a, data);
                AddPKtoICE(data);
                ICEqueues["ICE Raw Collated"].QData = data;
                ICEqueues["ICE Raw Collated"].ToCSV();
            }
            Console.WriteLine("Chal gaya hu");
            ICEReconTimer.Stop();
            if (ReconSwitch.Value == 1)
            {
                ICEReconStatus.Content = "Running";
                // Add the Recon Method
                ReconQueue comparisons = ICEqueues["Comparisons"];
                foreach (DataRow comp in comparisons.QData.Rows)
                {
                    queryTrials(comp, ICEqueues);
                }
                Console.WriteLine("Analysis done");
                foreach (KeyValuePair <string, ReconQueue> q in ICEqueues)
                {
                    q.Value.ToCSV();
                }
                DateTime now = TimeZoneInfo.ConvertTimeFromUtc(System.DateTime.UtcNow, TimeZoneInfo.Local);
                ICEReconStatus.Content = "Last executed at " + now.ToString("dd-mmm-yy hh:mm:ss");
            }
        }