protected void autoRefresh_CheckedChanged(object sender, EventArgs e)
 {
     if (autoRefresh.Checked == false)
     {
         Timer1.Enabled = false;
         DataSet ds = generateArrayIndex();
         MapLoad(ds);
     }
     else
     {
         Timer1.Enabled = true;
         DataSet ds = generateArrayIndex();
         MapLoad(ds);
         UpdatePanelReplayMap.Update();
     }
 }
    protected void actOnCarrierListevent()
    {
        DataSet ds = generateArrayIndex();

        if (!liveFollow.Checked)
        {
            MapLoad(ds);
            UpdatePanelReplayMap.Update();
        }
        DataTable dt = new DataTable();

        dt            = ds.Tables[0];
        dt.PrimaryKey = new System.Data.DataColumn[] { dt.Columns[0] };
        dt.Merge(ds.Tables[1]);
        RadGrid1.DataSource = dt;
        RadGrid1.Rebind();
        updatePanelDashboardGrid.Update();
    }
    protected void ListboxFleet_ItemCheck(object sender, Telerik.Web.UI.RadListBoxItemEventArgs e)
    {
        DataSet ds = generateArrayIndex();

        if (!liveFollow.Checked)
        {
            MapLoad(ds);
            UpdatePanelReplayMap.Update();
        }
        DataTable dt = new DataTable();

        dt            = ds.Tables[0];
        dt.PrimaryKey = new System.Data.DataColumn[] { dt.Columns[0] };
        dt.Merge(ds.Tables[1]);
        RadGrid1.DataSource = dt;
        RadGrid1.Rebind();
        updatePanelDashboardGrid.Update();
    }
    protected void Timer1_Tick(object sender, EventArgs e)
    {
        try
        {
            DataSet   ds = generateArrayIndex();
            DataTable dt = new DataTable();
            dt            = ds.Tables[0];
            dt.PrimaryKey = new System.Data.DataColumn[] { dt.Columns[0] };
            dt.Merge(ds.Tables[1]);
            RadGrid1.DataSource = dt;
            RadGrid1.Rebind();
            updatePanelDashboardGrid.Update();
            if (!liveFollow.Checked)
            {
                ReplayMap.DisableClear = true;
                //int[] carrierId = generateArrayIndex();
                MapLoad(ds);
                UpdatePanelReplayMap.Update();


                //cls_Carriers obj_carrier = new cls_Carriers();
                //DataSet ds = new DataSet();
                //ds = obj_carrier.tikerDataFetch(Convert.ToInt32(Session["role"].ToString()), Convert.ToInt32(Session["task"].ToString()), DateTime.Now);

                //for (int m = 0; m < ds.Tables[0].Rows.Count; m++)
                //{
                //    TikerContent.Items.Add(new RadListBoxItem(ds.Tables[0].Rows[m]["carrierName"].ToString() + ":" + ds.Tables[0].Rows[m]["feed"].ToString() + " at " + ds.Tables[0].Rows[m]["feedTime"].ToString(), ds.Tables[0].Rows[m]["feedId"].ToString()));
                //}
            }
            else
            {
                liveTrackPlay();
            }
        }
        catch (Exception ex)
        {
            cls_fileHandling fh = new cls_fileHandling();
            fh.appendToFile("~/logs/error.txt", DateTime.Now + ": " + ex.Message);
            fh.appendToFile("~/logs/stackTrace.txt", DateTime.Now + ": " + ex.StackTrace);
        }
    }
    protected void oldTrack_Click(object sender, EventArgs e)
    {
        if (datevalidate())
        {
            if (chkPlotLBS.Checked)
            {
                Timer1.Enabled      = false;
                autoRefresh.Checked = false;
                updatePanelControlPanel.Update();
                DataSet     ds         = new System.Data.DataSet();
                cls_Reports obj_report = new cls_Reports();
                obj_report.carrierId = Convert.ToInt32(txtVehName.SelectedItem.Value);
                obj_report.dateStart = dateFrom.SelectedDate.ToString();
                obj_report.dateEnd   = dateTo.SelectedDate.ToString();

                // DateTime dt = (DateTime)dateFrom.SelectedDate;
                ds = obj_report.fn_TrackcarrierWithLBS(obj_report, (DateTime)dateFrom.SelectedDate, (DateTime)dateTo.SelectedDate);
                plotTrack(ds);
                plotLBS(ds);
                UpdatePanelReplayMap.Update();
            }
            else
            {
                Timer1.Enabled      = false;
                autoRefresh.Checked = false;
                updatePanelControlPanel.Update();
                DataSet     ds         = new System.Data.DataSet();
                cls_Reports obj_report = new cls_Reports();
                obj_report.carrierId = Convert.ToInt32(txtVehName.SelectedItem.Value);
                obj_report.dateStart = dateFrom.SelectedDate.ToString();
                obj_report.dateEnd   = dateTo.SelectedDate.ToString();
                ds = obj_report.fn_Trackcarrier(obj_report);
                plotTrack(ds);
                UpdatePanelReplayMap.Update();
            }
        }
    }