Example #1
0
        /// <summary>
        /// Method for updating the category name of specified category
        /// </summary>
        /// <param name="admin">Takes a user with admin priviliges</param>
        /// <param name="bookCategory">Takes a book category to be updated</param>
        private static void UpdateCategory(User admin, BookCategory bookCategory)
        {
            AdminView.UpdateCategory(bookCategory.Name);
            var input = SharedController.GetSearchInput();

            if (SharedController.CheckIfNullOrEmptyOrWhiteSpace(input))
            {
                SharedError.UnChanged();
            }
            else
            {
                if (api.UpdateCategory(admin.Id, bookCategory.Id, input))
                {
                    SharedError.Success();
                }
                else
                {
                    SharedError.Failed();
                }
            }
        }