public void create()
 {
     try
     {
         DataSet     ds         = new System.Data.DataSet();
         DataSet     ds2        = new System.Data.DataSet();
         cls_Reports obj_report = new cls_Reports();
         obj_report.carrierId = Convert.ToInt32(getSelectedCarrierID());
         obj_report.dateStart = dateFrom.SelectedDate.ToString();
         obj_report.dateEnd   = dateTo.SelectedDate.ToString();
         ds  = obj_report.fn_Trackcarrier(obj_report);
         ds2 = obj_report.fn_CarrierName(obj_report);
         string   carrierName = ds2.Tables[0].Rows[0]["carrierName"].ToString();
         DateTime date        = DateTime.Now;
         path = "~/KML/" + obj_report.carrierId + " " + date.Year + " " + date.Month + " " + date.Day + " " + date.Hour + " " + date.Minute + " " + date.Second + " " + date.Millisecond + ".kml";
         createRequiredPath("~/KML/");
         path = ViewState["path"].ToString() + obj_report.carrierId + " " + date.Year + " " + date.Month + " " + date.Day + " " + date.Hour + " " + date.Minute + " " + date.Second + " " + date.Millisecond + ".kml";
         Createkml createkml = new Createkml();
         createkml.createKmlAdv(ds, path, obj_report.carrierId, carrierName);
         createKmz(path);
         Uri    url  = Request.Url;
         string temp = url.ToString();
         string str  = Request.AppRelativeCurrentExecutionFilePath;
         str  = str.Substring(1);
         path = temp.Substring(0, temp.IndexOf(str));
         path = path + "/KML/" + obj_report.carrierId + " " + date.Year + " " + date.Month + " " + date.Day + " " + date.Hour + " " + date.Minute + " " + date.Second + " " + date.Millisecond + ".kmz";
         Page.ClientScript.RegisterStartupScript(Page.GetType(), "MyKey", "init('" + path + "');", true);
     }
     catch (Exception e)
     {
         cls_fileHandling fh = new cls_fileHandling();
         fh.appendToFile("~/logs/error.txt", DateTime.Now + ": " + e.Message);
         fh.appendToFile("~/logs/stackTrace.txt", DateTime.Now + ": " + e.StackTrace);
     }
 }
 protected void oldTrack_Click(object sender, EventArgs e)
 {
     if (datevalidate())
     {
         Timer1.Enabled      = false;
         autoRefresh.Checked = false;
         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);
     }
 }
    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();
            }
        }
    }
    protected void oldTrack_Click(object sender, EventArgs e)
    {
        if (datevalidate())
        {
            System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel9, UpdatePanel9.GetType(), "clearMarkers", "clearMarkers();", true);
            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);
            }
            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);
            }
        }
    }