/*
 Metodo que se utiliza cuando se selecciona una session, se guarda en un cookie una lista con los datos de la fila seleccionada, cada vez que se  cambia se sobreescriben estos datos
 esto se realiza para tener los datos guardados en caso de que se quiera realizar un grafico
 */
 protected void GridView3_SelectedIndexChanged(object sender, EventArgs e)
 {
     clearFields();
     //Complete the textbox with the information of the selected row
     string router = (GridView3.SelectedRow.FindControl("Router") as Label).Text;
     string upn = (GridView3.SelectedRow.FindControl("UpnId") as Label).Text;
     string start = (GridView3.SelectedRow.FindControl("SessionStart") as Label).Text;
     string end = (GridView3.SelectedRow.FindControl("SessionEnd") as Label).Text;
     string startedby = (GridView3.SelectedRow.FindControl("Startedby") as Label).Text;
     string closeby = (GridView3.SelectedRow.FindControl("ClosedBy") as Label).Text;
     string sessionId = GridView3.SelectedPersistedDataKey.Value.ToString();
     foreach (GridViewRow row in GridView3.Rows)
     {
         if (row.RowIndex == GridView3.SelectedIndex)
         {
             row.BackColor = ColorTranslator.FromHtml("#A1DCF2");
             row.ToolTip = string.Empty;
         }
         else
         {
             row.BackColor = ColorTranslator.FromHtml("#FFFFFF");
             row.ToolTip = "Click to select this Session";
         }
     }
     CurrentToPlotView view = new CurrentToPlotView();
     view.Router = router;
     view.UpnId = upn;
     view.SessionId = sessionId;
     view.SessionStart = start;
     view.SessionEnd = end;
     view.Startedby = startedby;
     view.ClosedBy = closeby;
     view.Page = "CurrentActiveSession";
     HttpContext.Current.Session["data"] = view;
 }
        /*
        Metodo que llena la informacion de los recuadros, conforme se selecciona una fila diferente en la tabla de sessiones
        */
        protected void GridView3_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Complete the textbox with the information of the selected row
            RouterText.Text = (GridView3.SelectedRow.FindControl("Router") as Label).Text;
            UpnText.Text = (GridView3.SelectedRow.FindControl("UpnId") as Label).Text;
            SessionText.Text = (GridView3.SelectedRow.FindControl("SessionId") as Label).Text;
            SessionStartText.Text = (GridView3.SelectedRow.FindControl("SessionStart") as Label).Text;
            SessionEndText.Text = (GridView3.SelectedRow.FindControl("SessionEnd") as Label).Text;
            EquipmentText.Text = (GridView3.SelectedRow.FindControl("Equipment") as Label).Text;
            EquipmentSubIdText.Text = (GridView3.SelectedRow.FindControl("SubId") as Label).Text;
            ProcessModeText.Text = (GridView3.SelectedRow.FindControl("ProcessMode") as Label).Text;
            OperationText.Text = (GridView3.SelectedRow.FindControl("Operation") as Label).Text;
            OperationStatusText.Text = (GridView3.SelectedRow.FindControl("OperationStatus") as Label).Text;

            string startedby = (GridView3.SelectedRow.FindControl("Startedby") as Label).Text;
            string closeby = (GridView3.SelectedRow.FindControl("ClosedBy") as Label).Text;

            foreach (GridViewRow row in GridView3.Rows)
            {
                if (row.RowIndex == GridView3.SelectedIndex)
                {
                    row.BackColor = ColorTranslator.FromHtml("#A1DCF2");
                    row.ToolTip = string.Empty;
                }
                else
                {
                    row.BackColor = ColorTranslator.FromHtml("#FFFFFF");
                    row.ToolTip = "Click to select this Session";
                }
            }

            CurrentToPlotView view = new CurrentToPlotView();
            view.Router = RouterText.Text;
            view.UpnId = UpnText.Text;
            view.SessionId = SessionText.Text;
            view.SessionStart = SessionStartText.Text;
            view.SessionEnd = SessionEndText.Text;
            view.Startedby = startedby;
            view.ClosedBy = closeby;

            view.Page = "SessionReportSearch";

            HttpContext.Current.Session["data"] = view;
        }