/*protected void GVinformation_RowUpdating(object sender, GridViewUpdateEventArgs e) * { * string stockno = GVinformation.DataKeys[e.RowIndex].Value.ToString().Trim(); * string name = ((TextBox)(GVinformation.Rows[e.RowIndex].Cells[1].Controls[0])).Text.Trim(); * string price = ((TextBox)(GVinformation.Rows[e.RowIndex].Cells[2].Controls[0])).Text.Trim(); * string count = ((TextBox)(GVinformation.Rows[e.RowIndex].Cells[3].Controls[0])).Text.Trim(); * string source = ((TextBox)(GVinformation.Rows[e.RowIndex].Cells[4].Controls[0])).Text.Trim(); * string totalprice = ((TextBox)(GVinformation.Rows[e.RowIndex].Cells[5].Controls[0])).Text.Trim(); * string employees = ((TextBox)(GVinformation.Rows[e.RowIndex].Cells[6].Controls[0])).Text.Trim(); * string date = ((TextBox)(GVinformation.Rows[e.RowIndex].Cells[7].Controls[0])).Text.Trim(); * string realpay = ((TextBox)(GVinformation.Rows[e.RowIndex].Cells[8].Controls[0])).Text.Trim(); * users us = new users(); * us.stockno = stockno; * us.name = name; * us.price = price; * us.count = count; * us.source = source; * us.totalprice = totalprice; * us.employees = employees; * us.date = date; * us.realpay = realpay; * * } */ protected void btnAdd_Click(object sender, EventArgs e) { string stockno = txtJHid.Text.Trim(); string name = txtJHname.Text.Trim(); string price = txtJHprice.Text.Trim(); string count = txtJHcount.Text.Trim(); string source = TXTJHsource.Text.Trim(); string totalprice = txtJHtotalprice.Text.Trim(); string employees = TXTJHemployees.Text.Trim(); string date = txtJHdate.Text.Trim(); string realpay = txtJHrealpay.Text.Trim(); users us = new users(); us.stockno = stockno; us.name = name; us.price = price; us.count = count; us.source = source; us.totalprice = totalprice; us.employees = employees; us.date = date; us.realpay = realpay; int result = us.Addgoods_infor(us); if (result > 0) { Response.Write("<script>alert(\"添加信息成功!\")</script>"); Binddate(); } }