Example #1
0
        public ActionResult Login(Kullanici kullanici)
        {
            var kontrol = _kullaniciRepository.GetMany(x => x.Mail == kullanici.Mail && x.Sifre == kullanici.Sifre).SingleOrDefault();

            if (kontrol != null)
            {
                if (kontrol.Rol == 1 || kontrol.Rol == 2)
                {
                    Session["KullaniciEmail"] = kullanici.Mail;
                    Session["Rol"]            = kontrol.Rol;
                    return(RedirectToAction("Chat", "Chat"));
                }
                ViewBag.Mesaj = "Yetkiisiz Kullanıcı";
                return(View());
            }
            ViewBag.Mesaj = "Kullanıcı Bulunamadı";
            return(View());
        }