protected void BtnReturnRental_ServerClick(object sender, EventArgs e)
 {
     SourceRentals.Delete();
     GvwRentals.DataBind();
     ScriptManager.RegisterStartupScript(BtnReturnRental, GetType(), "ReturnRentalModal",
                                         @"$('#ReturnRentalModal').modal('hide');", true);
 }
 protected void BtnConfirmAcceptRequest__ServerClick(object sender, EventArgs e)
 {
     SourceRequests.Insert();
     GvwRentals.DataBind();
     ScriptManager.RegisterStartupScript(BtnConfirmAcceptRequest_, GetType(), "ConfirmAcceptRequestModal",
                                         @"$('#ConfirmAcceptRequestModal').modal('hide');", true);
     ScriptManager.RegisterStartupScript(BtnConfirmAcceptRequest_, GetType(), "UpdateNotifModal",
                                         @"$('#UpdateNotifModal').modal('toggle');", true);
 }
 protected void BtnExtendRental_ServerClick(object sender, EventArgs e)
 {
     if (IsValid)
     {
         FvwRentalDetails.UpdateItem(true);
         GvwRentals.DataBind();
         ScriptManager.RegisterStartupScript(BtnExtendRental, GetType(), "ExtendRentalModal",
                                             @"$('#ExtendRentalModal').modal('hide');", true);
         ScriptManager.RegisterStartupScript(BtnExtendRental, GetType(), "UpdateNotifModal",
                                             @"$('#UpdateNotifModal').modal('toggle');", true);
     }
 }
        protected void BtnSearchRentalGrid_Click(object sender, EventArgs e)
        {
            if (TbxSearchRenters.Text != string.Empty)
            {
                string h_renter = CleanString(TbxSearchRenters.Text);
                SourceRentals.SelectCommand = "SELECT * FROM RentalDetails WHERE " +
                                              $"CONTAINS(accountOwner,'\"{h_renter}*\"') " +
                                              $"OR CONTAINS(title,'\"{h_renter}*\"') " +
                                              $"OR CONTAINS(fullName,'\"{h_renter}*\"') " +
                                              $"OR CONTAINS(ISBN,'\"{h_renter}*\"')";
            }

            GvwRentals.DataBind();
        }
        protected void BtnSearchRentalGrid_Click(object sender, EventArgs e)
        {
            if (TbxSearchRentalGrid.Text != string.Empty)
            {
                string h_borrower = CleanString(TbxSearchRentalGrid.Text);
                int    borrowerID = Convert.ToInt32(Session["bID"]);
                SourceRentals.SelectCommand = "SELECT * FROM RentalDetails WHERE (" +
                                              $"CONTAINS(title,'\"{h_borrower}*\"') " +
                                              $"OR CONTAINS(fullName,'\"{h_borrower}*\"') " +
                                              $"OR CONTAINS(ISBN,'\"{h_borrower}*\"')) " +
                                              $"AND borrowerID = {borrowerID}";
            }

            GvwRentals.DataBind();
        }