예제 #1
0
        // GET: Login
        public ActionResult Index(AdminTbl p)
        {
            DbCvEntities db    = new DbCvEntities();
            var          bilgi = db.AdminTbl.FirstOrDefault(x => x.KullaniciAdi == p.KullaniciAdi && x.Sifre == p.Sifre);

            if (bilgi != null)
            {
                FormsAuthentication.SetAuthCookie(bilgi.KullaniciAdi, false);
                Session["KullaniciAdi"] = bilgi.KullaniciAdi.ToString();
                return(RedirectToAction("DeneyimListele", "Deneyim"));
            }
            else
            {
                return(View("Index"));
            }
        }
예제 #2
0
        public ActionResult Index(Admin admin)
        {
            DbCvEntities db        = new DbCvEntities();
            var          loginData = db.Admin.FirstOrDefault(x => x.UserName == admin.UserName && x.Password == admin.Password);

            if (loginData != null)
            {
                FormsAuthentication.SetAuthCookie(loginData.UserName, false);
                Session["UserName"] = loginData.UserName.ToString();
                return(RedirectToAction("Index", "About"));
            }
            else
            {
                return(RedirectToAction("Index", "Login"));
            }
        }
예제 #3
0
        public ActionResult Index(admin p)
        {
            DbCvEntities db   = new DbCvEntities();
            var          info = db.admin.FirstOrDefault(x => x.kullaniciadi == p.kullaniciadi && x.sifre == p.sifre);


            if (info != null)
            {
                FormsAuthentication.SetAuthCookie(info.kullaniciadi, false);
                Session["kullaniciadi"] = info.kullaniciadi.ToString();
                return(RedirectToAction("Index", "Admin"));
            }

            else
            {
                return(RedirectToAction("Index", "Login"));
            }
        }