using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


namespace StockForecasterClient
{
    public partial class ForecasterClient : System.Web.UI.Page
    {
        SFSService.StockInfo serviceObj;

        protected void Page_Load(object sender, EventArgs e)
        {
          serviceObj = new SFSService.StockInfo();
          Panel1.Visible = false;

        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            DataSet compinfo;
            compinfo =  (DataSet)serviceObj.GetStockPriceInfo(txtInput.Text);
            GridView1.DataSource = compinfo;
            GridView1.DataBind();
            Panel1.Visible = true;
            GridView2.DataSource = null;
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            string stockid = GridView1.Rows[0].Cells[0].Text;
            DataSet dtPerf = (DataSet)serviceObj.GetCurrentDayPerformance(stockid);
            GridView2.DataSource = dtPerf;
            GridView2.DataBind();
        }

        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            string stockid = GridView1.Rows[0].Cells[0].Text;
            DataSet dtPerf = (DataSet)serviceObj.GetStockPerformance(stockid,0);
            GridView2.DataSource = dtPerf;
            GridView2.DataBind();
        }

        protected void txtInput_TextChanged(object sender, EventArgs e)
        {
        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
        }
    }
}
