//借书操作 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { DataKey keys = GridView1.DataKeys[e.RowIndex]; string psid = keys.Value.ToString(); Operation op = new Operation(); //达到最大借阅量,借阅失败 string employeeName = op.PSIDToName(psid); if(!op.Borrow(psid,Session["BID"].ToString())) { if (Session["lang"].ToString() == "zh-cn") Response.Write("<script>alert('借阅失败!" + employeeName + " 已经达到最大借阅量!');window.location.href='./Query_employee.aspx'</script>"); else Response.Write("<script>alert('Borrow failed!"+employeeName+" already reach the MaxBorrowNumber!');window.location.href='./Query_employee.aspx'</script>"); } //借阅成功 else { if (Session["lang"].ToString() == "zh-cn") Response.Write("<script>alert('借阅成功!" + employeeName + " 还可以继续借阅 " + op.CanBorrowNum(psid) + " books.');window.location.href='./Query_employee.aspx'</script>"); else Response.Write("<script>alert('Borrow success!" + employeeName + " still can borrow " + op.CanBorrowNum(psid) + " books.');window.location.href='./Query_employee.aspx'</script>"); } }