コード例 #1
0
ファイル: PMCopper.aspx.cs プロジェクト: qimengcheng/xi
 protected void Materialpiker_Click(object sender, EventArgs e)
 {
     Panel9.Visible = true;
     UpdatePanel9.Update();
     GridView5.DataSource = pmc.Query_Type("");
     GridView5.DataBind();
 }
コード例 #2
0
ファイル: Default.aspx.cs プロジェクト: cookedm87/movieQuiz
 protected void Button4_Click(object sender, EventArgs e)
 {
     if (RadioButtonList3.SelectedIndex < 0)
     {
         errorDiv3.InnerText = "Please select an answer";
     }
     else if (RadioButtonList3.SelectedIndex == 0)
     {
         score++;
         questionsAnswered++;
         Button4.Enabled = false;
         RadioButtonList3.Items.FindByValue("correct").Attributes.Add("class", "right");
         monster.Visible  = true;
         monsterA.Visible = true;
         monsterA.Text    = "Correct! Who doesn't love a good Pixar film. This is, of course, BIlly Crystal as Mike Wazowski.";
         UpdatePanel9.Update();
         UpdatePanel10.Update();
         UpdatePanel11.Update();
     }
     else
     {
         questionsAnswered++;
         Button4.Enabled = false;
         RadioButtonList3.SelectedItem.Attributes.Add("class", "wrong");
         RadioButtonList3.Items.FindByValue("correct").Attributes.Add("class", "right");
         monster.Visible  = true;
         monsterA.Visible = true;
         monsterA.Text    = "I know it's a kids film, but it's a great one. This is, of course, Billy Crystal as Mike Wazowski in Monsters, inc.";
         UpdatePanel9.Update();
         UpdatePanel10.Update();
         UpdatePanel11.Update();
     }
 }
コード例 #3
0
ファイル: PMCopper.aspx.cs プロジェクト: qimengcheng/xi
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Panel4.Visible       = false;
         Panel3.Visible       = false;
         Panel5.Visible       = false;
         Panel6.Visible       = false;
         Panel7.Visible       = false;
         Panel8.Visible       = false;
         Panel9.Visible       = false;
         Panel10.Visible      = false;
         GridView1.DataSource = pmc.Query_Copper();
         GridView1.DataBind();
         UpdatePanel2.Update();
         UpdatePanel3.Update();
         UpdatePanel4.Update();
         UpdatePanel5.Update();
         UpdatePanel6.Update();
         UpdatePanel7.Update();
         UpdatePanel8.Update();
         UpdatePanel9.Update();
         UpdatePanel10.Update();
     }
 }
コード例 #4
0
 protected void GridView4_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "shanchu")
     {
         Guid wo = new Guid(e.CommandArgument.ToString());
         int  a  = dp.Delete_WorkOrder(wo);
         GridView4.DataSource = dp.Query_ConnectedWorkOrder(new Guid(PPID.Text));
         GridView4.DataBind();
         UpdatePanel9.Update();
     }
 }
コード例 #5
0
 protected void GridView5_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Choose")
     {
         Guid wo = new Guid(e.CommandArgument.ToString());
         Guid pp = new Guid(PPID.Text);
         dp.Insert_WorkOrder(wo, pp);
         GridView4.DataSource = dp.Query_ConnectedWorkOrder(new Guid(PPID.Text));
         GridView4.DataBind();
         UpdatePanel9.Update();
         UpdatePanel10.Update();
     }
 }
コード例 #6
0
 protected void ibtnListarrEmailDeudor_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         buscarEmail();
         ScriptManager.RegisterStartupScript(UpdatePanel9, UpdatePanel9.GetType(), "show", "$(function () { $('#" + Panel8.ClientID + "').modal('show'); });", true);
         UpdatePanel9.Update();
     }
     catch (Exception ex)
     {
         divAlerta.Visible = true;
         lblInfo.Text = ex.Message;
     }
 }
