本文整理汇总了C#中Operation.Borrow方法的典型用法代码示例。如果您正苦于以下问题:C# Operation.Borrow方法的具体用法?C# Operation.Borrow怎么用?C# Operation.Borrow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operation
的用法示例。
在下文中一共展示了Operation.Borrow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GridView1_RowDeleting
//借书操作
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>");
}
}