コード例 #1
0
        public ActionResult Login(LoginViewModel lm)
        {
            model    = new Author();
            allModel = new AuthorAllModel();

            allModel.authorModel = model.login(lm.Email, lm.Password);

            if (ModelState.IsValid)
            {
                if (lm.Email.Equals(allModel.authorModel.email) && lm.Password.Equals(allModel.authorModel.password))
                {
                    Session["LogedUserID"]       = allModel.authorModel.userId;
                    Session["LogedUserFullname"] = allModel.authorModel.fullname;
                    return(RedirectToAction("MyProfile", "Author"));
                }
                else if (lm.Email.Equals(adEmail) && lm.Password.Equals(adPass))
                {
                    Session["LogedUserID"]       = adId;
                    Session["LogedUserFullname"] = adName;

                    return(RedirectToAction("Article", "Admin"));
                }
            }
            return(View(lm));
        }
コード例 #2
0
 public ActionResult Search(AuthorAllModel allModel)
 {
     if (allModel.searchAuthor.key != null)
     {
         Session["keywords"] = allModel.searchAuthor.key;
         return(RedirectToAction("SearchResult", "Home", new { key = allModel.searchAuthor.key }));
     }
     else
     {
         return(RedirectToAction("Index", "Home"));
     }
 }
コード例 #3
0
 public ActionResult MyProfile()
 {
     if (Session["LogedUserID"] != null)
     {
         model         = new Author();
         this.allModel = new AuthorAllModel();
         return(RedirectToAction("AuthorProfile", "Author", new { id = int.Parse(Session["LogedUserID"].ToString()) }));
     }
     else
     {
         return(RedirectToAction("Login", "Home"));
     }
 }
コード例 #4
0
        public ActionResult SearchResult(string key)
        {
            model                 = new Author();
            this.allModel         = new AuthorAllModel();
            allModel.searchAuthor = new SearchAuthor();

            if (key != null)
            {
                allModel.searchAuthor.authorList = model.authorList(key);
                allModel.searchAuthor.key        = key;
                return(View(allModel));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
コード例 #5
0
        public ActionResult AuthorProfile(int id)
        {
            if (id != 0)
            {
                model                = new Author();
                this.allModel        = new AuthorAllModel();
                allModel.authorModel = new AuthorModel();

                allModel.authorModel         = model.researcher(id);
                allModel.authorModel.artikel = model.articleList(id);
                allModel.authorModel.citasi  = model.citationList(id);
                return(View(allModel));
            }
            else
            {
                return(RedirectToAction("Login", "Home"));
            }
        }
コード例 #6
0
        public ActionResult Search(AuthorAllModel allModel)
        {
            string key = allModel.searchAuthor.key;

            return(RedirectToAction("SearchResult", "Home", new { key = key }));
        }