/*
        Metodo para cargar los datos faltantes, en la ventana
        */
        private void getSessionData()
        {
            //Crea el servicio
            SessionService sessionService = new SessionService();
            SessionViewPlot view = new SessionViewPlot();
            view.SessionId = SessionText.Text;
            SessionPlotDataView data = sessionService.getDataLogInfo(view);
            AverageText.Text = data.AVG + "";
            StdText.Text = data.DEVP + "";
            ElapsedTimeText.Text = data.ElapsedTime + "";
            MaxTempText.Text = data.MaxValue + "";
            MinTempText.Text = data.MinValue + "";

            //Solicita los datos
            List<RecipeParameterView> listParameters = sessionService.getParameterBySession(view.SessionId);
            //Los carga en la tabla
            GridView1.DataSource = listParameters;
            GridView1.DataBind();
        }
        /*
        Metodo que construye el gráfico
        */
        private void drawChart()
        {
            SessionService sessionService = new SessionService();
            List<SessionDataLogChartView> dataForPlot = sessionService.getDataLogChart(SessionText.Text);
            List<int> xVal = new List<int>();
            List<int> yVal = new List<int>();

            int maxX = 0;
            int maxY = 0;
            int minY = 9999;

            foreach (var item in dataForPlot)
            {
                xVal.Add(item.ParameterXValue);
                yVal.Add(item.ParameterYValue);

                if (maxX < item.ParameterXValue)
                {
                    maxX = item.ParameterXValue;
                }

                if (maxY < item.ParameterYValue)
                {
                    maxY = item.ParameterYValue;
                }

                if (minY > item.ParameterYValue)
                {
                    minY = item.ParameterYValue;
                }

            }
            chart1.ChartAreas["User"].AxisY.Minimum = minY - 20;
            chart1.ChartAreas["User"].AxisY.Maximum = maxY + 20;
            chart1.ChartAreas["User"].AxisX.Interval = maxX / 20;
            chart1.ChartAreas["User"].AxisY.Interval = ((maxY + 20) - (minY - 20)) / 11;
            chart1.Series["sampleuser"].Points.DataBindXY(xVal, yVal);
        }
 /*
 Metodo para llenar la tabla de sessiones
 */
 private void fillTable()
 {
     SessionService sessionService = new SessionService();
     List<SessionView> accountData = sessionService.getSession();
     GridView3.DataSource = accountData;
     GridView3.DataBind();
 }
 /*
 Metodo que se utiliza para llenar la tabla de sessions
 */
 private void fillSessionTable(int ProcessSelected)
 {
     SessionService sessionService = new SessionService();
     List<SessionView> accountData = sessionService.getCurrectSessionReportTableSearchByProcess(ProcessSelected);
     GridView3.DataSource = accountData;
     GridView3.DataBind();
 }
 /*
 Metodo que carga en el dropdown de products los productos
 */
 private void fillProducts()
 {
     SessionService sessionService = new SessionService();
     List<ProductsView> sessionProduct = sessionService.getProducts();
     Product.DataSource = sessionProduct;
     Product.DataBind();
     ListItem l = new ListItem("", "", true);
     l.Selected = true;
     Product.Items.Insert(0, l);
 }
 /*
 Metodo que carga los procesos a partir del producto que es seleccionado
 */
 private void fillProcess(int ProductSelected)
 {
     SessionService sessionService = new SessionService();
     List<RecipeProcessView> recipeProcess = sessionService.getProcessForProduct(ProductSelected);
     Process.DataSource = recipeProcess;
     Process.DataBind();
     ListItem l = new ListItem("", "", true);
     l.Selected = true;
     Process.Items.Insert(0, l);
 }
 static SessionsController()
 {
     _service = new SessionService();
 }