Beispiel #1
0
        public ActionResult adminlogin1(Adminviewmodel adim)
        {
            AdminRepositor rept  = new AdminRepositor();
            bool           check = rept.login(adim);

            if (check)
            {
                return(Json("success", JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("error", JsonRequestBehavior.AllowGet));
            }
        }
Beispiel #2
0
        public bool login(Adminviewmodel adim)
        {
            Class_studentEntities dd = new Class_studentEntities();

            if (adim != null)
            {
                var old = dd.Admins.FirstOrDefault(x => x.name == adim.name && x.password == adim.password);
                if (old != null)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }