//GET : /Author/List
        public ActionResult List(string SearchKey = null)
        {
            AuthorDataController controller = new AuthorDataController();
            IEnumerable <Author> Authors    = controller.ListAuthors(SearchKey);

            return(View(Authors));
        }
        //GET : /Author/List
        public ActionResult List()
        {
            AuthorDataController controller = new AuthorDataController();
            IEnumerable <Author> Authors    = controller.ListAuthors();

            return(View(Authors));
        }
        public ActionResult Delete(int id)
        {
            AuthorDataController controller = new AuthorDataController();

            controller.DeleteAuthor(id);
            return(RedirectToAction("List"));
        }
        public ActionResult Ajax_Update(int id)
        {
            AuthorDataController controller = new AuthorDataController();
            Author SelectedAuthor           = controller.FindAuthor(id);

            return(View(SelectedAuthor));
        }
        //GET: /Author/DeleteConfirm/{id}
        public ActionResult DeleteConfirm(int id)
        {
            AuthorDataController controller = new AuthorDataController();
            Author NewAuthor = controller.FindAuthor(id);

            return(View(NewAuthor));
        }
        public ActionResult Update(int id, string AuthorFname, string AuthorLname, string AuthorBio, string AuthorEmail)
        {
            Author AuthorInfo = new Author();

            AuthorInfo.AuthorFname = AuthorFname;
            AuthorInfo.AuthorLname = AuthorLname;
            AuthorInfo.AuthorBio   = AuthorBio;
            AuthorInfo.AuthorEmail = AuthorEmail;

            AuthorDataController controller = new AuthorDataController();

            controller.UpdateAuthor(id, AuthorInfo);

            return(RedirectToAction("Show/" + id));
        }
        public ActionResult Create(string AuthorFname, string AuthorLname, string AuthorBio, string AuthorEmail)
        {
            //Identify that this method is running
            //Identify the inputs provided from the form

            Debug.WriteLine("I have accessed the Create Method!");
            Debug.WriteLine(AuthorFname);
            Debug.WriteLine(AuthorLname);
            Debug.WriteLine(AuthorBio);

            Author NewAuthor = new Author();

            NewAuthor.AuthorFname = AuthorFname;
            NewAuthor.AuthorLname = AuthorLname;
            NewAuthor.AuthorBio   = AuthorBio;
            NewAuthor.AuthorEmail = AuthorEmail;

            AuthorDataController controller = new AuthorDataController();

            controller.AddAuthor(NewAuthor);

            return(RedirectToAction("List"));
        }