protected void DeleteBtn_Click(object sender, EventArgs e) { Button btn = (Button)sender; string borrowingID = btn.CommandArgument.ToString(); BorrowingsLogic bl = new BorrowingsLogic(); bool savedChanges = bl.DeleteBorrowing(Convert.ToInt32(borrowingID)); if (savedChanges) { Response.Redirect("AdminBorrowings"); } }
protected void SaveBorrowingButton_Click(object sender, EventArgs e) { BorrowingsLogic bl = new BorrowingsLogic(); bool saveSuccess = bl.AddBorrowing(GetMemberID(), GetBookID(), FromDate.Text); if (saveSuccess) { ReturnToSender(); } else { FailureText.Text = "Unable to add the borrowing to database."; ErrorMessage.Visible = true; } }
protected void ReturnBorrowingButton_Click(object sender, EventArgs e) { BorrowingsLogic bl = new BorrowingsLogic(); bool saveSuccess = bl.ReturnBorrowing(Convert.ToInt32(Request["id"]), ToDate.Text); if (saveSuccess) { ReturnToSender(); } else { FailureText.Text = "Unable to return the borrowing."; ErrorMessage.Visible = true; } }