Esempio n. 1
0
        public JsonResult KullaniciGiris(Kullanici kullanici)
        {
            IslemSonucModel islemSonucu;

            try
            {
                var _kullanici = _kullaniciService.KullaniciGiris(kullanici.KullaniciKodu, kullanici.Parola);
                if (_kullanici != null)
                {
                    //FormsAuthentication.SetAuthCookie("KullaniciId", false);
                    Session["KullaniciId"]  = _kullanici.KullaniciID;
                    Session["KullaniciAdi"] = _kullanici.KullaniciAdi + " " + _kullanici.KullaniciSoyadi;

                    islemSonucu = new IslemSonucModel(IslemSonucKodlari.Basarili, "Kullanici Giris Basarili");
                }
                else
                {
                    islemSonucu = new IslemSonucModel(IslemSonucKodlari.Uyari, "Kullanici Giris Basarisiz");
                }
            }
            catch (System.Exception error)
            {
                islemSonucu = new IslemSonucModel(IslemSonucKodlari.Hata, "Kullanıcı Giriş Kontrol Sırasında Hata Oluştu." + error.Message);
            }

            return(Json(islemSonucu));
        }
Esempio n. 2
0
        public JsonResult KullaniciGiris(Uye kullanici)
        {
            IslemSonucModel islemSonucu;

            try
            {
                var _kullanici = _uyeService.KullaniciGiris(kullanici.KullaniciAdi, kullanici.Sifre);
                if (_kullanici != null)
                {
                    FormsAuthentication.SetAuthCookie("KullaniciId", false);
                    Session["KullaniciId"]  = _kullanici.UyeId;
                    Session["KullaniciAdi"] = _kullanici.KullaniciAdi;
                    islemSonucu             = new IslemSonucModel(IslemSonucKodlari.Basarili, "Kullanıcı Giriş Başarılı");
                }
                else
                {
                    islemSonucu = new IslemSonucModel(IslemSonucKodlari.Uyari, "Kullanıcı Giriş Başarısız");
                }
            }
            catch (System.Exception error)
            {
                islemSonucu = new IslemSonucModel(IslemSonucKodlari.Hata, "Kullanıcı Giriş Kontrol Sırasında Hata Oluştu." + error.Message);
            }

            return(Json(islemSonucu));
        }
Esempio n. 3
0
        public JsonResult SignIn(User user)
        {
            IslemSonucModel islemSonucu;

            try
            {
                var _user = _userService.userLogin(user.EMail, user.Password);
                if (_user != null)
                {
                    Session["UserId"]   = _user.Id;
                    Session["UserName"] = _user.Name + " " + _user.SurName;
                    Session["RolId"]    = _user.RoleID;
                    //ViewBag.RolID = _user.RolID;
                    islemSonucu = new IslemSonucModel(IslemSonucKodlari.Basarili, "Kullanıcı Girişi Başarılı");
                }
                else
                {
                    islemSonucu = new IslemSonucModel(IslemSonucKodlari.Uyari, "Kullanıcı Girişi Başarısız");
                }
            }
            catch (Exception)
            {
                islemSonucu = new IslemSonucModel(IslemSonucKodlari.Hata, "Kullanıcı Giriş Kontrol Sırasında Hata Oluştu.");
            }
            return(Json(islemSonucu));
        }