protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { string cmd = e.CommandName; long rid = Convert.ToInt64(e.CommandArgument); //重新分配 if (cmd == "edlinfo") { //根据面单号查看购买中是否购买过此面单 int cnt = rm.IsBuy(rid); if (cnt > 0) { //如果购买了,则跳转到面单分配表中重新分配 Response.Redirect("~/FaxeList/DisNoteTB.aspx?rid=" + rid); } else { //如果没有购买,则不需要重新分配 Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('该面单号不属于本公司!')</script>"); } } GridView1.DataSource = csm.GetInfoBycount(); GridView1.DataBind(); }