コード例 #7
0
    protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Details")
        {
            var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView3.SelectedIndex = row.RowIndex;
            ReportID.Text           = e.CommandArgument.ToString();
            GridView4.DataSource    = hd.QueryDetail(Guid.Empty, new Guid(ReportID.Text));
            GridView4.DataBind();
            Panel5.Visible = true;
            UpdatePanel5.Update();
        }
        if (e.CommandName == "De")
        {
            int a = hd.DeleteReport(new Guid(e.CommandArgument.ToString()));
            if (a > 0)
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('删除成功!');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('失败了诶...');", true);
            }
            GridView3.DataSource = hd.QueryReport(new Guid(VersionID.Text));
            GridView3.DataBind();
            GridView2.DataSource = hd.QueryVersion(new Guid(HSFID.Text));
            GridView2.DataBind();
            UpdatePanel3.Update();
        }
        if (e.CommandName == "Modify")
        {
            var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView3.SelectedIndex = row.RowIndex;
            ReportID.Text           = e.CommandArgument.ToString();
            GridView9.DataSource    = hd.QueryDetail(new Guid(VersionID.Text), Guid.Empty);
            GridView9.DataBind();
            Panel9.Visible = true;
            UpdatePanel9.Update();
        }
        if (e.CommandName == "ED")
        {
            var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView3.SelectedIndex = row.RowIndex;
            ReportID.Text           = e.CommandArgument.ToString();
            Label1.Text             = "编辑";

            Panel8.Visible = true;
            UpdatePanel8.Update();
        }
    }
コード例 #8
0
ファイル: PMCopper.aspx.cs プロジェクト: qimengcheng/xi
    protected void GridView5_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Choose")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;

            Mid.Text = e.CommandArgument.ToString();
            Debug.Assert(row != null, "这是个意外!");
            Type.Text       = row.Cells[1].Text;
            CopperRate.Text = row.Cells[3].Text;
            Panel9.Visible  = false;
            UpdatePanel9.Update();
            UpdatePanel3.Update();
        }
    }
コード例 #9
0
    protected void SummitWorkOrder_Click(object sender, EventArgs e)
    {
        int a = dp.Update_State_Setup(new Guid(PPID.Text));

        ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert",
                                            a == 1 ? "alert('提交成功!')" : "alert('提交失败!')", true);
        Panel9.Visible       = false;
        Panel10.Visible      = false;
        GridView1.DataSource = dp.Query_DefectProduct(new Guid(PPID.Text));
        GridView1.DataBind();
        Panel2.Visible = true;
        UpdatePanel2.Update();
        UpdatePanel9.Update();
        UpdatePanel10.Update();
        GridView1.Enabled = true;
    }
コード例 #10
0
    void plotLBS(DataSet ds)
    {
        double speed;

        string lat = "20";
        string lng = "73";

        if (ds.Tables[2].Rows.Count <= 0)
        {
        }
        else
        {
            DateTime prevTime = (DateTime)ds.Tables[2].Rows[0]["time"];
            double   newlat   = 0;
            double   newlong  = 0;

            DateTime newtime   = DateTime.Now;
            DateTime oldtime   = DateTime.Now;
            int      cnt       = 1;
            int      recordCnt = ds.Tables[2].Rows.Count;
            int      m         = 0;


            while (m < recordCnt)
            {
                speed   = (double)ds.Tables[2].Rows[m]["speed"];
                newlat  = (double)ds.Tables[2].Rows[m]["latitude"];
                newlong = (double)ds.Tables[2].Rows[m]["longitude"];
                newtime = (DateTime)ds.Tables[2].Rows[m]["time"];

                lat = newlat.ToString();
                lng = newlong.ToString();
                string Date = newtime.ToString();

                cnt++;
                string Info       = "</br>" + "Latitude : " + lat + "</br>" + "Longitude : " + "" + lng + "</br>" + "Date & Time : " + Date;
                string desc       = Info;
                string angle      = ds.Tables[2].Rows[m]["angle"].ToString();
                string iconPath   = "icons/random/tower.png";
                string parameters = Info + "','Cell Tower','" + lat + "','" + lng + "','" + desc + "','" + angle + "','" + iconPath;
                System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel9, UpdatePanel9.GetType(), "stop" + m, "stop('" + parameters + "');", true);

                m++;
            }
        }
    }
コード例 #11
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "History")
        {
            var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            HSFID.Text           = e.CommandArgument.ToString();
            GridView2.DataSource = hd.QueryVersion(new Guid(e.CommandArgument.ToString()));
            GridView2.DataBind();
            Panel3.Visible = true;

            Panel4.Visible = false;
            Panel5.Visible = false;

            Panel6.Visible = false;

            Panel7.Visible = false;

            Panel8.Visible = false;

            Panel9.Visible = false;
            UpdatePanel2.Update();
            UpdatePanel3.Update();
            UpdatePanel4.Update();
            UpdatePanel5.Update();
            UpdatePanel6.Update();
            UpdatePanel7.Update();
            UpdatePanel8.Update();
            UpdatePanel9.Update();
        }
        if (e.CommandName == "Details")
        {
            var row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            HSFID.Text           = e.CommandArgument.ToString();
            GridView5.DataSource = hd.QueryDetailAI(new Guid(HSFID.Text));
            GridView5.DataBind();
            Panel6.Visible = true;
            UpdatePanel2.Update();
            UpdatePanel6.Update();
        }
    }
