//建立页面 private void BuildView() { Clothes clothes = new Clothes(); NewID.Text = clothes.GetNewID().ToString(); DataTable data = null; TypeList type = new TypeList(); data = type.ReadAll(); TypeRadio.DataSource = data; TypeRadio.DataTextField = "name"; TypeRadio.DataValueField = "id"; TypeRadio.DataBind(); PlaceList place = new PlaceList(); data = place.ReadAll(); PlaceRadio.DataSource = data; PlaceRadio.DataTextField = "name"; PlaceRadio.DataValueField = "id"; PlaceRadio.DataBind(); }
protected void Change_Click(object sender, EventArgs e) { ConditionRadio.Visible = true; GradeRadio.Visible = true; PlaceRadio.Visible = true; TypeRadio.Visible = true; SeatText.Visible = true; DescribeText.Visible = true; Restore.Visible = true; Save.Visible = true; labelFileUpload.Visible = true; Delete.Visible = false; Return.Visible = false; Change.Visible = false; SeatLabel.Visible = false; DescribeLabel.Visible = false; TypeList type = new TypeList(); DataTable data = type.ReadAll(); TypeRadio.DataSource = data; TypeRadio.DataTextField = "name"; TypeRadio.DataValueField = "id"; TypeRadio.DataBind(); PlaceList place = new PlaceList(); data = place.ReadAll(); PlaceRadio.DataSource = data; PlaceRadio.DataTextField = "name"; PlaceRadio.DataValueField = "id"; PlaceRadio.DataBind(); //设置默认选择项 ConditionRadio.SelectedValue = ConditionLabel.ToolTip; GradeRadio.SelectedValue = GradeLabel.ToolTip; PlaceRadio.SelectedValue = PlaceLabe.ToolTip; TypeRadio.SelectedValue = TypeLabel.ToolTip; SeatText.Text = SeatLabel.Text; DescribeText.Value = DescribeLabel.Text; }