protected void Button1_Click(object sender, EventArgs e) { string name = this.TextBox1.Text; string type = this.DropDownList1.SelectedItem.Text; this.Repeater1.DataSource = BorrowManger.select(name, type); this.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.DropDownList1.Items.Insert(0, "---请选择---"); } this.Repeater1.DataSource = BorrowManger.select(); this.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { Borrow br = new Borrow(); if (this.DropDownList1.SelectedItem.Text == "电脑") { br.SheBeiID = 1; } if (this.DropDownList1.SelectedItem.Text == "手机") { br.SheBeiID = 2; } if (this.DropDownList1.SelectedItem.Text == "自行车") { br.SheBeiID = 3; } if (this.DropDownList1.SelectedItem.Text == "小汽车") { br.SheBeiID = 4; } if (this.DropDownList2.SelectedItem.Text == "常用类") { br.TypeID = 1; } if (this.DropDownList2.SelectedItem.Text == "普通类") { br.TypeID = 2; } if (this.DropDownList2.SelectedItem.Text == "其他类") { br.TypeID = 3; } br.Borrower = this.TextBox1.Text; br.BorrowDepartment = this.TextBox2.Text; br.BorrowData = this.TextBox3.Text; br.BorrowTime = this.TextBox4.Text; if (BorrowManger.insert(br)) { ClientScript.RegisterStartupScript(this.GetType(), "loginSucess", "<script>alert('借出成功! ')</script>"); } }