コード例 #12
0
    protected void SummitReportData_Click(object sender, EventArgs e)
    {
        string man = Session["UserName"].ToString();


        foreach (GridViewRow rows in GridView9.Rows)
        {
            TextBox note = rows.Cells[6].FindControl("TextBox1") as TextBox;
            TextBox net  = rows.Cells[7].FindControl("TextBox2") as TextBox;

            if (net.Text != "" && net.Enabled)
            {
                string notestring = note.Text;
                string netstring  = net.Text;
                Guid   detailid   = new Guid(rows.Cells[0].Text);
                hd.InsertDetail(detailid, new Guid(ReportID.Text), netstring, man, notestring);
            }
        }
        Panel9.Visible       = false;
        GridView9.DataSource = hd.QueryDetail(new Guid(VersionID.Text), Guid.Empty);
        GridView9.DataBind();
        UpdatePanel9.Update();
    }
コード例 #13
0
    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);
            }
        }
    }
コード例 #14
0
ファイル: PMCopper.aspx.cs プロジェクト: qimengcheng/xi
 protected void CloseType_Click(object sender, EventArgs e)
 {
     Panel9.Visible = false;
     UpdatePanel9.Update();
 }
コード例 #15
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "setorder")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;

            GridView1.SelectedIndex = row.RowIndex;
            PPID.Text       = e.CommandArgument.ToString();
            Panel9.Visible  = true;
            Panel10.Visible = true;

            GridView4.DataSource = dp.Query_ConnectedWorkOrder(new Guid(PPID.Text));
            GridView4.DataBind();
            GridView5.DataSource = dp.Query_WorkOrder(TextBox20.Text);
            GridView5.DataBind();
            UpdatePanel9.Update();
            UpdatePanel10.Update();
        }

        if (e.CommandName == "getorder")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            PPID.Text            = e.CommandArgument.ToString();
            Panel9.Visible       = false;
            Panel10.Visible      = false;
            Panel12.Visible      = true;
            GridView9.DataSource = dp.Query_ConnectedWorkOrder(new Guid(PPID.Text));
            GridView9.DataBind();
            UpdatePanel12.Update();
            UpdatePanel10.Update();
            UpdatePanel9.Update();
        }
        if (e.CommandName == "setview")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            PPID.Text = e.CommandArgument.ToString();
            DropDownList3.Items.Clear();

            SqlDataReader myReader = dp.Query_CapableDep(new Guid(PPID.Text));

            SqlDataReader myReader2 = dp.Query_CapableDepDone(new Guid(PPID.Text));


            while (myReader.Read())
            {
                string a = myReader["BDOS_Name"].ToString();

                if (Session["Department"].ToString().Contains(myReader["BDOS_Name"].ToString()))
                {
                    DropDownList3.Items.Add(new ListItem(myReader["BDOS_Name"].ToString(), myReader["PPDS_ID"].ToString()));//增加Item
                }
            }



            while (myReader2.Read())
            {
                ListItem li = DropDownList3.Items.FindByText(myReader2["BDOS_Name"].ToString());
                DropDownList3.Items.Remove(li);
            }
            if (DropDownList3.Items.Count > 0)
            {
                Panel11.Visible = true;
                UpdatePanel11.Update();
            }
            else
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('处理意见已填写或您没有相应的权限!')", true);
            }
        }
        if (e.CommandName == "getview")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            PPID.Text             = e.CommandArgument.ToString();
            GridView10.DataSource = dp.GetAuditSuggest(new Guid(PPID.Text));
            GridView10.DataBind();
            Panel15.Visible = true;
            UpdatePanel15.Update();
        }
        if (e.CommandName == "track")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            PPID.Text = e.CommandArgument.ToString();

            Panel13.Visible = true;
            Panel14.Visible = false;
            Panel15.Visible = false;

            UpdatePanel13.Update();
            UpdatePanel14.Update();
            UpdatePanel15.Update();
        }
        if (e.CommandName == "audit")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            PPID.Text            = e.CommandArgument.ToString();
            GridView8.DataSource = dp.GetAuditSuggest(new Guid(PPID.Text));
            GridView8.DataBind();
            Panel14.Visible = true;
            UpdatePanel14.Update();
        }
        if (e.CommandName == "mod")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            switchlabel.Text        = "修改";
            PPID.Text      = e.CommandArgument.ToString();
            Panel3.Visible = true;
            UpdatePanel3.Update();
            UpdatePanel4.Update();
        }
        if (e.CommandName == "del")
        {
            GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow;
            GridView1.SelectedIndex = row.RowIndex;
            PPID.Text = e.CommandArgument.ToString();
            dp.Delete_DefectProduct(new Guid(PPID.Text));
            GridView1.DataSource = dp.Query_DefectProduct();

            GridView1.DataBind();
            Panel4.Visible  = false;
            Panel10.Visible = false;
            Panel14.Visible = false;
            UpdatePanel2.Update();
            UpdatePanel3.Update();
            UpdatePanel4.Update();
            UpdatePanel10.Update();
            UpdatePanel14.Update();
        }
    }
