protected void DDMachineFather_Load(object sender, EventArgs e) { if (!IsPostBack) { DDMachineFather.Items.Clear(); DDMachineSon.Items.Clear(); DDMachineFather.Items.Add("请选择"); DDMachineSon.Items.Add("请选择"); DDMachineFather.DataSource = MachineFather_Bll.GetList(""); DDMachineFather.DataTextField = "MachineFatherName"; DDMachineFather.DataValueField = "MachineFatherID"; DDMachineFather.DataBind(); DDMachineSon.DataSource = MachineSon_Bll.GetList(" MachineFatherID ='" + DDMachineFather.SelectedValue + "' "); DDMachineSon.DataTextField = "MachineSonName"; DDMachineSon.DataValueField = "MachineSonID"; DDMachineSon.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!String.IsNullOrEmpty(Request.QueryString["ID"])) { Maticsoft.Model.Declaration modelDeclaration = Declaration_Bll.GetModel(Request.QueryString["ID"].ToString());; //引用id所在行的数据 DDMachineFather.Items.Clear(); DDMachineSon.Items.Clear(); DDMachineFather.Items.Add("请选择"); DDMachineSon.Items.Add("请选择"); DDMachineFather.DataSource = MachineFather_Bll.GetList(""); DDMachineFather.DataTextField = "MachineFatherName"; DDMachineFather.DataValueField = "MachineFatherID"; DDMachineFather.DataBind(); DDMachineFather.SelectedValue = modelDeclaration.MachineFatherType; DDMachineSon.DataSource = MachineSon_Bll.GetList(" MachineFatherID ='" + DDMachineFather.SelectedValue + "' "); DDMachineSon.DataTextField = "MachineSonName"; DDMachineSon.DataValueField = "MachineSonID"; DDMachineSon.DataBind(); DDMachineSon.SelectedValue = modelDeclaration.MachineSonType; TextBox1.Text = modelDeclaration.MachineName; //添加数据 TextBox2.Text = modelDeclaration.AssetsID; //添加数据 TextBox3.Text = modelDeclaration.Model; if (modelDeclaration.OtherPart != "") { aDown.Visible = true; aDown.HRef = modelDeclaration.OtherPart;//添加数据 } if (modelDeclaration.ReplacementUse == "是") { RadioButton1.Checked = true; } else { RadioButton2.Checked = true; } //DDUnitName.DataSource = UnitsInfo_Bll.GetList(""); //DDUnitName.DataTextField = "UnitName"; //DDUnitName.DataValueField = "UnitID"; //DDUnitName.DataBind(); //DDUnitName.SelectedItem.Text = modelDeclaration.UnitName; TextBox5.Text = modelDeclaration.Contact; TextBox6.Text = modelDeclaration.ContactPhone; if (modelDeclaration.DoorServer == "是") { RadioButton3.Checked = true; } else { RadioButton4.Checked = true; } myEditor.Value = modelDeclaration.BreakDown; string st = modelDeclaration.CCC5; string[] sop = st.Split(';'); ImgList.Clear(); for (int i = 0; i < sop.Length - 1; i++) //修改图片显示 { ImgModel img = new ImgModel(); img.ID = ImgList.Count + 1; img.imgUrl = sop[i]; ImgList.Add(img); RadListView1.Rebind(); } } else { Response.Redirect("RepairBX.aspx"); } } }