protected void BtnDeleteBook_ServerClick(object sender, EventArgs e)
 {
     SourceBookEdit.Delete();
     GrdBooks.DataBind();
     GrdLibraryIndex.DataBind();
     ScriptManager.RegisterStartupScript(BtnDeleteBook, GetType(), "DeleteBookModal",
                                         @"$('#DeleteBookModal').modal('hide');", true);
 }
 protected void FvBtnUpdateCallNum_ServerClick(object sender, EventArgs e)
 {
     if (IsValid)
     {
         FvwLibIndex.UpdateItem(true);
         GrdLibraryIndex.DataBind();
         ScriptManager.RegisterStartupScript(BtnDeleteBook, GetType(), "EditLibIndexModal",
                                             @"$('#EditLibIndexModal').modal('hide');", true);
         ScriptManager.RegisterStartupScript(FvBtnUpdateCallNum, GetType(), "UpdateNotifModal",
                                             @"$('#UpdateNotifModal').modal('toggle');", true);
     }
 }
        protected void BtnDeleteAuthor_ServerClick(object sender, EventArgs e)
        {
            SourceAuthorEdit.Delete();
            GrdAuthors.DataBind();
            GrdBooks.DataBind();
            GrdLibraryIndex.DataBind();

            DrpAuthors.Items.Clear();
            DrpAuthors.DataBind();
            ScriptManager.RegisterStartupScript(BtnDeleteAuthor, GetType(), "DeleteAuthorModal",
                                                @"$('#DeleteAuthorModal').modal('hide');", true);
        }
        protected void BtnSearchIdxGrid_Click(object sender, EventArgs e)
        {
            if (TbxSearchIdx.Text != string.Empty)
            {
                string h_title = CleanString(TbxSearchIdx.Text);
                SourceLibrary.SelectCommand = "SELECT * FROM LibraryIndexNamed WHERE title IN " +
                                              $"(SELECT title FROM BookDisplay WHERE CONTAINS(title,'\"{h_title}*\"')) OR " +
                                              $"fullName IN (SELECT author FROM BookDisplay WHERE CONTAINS(author,'\"{h_title}*\"')) OR " +
                                              $"genre IN (SELECT genre FROM BookDisplay WHERE CONTAINS(genre, '\"{h_title}*\"'))";
            }

            GrdLibraryIndex.DataBind();
        }
 protected void BtnEditBook_ServerClick(object sender, EventArgs e)
 {
     if (IsValid)
     {
         Books.UpdateItem(true);
         GrdBooks.DataBind();
         GrdLibraryIndex.DataBind();
         ScriptManager.RegisterStartupScript(BtnEditBook, GetType(), "EditBookModal",
                                             @"$('#EditBookModal').modal('hide');", true);
         ScriptManager.RegisterStartupScript(BtnEditBook, GetType(), "UpdateNotifModal",
                                             @"$('#UpdateNotifModal').modal('toggle');", true);
     }
 }
        protected void BtnDeletePub_ServerClick(object sender, EventArgs e)
        {
            if (IsValid)
            {
                SourcePublisherEdit.Delete();
                GrdPublishers.DataBind();
                GrdBooks.DataBind();
                GrdLibraryIndex.DataBind();

                DrpPublishers.Items.Clear();
                DrpPublishers.DataBind();
                ScriptManager.RegisterStartupScript(BtnDeletePub, GetType(), "DeletePublisher",
                                                    @"$('#DeletePublisher').modal('hide');", true);
            }
        }
        protected void FvBtnUpdatePub_ServerClick(object sender, EventArgs e)
        {
            if (IsValid)
            {
                FormView1.UpdateItem(true);
                GrdPublishers.DataBind();
                GrdBooks.DataBind();
                GrdLibraryIndex.DataBind();

                DrpPublishers.Items.Clear();
                DrpPublishers.DataBind();
                ScriptManager.RegisterStartupScript(FvBtnUpdatePub, GetType(), "EditAuthorModal",
                                                    @"$('#EditPublisherModal').modal('hide');", true);
                ScriptManager.RegisterStartupScript(FvBtnUpdatePub, GetType(), "UpdateNotifModal",
                                                    @"$('#UpdateNotifModal').modal('toggle');", true);
            }
        }
 protected void BtnAddBook_ServerClick(object sender, EventArgs e)
 {
     ReqValPositive.Validate();
     ReqValNonExistentTitle.Validate();
     if (IsValid)
     {
         TbxTitle.Text = TbxTitle.Text.Replace("''''''''", "''''''''''''");
         SourceBooks.Insert();
         TbxTitle.Text    = "";
         TbxISBN.Text     = "";
         TbxEdition.Text  = "1";
         TbxPubYearA.Text = DateTime.Now.Year.ToString();
         TbxQuantity.Text = "1";
         GrdBooks.DataBind();
         GrdLibraryIndex.DataBind();
         ScriptManager.RegisterStartupScript(BtnAddBook, GetType(), "AddBookModal",
                                             @"$('#AddBookModal').modal('hide');", true);
         ScriptManager.RegisterStartupScript(BtnAddBook, GetType(), "AdditionNotifModal",
                                             @"$('#AdditionNotifModal').modal('toggle');", true);
     }
 }