protected void SaveBookCategoryButton_Click(object sender, EventArgs e)
        {
            BookCategoriesLogic bclogic = new BookCategoriesLogic();
            bool saveSuccess            = bclogic.AddBookCategory(BookCategoryName.Text);

            if (saveSuccess)
            {
                ReturnToSender();
            }
            else
            {
                FailureText.Text     = "Unable to add a new book category to database.";
                ErrorMessage.Visible = true;
            }
        }
示例#2
0
        protected void UpdateBookCategoryButton_Click(object sender, EventArgs e)
        {
            BookCategoriesLogic bclogic = new BookCategoriesLogic();
            bool saveSuccess            = bclogic.UpdateBookCategory(Convert.ToInt32(Request["id"]), BookCategoryName.Text);

            if (saveSuccess)
            {
                ReturnToSender();
            }
            else
            {
                FailureText.Text     = "Unable to update the book category.";
                ErrorMessage.Visible = true;
            }
        }