protected void drop_carno_SelectedIndexChanged(object sender, EventArgs e) { string carid = drop_carno.SelectedValue; BLL.Car.Car car = new BLL.Car.Car(); DataSet dscar = car.Query("", carid); if (dscar.Tables[0].Rows.Count > 0) { lbl_num.Text = dscar.Tables[0].Rows[0]["num"].ToString(); } else { lbl_num.Text = ""; } }
private void CreateCarChildNodes(TreeNode tnParentNode, int NodeId) { BLL.Car.Car car = new BLL.Car.Car(); DataSet ds = car.Query("", ""); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { TreeNode tnChild = new TreeNode(); tnChild.Text = ds.Tables[0].Rows[i]["carid"].ToString(); tnChild.NavigateUrl = ds.Tables[0].Rows[i]["URL"].ToString() + "?key='" + ds.Tables[0].Rows[i]["id"].ToString() + "'"; tnChild.Expanded = true; tnParentNode.ChildNodes.Add(tnChild); CreateChildNodes(tnChild, Int16.Parse(ds.Tables[0].Rows[i]["id"].ToString())); } ds.Dispose(); }
private void CleanAllText()//清空详细页面中所有的TextBox { lbl_num.Text = ""; txt_destn.Text = ""; txt_start.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"); txt_start.Text = ""; txt_end.Attributes.Add("OnFocus", "javascript:WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"); txt_end.Text = ""; txt_remark.Text = ""; BLL.Car.Car car = new BLL.Car.Car(); DataSet dscar = car.Query("", ""); drop_carno.DataSource = dscar; drop_carno.DataValueField = "carid"; drop_carno.DataTextField = "carid"; drop_carno.DataBind(); ListItem li = new ListItem("请选择", "-1"); drop_carno.Items.Add(li); drop_carno.SelectedValue = "-1"; }