protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListView list = e.Item.FindControl("ListView2") as ListView; Label lablepid = e.Item.FindControl("Label1") as Label; DataTable table = Oorder.getoneorder(lablepid.Text); list.DataSource = table; list.DataBind(); } }
protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListView list = e.Item.FindControl("ListView2") as ListView; Label lablepid = e.Item.FindControl("Label2") as Label; Label labelstate = e.Item.FindControl("Label3") as Label; Button b1 = e.Item.FindControl("qxdd") as Button; Button b2 = e.Item.FindControl("ddfh") as Button; Button b3 = e.Item.FindControl("qrsh") as Button; Button b4 = e.Item.FindControl("wcjy") as Button; Button b5 = e.Item.FindControl("hfdd") as Button; string state = labelstate.Text; if (state == "0") { b1.Visible = false; b2.Visible = false; b3.Visible = false; b4.Visible = false; b5.Visible = true; } else if (state == "1") { b1.Visible = true; b2.Visible = true; b3.Visible = false; b4.Visible = false; b5.Visible = false; } else if (state == "2") { b1.Visible = false; b2.Visible = false; b3.Visible = true; b4.Visible = false; b5.Visible = false; } else if (state == "3" || state == "4") { b1.Visible = false; b2.Visible = false; b3.Visible = false; b4.Visible = true; b5.Visible = false; } DataTable table = Oorder.getoneorder(lablepid.Text); list.DataSource = table; list.DataBind(); } }