public ActionResult VerifyUser(SearchandUser checkUser)
 {
     try
     {
         var returnedCheckedList = new List <UserModel>();
         if (ModelState.IsValid)
         {
             var userRepository = new UserRepository();
             returnedCheckedList = userRepository.VerifyUser(checkUser.User);
             if (returnedCheckedList[0].AuthenticationId != 0)
             {
                 var profileData = new UserSession
                 {
                     UserID      = returnedCheckedList[0].UserId,
                     UserName    = returnedCheckedList[0].UserName,
                     Designation = returnedCheckedList[0].AuthenticationId
                 };
                 Session["UserProfile"] = profileData;
                 return(RedirectToAction("Dashboard"));
             }
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(RedirectToAction("Index"));
     }
 }
示例#2
0
        public ActionResult SearchAuthor(SearchandUser searchedAuthor)
        {
            AuthorRepository     authorRepository = new AuthorRepository();
            List <SearchandUser> authorList       = new List <SearchandUser>();

            authorList = authorRepository.searchAuthorByName(searchedAuthor.Author.AuthorName);
            return(View(authorList));
        }
        public ActionResult SearchPublication(SearchandUser searchedPublication)
        {
            PublicationRepository publicationRepository = new PublicationRepository();
            List <SearchandUser>  publicationList       = new List <SearchandUser>();

            publicationList = publicationRepository.searchPublisherByName(searchedPublication.Publication.PublicationName);
            return(View(publicationList));
        }
        public ActionResult SearchBook(SearchandUser searchedBook)
        {
            BookRepository       bookRepository  = new BookRepository();
            List <SearchandUser> publicationList = new List <SearchandUser>();

            publicationList = bookRepository.searchBookByName(searchedBook.Book.BookName);
            return(View(publicationList));
        }