public MarketNewsWindow()
        {
            this.InitializeComponent();

            Image img = Properties.Resources.wsj;
            this.logoBox.Image = img;

            this.dataExtraction = new DataExtraction();
            this.feedCondent = new SyndicationFeed();
            this.links = new Dictionary<DateTime, string>();

            this.feedCondent = this.dataExtraction.GetRssFeedData("http://online.wsj.com/xml/rss/3_7031.xml");
            if (this.feedCondent != null)
            {
                Tuple<DataGridView, Dictionary<DateTime, string>> parsedContent =
                    this.dataExtraction.ParseRssFeedData(this.feedCondent);

                foreach (DataGridViewRow row in parsedContent.Item1.Rows)
                {
                    int rowId = this.dataGridContent.Rows.Add();
                    this.dataGridContent.Rows[rowId].Cells[0].Value = row.Cells[0].Value;
                    this.dataGridContent.Rows[rowId].Cells[1].Value = row.Cells[1].Value;
                    this.dataGridContent.Rows[rowId].Cells[2].Value = row.Cells[2].Value;
                }

                this.links = parsedContent.Item2;
            }

            this.dataGridContent.Sort(this.dataGridContent.Columns[0], ListSortDirection.Descending);
        }
        public GlobalEquityWindow()
        {
            this.InitializeComponent();

            Image img = Properties.Resources.standardandpoors;
            this.logoBox.Image = img;

            this.dataExtraction = new DataExtraction();
            this.feedCondent = new SyndicationFeed();
            this.links = new Dictionary<DateTime, string>();

            this.feedCondent = this.dataExtraction.GetRssFeedData("https://us.spindices.com/rss/rss-details/?rssFeedName=global-equity");
            if (this.feedCondent != null)
            {
                Tuple<DataGridView, Dictionary<DateTime, string>> parsedContent =
                    this.dataExtraction.ParseRssFeedData(this.feedCondent);

                foreach (DataGridViewRow row in parsedContent.Item1.Rows)
                {
                    int rowId = this.dataGridContent.Rows.Add();
                    this.dataGridContent.Rows[rowId].Cells[0].Value = row.Cells[0].Value;
                    this.dataGridContent.Rows[rowId].Cells[1].Value = row.Cells[1].Value;
                    this.dataGridContent.Rows[rowId].Cells[2].Value = row.Cells[2].Value;
                }

                this.links = parsedContent.Item2;
            }

            this.dataGridContent.Sort(this.dataGridContent.Columns[0], ListSortDirection.Descending);
        }
Example #3
0
        public IActionResult GetData([FromBody] DataExtraction data_extraction)
        {
            _DataExtractionService.IncreaseDLCounter("GetData");

            // extract data from database to show in the client
            return(new JsonResult(_DataExtractionService.GetDataFromDB(data_extraction)));
        }
        public UpDownGradesWindow()
        {
            this.InitializeComponent();

            Image img = Properties.Resources.briefing;
            this.logoBox.Image = img;

            this.dataExtraction = new DataExtraction();
            this.feedCondent = new SyndicationFeed();
            this.links = new Dictionary<DateTime, string>();

            this.feedCondent = this.dataExtraction.GetRssFeedData("http://rss.briefing.com/Investor/RSS/UpgradesDowngrades.xml", true);
            if (this.feedCondent != null)
            {
                Tuple<DataGridView, Dictionary<DateTime, string>> parsedContent =
                    this.dataExtraction.ParseRssFeedData(this.feedCondent);

                foreach (DataGridViewRow row in parsedContent.Item1.Rows)
                {
                    int rowId = this.dataGridContent.Rows.Add();
                    this.dataGridContent.Rows[rowId].Cells[0].Value = row.Cells[0].Value;
                    this.dataGridContent.Rows[rowId].Cells[1].Value = row.Cells[1].Value;
                    this.dataGridContent.Rows[rowId].Cells[2].Value = row.Cells[2].Value;
                }

                this.links = parsedContent.Item2;
            }

            this.dataGridContent.Sort(this.dataGridContent.Columns[0], ListSortDirection.Descending);
        }
        public IntradayNewsWindow()
        {
            this.InitializeComponent();

            Image img = Properties.Resources.bb;
            this.logoBox.Image = img;

            this.dataExtraction = new DataExtraction();
            this.feedCondent = new SyndicationFeed();
            this.links = new Dictionary<DateTime, string>();

            // TODO: Must fix xml parsing error local to this feed only
            //this.feedCondent = this.dataExtraction.GetRssFeedData("http://www.bondbuyer.com/resources/intraday_rss.xml");
            //if (this.feedCondent != null)
            //{
            //    Tuple<DataGridView, Dictionary<DateTime, string>> parsedContent =
            //        this.dataExtraction.ParseRssFeedData(this.feedCondent);

            //    foreach (DataGridViewRow row in parsedContent.Item1.Rows)
            //    {
            //        int rowId = this.dataGridContent.Rows.Add();
            //        this.dataGridContent.Rows[rowId].Cells[0].Value = row.Cells[0].Value;
            //        this.dataGridContent.Rows[rowId].Cells[1].Value = row.Cells[1].Value;
            //        this.dataGridContent.Rows[rowId].Cells[2].Value = row.Cells[2].Value;
            //    }

            //    this.links = parsedContent.Item2;
            //}

            //this.dataGridContent.Sort(this.dataGridContent.Columns[0], ListSortDirection.Descending);
        }
Example #6
0
        public async Task <JsonResult> OCR(string data)
        {
            try
            {
                OCR ocr = new OCR();
                await ocr.ExtractText(data);

                if (ocr.Error == "")
                {
                    DataExtraction de = new DataExtraction();
                    de.BusinessCardReader(ocr.OCRList);
                    return(Json(new { ExtractedText = ocr.OcrResult, Name = de.name, Address = de.address, Phone = de.mobile, CompName = de.company }));
                }
                return(Json(new { Error = ocr.Error }));
            }
            catch (Exception e)// handling runtime errors and returning error as Json
            {
                return(Json(new { Error = e.Message }));
            }
        }
        public void get_students_attendance()
        {
            string connectionString, sql;

            connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["StudentsConnectionString"].ConnectionString;
            using (SqlConnection sqlConnection = new SqlConnection(connectionString))
            {
                sqlConnection.Open();
                sql = @"Select *from Students;";
                using (SqlCommand sqlCommand = new SqlCommand(sql, sqlConnection))
                {
                    using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand))
                    {
                        using (DataTable dataTabale = new DataTable())
                        {
                            sqlDataAdapter.Fill(dataTabale);
                            int count = dataTabale.Rows.Count;
                            for (int i = 0; i < count; i++)
                            {
                                string name, address, absent, present, studentid;
                                studentid = Convert.ToString(dataTabale.Rows[i]["StudentId"]);
                                name      = Convert.ToString(dataTabale.Rows[i]["Name"]);
                                address   = Convert.ToString(dataTabale.Rows[i]["Address"]);
                                present   = DataExtraction.count_attendence(studentid, "1");
                                absent    = DataExtraction.count_attendence(studentid, "0");
                                DataRow dr = dt.NewRow();
                                dr["Name"]         = name;
                                dr["Address"]      = address;
                                dr["Present_Days"] = present;
                                dr["Absent_Days"]  = absent;

                                dt.Rows.Add(dr);
                            }
                        }
                    }
                }
            }
        }