コード例 #16
0
    protected void ChooseWorkOrder_Click(object sender, EventArgs e)
    {
        if (TextBox9.Text == "" || TextBox11.Text == "")
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('标记*的为必填项,请填写完整!')", true);
            return;
        }
        if (Label1.Text != "未选择" && Label3.Text != "未选择" && Label5.Text != "未选择" && Label27.Text != "未选择")
        {
            var num         = Decimal.Parse(TextBox9.Text);
            var description = TextBox11.Text;
            var type        = new Guid(typeid.Text);
            var cra         = new Guid(craid.Text);
            var po          = new Guid(poid.Text);
            var dep         = depid.Text;
            if (switchlabel.Text == "新增")
            {
                try
                {
                    var ppidGuid = dp.Insert_DefectProduct(type, cra, po, dep, num, description,
                                                           Session["UserName"].ToString());
                    Panel9.Visible  = true;
                    Panel10.Visible = true;
                    Panel3.Visible  = false;
                    string[] depart = dep.Split(',');
                    foreach (string s in depart)
                    {
                        dp.Insert_DefectDep(ppidGuid, s);
                    }
                    PPID.Text            = ppidGuid.ToString();
                    Panel9.Visible       = true;
                    Panel10.Visible      = true;
                    GridView5.DataSource = dp.Query_WorkOrder(TextBox20.Text);
                    GridView5.DataBind();
                    UpdatePanel9.Update();
                    UpdatePanel10.Update();
                    GridView1.Enabled = false;
                }
                catch (Exception exception)
                {
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('新增失败!')", true);
                }
            }

            else
            {
                try
                {
                    Guid pp = new Guid(PPID.Text);
                    dp.Update_DefectProduct(pp, type, cra, po, dep, num, description,
                                            Session["UserName"].ToString());
                    Panel9.Visible  = true;
                    Panel10.Visible = true;
                    Panel3.Visible  = false;
                    string[] depart = dep.Split(',');
                    int      a      = dp.ClearDefectDep(pp);
                    foreach (string s in depart)
                    {
                        dp.Insert_DefectDep(pp, s);
                    }
                    PPID.Text            = pp.ToString();
                    Panel9.Visible       = true;
                    Panel10.Visible      = true;
                    GridView5.DataSource = dp.Query_WorkOrder(TextBox20.Text);
                    GridView5.DataBind();
                    UpdatePanel9.Update();
                    UpdatePanel10.Update();
                    GridView1.Enabled = false;
                }
                catch (Exception exception)
                {
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('更新失败!')", true);
                }
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "alert", "alert('还有未选择的项目呢!')", true);
        }
    }
コード例 #17
0
    void plotTrack(DataSet ds)
    {
        //ReplayMap.MapType = (MapType)Session["mapType"];
        double speed;
        int    maxSpeed = 75;

        try
        {
            maxSpeed = Convert.ToInt32(ds.Tables[1].Rows[0]["maxSpeed"]);
        }
        catch (Exception)
        {
            maxSpeed = 75;
        }
        string lat = "20";
        string lng = "73";

        Artem.Google.UI.GooglePolyline pl = new Artem.Google.UI.GooglePolyline();
        pl.StrokeColor  = System.Drawing.Color.Blue;
        pl.StrokeWeight = 5;
        if (ds.Tables[0].Rows.Count <= 0)
        {
        }
        else
        {
            DateTime prevTime = (DateTime)ds.Tables[0].Rows[0]["time"];
            double   oldspeed = 0;
            double   newlat   = 0;
            double   newlong  = 0;

            DateTime newtime   = DateTime.Now;
            DateTime oldtime   = DateTime.Now;
            int      cnt       = 0;
            int      recordCnt = ds.Tables[0].Rows.Count;
            int      m         = 0;
            if (chkfilter.Checked == false)
            {
                while (m < recordCnt)
                {
                    speed   = (double)ds.Tables[0].Rows[m]["speed"];
                    newlat  = (double)ds.Tables[0].Rows[m]["latitude"];
                    newlong = (double)ds.Tables[0].Rows[m]["longitude"];
                    newtime = (DateTime)ds.Tables[0].Rows[m]["time"];

                    if (speed < 1)
                    {
                        lat = newlat.ToString();
                        lng = newlong.ToString();
                        string PlateNo = txtVehName.Text;
                        string Speed   = speed.ToString();
                        string Date    = newtime.ToString();



                        string Info     = "Plate No : " + PlateNo + "</br>" + "Latitude : " + lat + "</br>" + "Longitude : " + "" + lng + "</br>" + "Speed : " + "" + Speed + "</br>" + "Date & Time : " + Date;
                        string desc     = Info;
                        string angle    = ds.Tables[0].Rows[m]["angle"].ToString();
                        string iconPath = "icons/random/car_icon3big.png";

                        string parameters = Info + "','" + PlateNo + "','" + lat + "','" + lng + "','" + desc + "','" + angle + "','" + iconPath + "','" + iconPath;
                        System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel9, UpdatePanel9.GetType(), "stop" + m, "stop('" + parameters + "');", true);
                    }
                    else if (speed > maxSpeed)
                    {
                        lat = newlat.ToString();
                        lng = newlong.ToString();
                        string PlateNo = txtVehName.Text;
                        string Speed   = speed.ToString();
                        string Date    = newtime.ToString();

                        string Info        = "Plate No : " + PlateNo + "</br>" + "Latitude : " + lat + "</br>" + "Longitude : " + "" + lng + "</br>" + "Speed : " + "" + Speed + "</br>" + "Date & Time : " + Date;
                        string desc        = Info;
                        string angle       = ds.Tables[0].Rows[m]["angle"].ToString();
                        string basePath    = ds.Tables[1].Rows[0]["carrierTypeFId"].ToString();
                        string lbsLocation = "0";
                        string parameters  = Info + "','" + PlateNo + "','" + lat + "','" + lng + "','" + desc + "','" + angle + "','" + basePath + "','" + Speed + "','" + lbsLocation;
                        System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel9, UpdatePanel9.GetType(), "placeMarker" + m, "placeMarker('" + parameters + "');", true);
                    }
                    else
                    {
                        lat = newlat.ToString();
                        lng = newlong.ToString();
                        string PlateNo = txtVehName.Text;
                        string Speed   = speed.ToString();
                        string Date    = newtime.ToString();

                        string Info        = "Plate No : " + PlateNo + "</br>" + "Latitude : " + lat + "</br>" + "Longitude : " + "" + lng + "</br>" + "Speed : " + "" + Speed + "</br>" + "Date & Time : " + Date;
                        string desc        = Info;
                        string angle       = ds.Tables[0].Rows[m]["angle"].ToString();
                        string basePath    = ds.Tables[1].Rows[0]["carrierTypeFId"].ToString();
                        string lbsLocation = "0";
                        string parameters  = Info + "','" + PlateNo + "','" + lat + "','" + lng + "','" + desc + "','" + angle + "','" + basePath + "','" + Speed + "','" + lbsLocation;
                        System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel9, UpdatePanel9.GetType(), "placeMarker" + m, "placeMarker('" + parameters + "');", true);
                    }
                    m++;
                }
            }
            else
            {
                while (m < recordCnt)
                {
                    speed   = (double)ds.Tables[0].Rows[m]["speed"];
                    newlat  = (double)ds.Tables[0].Rows[m]["latitude"];
                    newlong = (double)ds.Tables[0].Rows[m]["longitude"];
                    newtime = (DateTime)ds.Tables[0].Rows[m]["time"];
                    cnt     = 0;
                    if (speed <= 2)
                    {
                        m++;
                        if (m >= recordCnt)
                        {
                            break;
                        }
                        oldspeed = (double)ds.Tables[0].Rows[m]["speed"];
                        while (oldspeed <= 2 && m < recordCnt)
                        {
                            oldspeed = (double)ds.Tables[0].Rows[m]["speed"];
                            m++;
                            cnt++;
                        }
                        if (cnt < 2)
                        {
                            lat = newlat.ToString();
                            lng = newlong.ToString();
                            string PlateNo = txtVehName.Text;
                            string Speed   = speed.ToString();
                            string Date    = newtime.ToString();


                            string Info       = "Plate No : " + PlateNo + "</br>" + "Latitude : " + lat + "</br>" + "Longitude : " + "" + lng + "</br>" + "Speed : " + "" + Speed + "</br>" + "Date & Time : " + Date;
                            string desc       = Info;
                            string angle      = ds.Tables[0].Rows[m]["angle"].ToString();
                            string iconPath   = "icons/random/car_icon3big.png";
                            string parameters = Info + "','" + PlateNo + "','" + lat + "','" + lng + "','" + desc + "','" + angle + "','" + iconPath;
                            System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel9, UpdatePanel9.GetType(), "stop" + m, "stop('" + parameters + "');", true);
                        }
                        else
                        {
                            oldspeed = (double)ds.Tables[0].Rows[m - 2]["speed"];
                            oldtime  = (DateTime)ds.Tables[0].Rows[m - 2]["time"];
                            lat      = newlat.ToString();
                            lng      = newlong.ToString();
                            string PlateNo = txtVehName.Text;
                            string Speed   = "0";
                            string Date    = newtime.ToString();



                            string Info       = "Plate No : " + PlateNo + "</br>" + "Latitude : " + lat + "</br>" + "Longitude : " + "" + lng + "</br>" + "Speed : " + "" + Speed + "</br>" + "Time from:" + newtime + "  to:" + oldtime;
                            string desc       = Info;
                            string angle      = ds.Tables[0].Rows[m - 2]["angle"].ToString();
                            string iconPath   = "icons/random/car_icon3big.png";
                            string parameters = Info + "','" + PlateNo + "','" + lat + "','" + lng + "','" + desc + "','" + angle + "','" + iconPath;
                            System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel9, UpdatePanel9.GetType(), "stop" + m, "stop('" + parameters + "');", true);
                        }
                    }
                    else if (speed > maxSpeed)
                    {
                        lat = newlat.ToString();
                        lng = newlong.ToString();
                        string PlateNo = txtVehName.Text;
                        string Speed   = speed.ToString();
                        string Date    = newtime.ToString();

                        string Info        = "Plate No : " + PlateNo + "</br>" + "Latitude : " + lat + "</br>" + "Longitude : " + "" + lng + "</br>" + "Speed : " + "" + Speed + "</br>" + "Date & Time : " + Date;
                        string desc        = Info;
                        string angle       = ds.Tables[0].Rows[m]["angle"].ToString();
                        string basePath    = ds.Tables[1].Rows[0]["carrierTypeFId"].ToString();
                        string lbsLocation = "0";
                        string parameters  = Info + "','" + PlateNo + "','" + lat + "','" + lng + "','" + desc + "','" + angle + "','" + basePath + "','" + Speed + "','" + lbsLocation;
                        System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel9, UpdatePanel9.GetType(), "placeMarker" + m, "placeMarker('" + parameters + "');", true);
                    }
                    else
                    {
                        lat = newlat.ToString();
                        lng = newlong.ToString();
                        string PlateNo = txtVehName.Text;
                        string Speed   = speed.ToString();
                        string Date    = newtime.ToString();


                        string Info        = "Plate No : " + PlateNo + "</br>" + "Latitude : " + lat + "</br>" + "Longitude : " + "" + lng + "</br>" + "Speed : " + "" + Speed + "</br>" + "Date & Time : " + Date;
                        string desc        = Info;
                        string angle       = ds.Tables[0].Rows[m]["angle"].ToString();
                        string basePath    = ds.Tables[1].Rows[0]["carrierTypeFId"].ToString();
                        string lbsLocation = "0";
                        string parameters  = Info + "','" + PlateNo + "','" + lat + "','" + lng + "','" + desc + "','" + angle + "','" + basePath + "','" + Speed + "','" + lbsLocation;
                        System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel9, UpdatePanel9.GetType(), "placeMarker" + m, "placeMarker('" + parameters + "');", true);
                    }
                    m++;
                }
            }
            System.Web.UI.ScriptManager.RegisterClientScriptBlock(UpdatePanel9, UpdatePanel9.GetType(), "drawPath" + m, "drawPath();", true);
        }
    }
コード例 #18
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     Panel9.Visible = false;
     UpdatePanel9.Update();
 }