Esempio n. 1
0
        public ActionResult Giris(GirisModel model)
        {
            string message      = "";
            string errormessage = "";
            var    user         = db.tblMusteri.Where(i => i.musteriTCKN == model.TCKN).FirstOrDefault();

            if (user != null)
            {
                if (string.Compare(Crypto.Hash(model.Sifre), user.musteriSifre) == 0)
                {
                    FormsAuthentication.SetAuthCookie(model.TCKN.ToString(), false);
                    ViewBag.message                = message;
                    Session["musteriFullName"]     = user.musteriAd + " " + user.musteriSoyAd;
                    Session["musteriHesapNo"]      = user.musteriNumarası;
                    Session["musteriId"]           = user.musteriId;
                    Session["musteriKimlikNumara"] = user.musteriTCKN;
                    return(RedirectToAction("Anasayfa", "Home"));
                }
                else
                {
                    errormessage         = "Şifre veya Kimlik Numarasi Hatali";
                    ViewBag.errormessage = errormessage;
                }
            }
            else
            {
                errormessage         = "Hatali Giriş";
                ViewBag.errormessage = errormessage;
            }


            return(View(model));
        }
Esempio n. 2
0
        public ActionResult Giris(GirisModel model, string returnUrl)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (Membership.ValidateUser(model.KullaniciAdi, model.Sifre))
                    {
                        AlisverisListesiniTasi(model.KullaniciAdi);

                        FormsAuthentication.SetAuthCookie(model.KullaniciAdi, model.BeniHatirla);
                        if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/") &&
                            !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
                        {
                            return(Redirect(returnUrl));
                        }
                        else
                        {
                            return(RedirectToAction("Index", "AnaSayfa"));
                        }
                    }
                    else
                    {
                        ModelState.AddModelError("", "Kullanıcı Adınız veya Şifreniz Hatalı.");
                    }
                }
            }
            catch (Exception ex)
            {
            }
            // If we got this far, something failed, redisplay form
            return(View(model));
        }
        public ActionResult Index(GirisModel model)
        {
            using (ServisNoktasi servis = new ServisNoktasi())
            {
                if (ModelState.IsValid)
                {
                    Yonetici yonetici = new Yonetici();
                    yonetici.KullaniciAdi = model.KullaniciAdi;
                    yonetici.Sifre        = model.Sifre;
                    IslemSonucu sonuc = servis.Yonetici.GirisYap(yonetici);
                    if (!sonuc.BasariliMi)
                    {
                        ModelState.AddModelError("HataliGiris", sonuc.Mesaj);
                        return(View());
                    }
                    string userInfo = String.Format("admin;{0};{1}", yonetici.Id, yonetici.KullaniciAdi);
                    FormsAuthentication.SetAuthCookie(userInfo, true);

                    var routeValues = TempData["yonlendirmeDegerleri"];
                    if (routeValues != null)
                    {
                        RouteValueDictionary values = (RouteValueDictionary)routeValues;
                        string action     = values["action"].ToString();
                        string controller = values["controller"].ToString();
                        return(RedirectToAction(action, controller, values));
                    }
                    return(RedirectToAction("Index", "YoneticiAnasayfa"));
                }
                return(View());
            }
        }
        private Kullanici KullaniciGetir(GirisModel model)
        {
            var pass = CryptoTool.EnCryptoPass(model.Sifre);
            IQueryable <Kullanici> query = _queryable.Table;

            return(query.Include(s => s.KullaniciRolleri.Select(w => w.Rol)).FirstOrDefault(s =>
                                                                                            s.KullaniciAdi == model.KullaniciAdi && s.KullaniciSifreleri.Any(e => e.Sifre == pass && !s.Silindi) && !s.Silindi));
        }
Esempio n. 5
0
 public void YetPersonelEkle(GirisModel giris)
 {
     SqlBaglanti.sqlBaglantiAc();
     SqlBaglanti.cmd.CommandText = "INSERT INTO tblGiris(Kullanici_Adi,Sifre,Kullanici_Tipi,Personel_No) VALUES(@Kullanici_Adi,@Sifre,@Kullanici_Tipi,@Personel_No)";
     SqlBaglanti.cmd.Parameters.AddWithValue("@Kullanici_Adi", giris.Kullanici_Adi);
     SqlBaglanti.cmd.Parameters.AddWithValue("@Sifre", giris.Sifre);
     SqlBaglanti.cmd.Parameters.AddWithValue("@Kullanici_Tipi", giris.Kullanici_Tipi);
     SqlBaglanti.cmd.Parameters.AddWithValue("Personel_No", giris.Personel_No);
     SqlBaglanti.sqlBaglantiKapat();
 }
        private void btnYetPerKaydet_Click(object sender, EventArgs e)
        {
            PersonelF  F1    = new PersonelF();
            GirisModel giris = new GirisModel();

            giris.Kullanici_Adi  = txtKullaniciAdi.Text;
            giris.Sifre          = txtSifre.Text;
            giris.Kullanici_Tipi = txtKullaniciTipi.Text;
            giris.Personel_No    = Convert.ToInt32(txtPersonelNo.Text);
            F1.YetPersonelEkle(giris);
            XtraMessageBox.Show("Kayıt Tamamlandı", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Esempio n. 7
0
 public JsonResult Index(GirisModel girisYap)
 {
     if (db.UsersAccounts.Where(x => x.user_account_name == girisYap.KADI).FirstOrDefault() != null)
     {
         if (db.UsersAccounts.Where(x => x.user_account_name == girisYap.KADI).FirstOrDefault().user_passwd == girisYap.PASS)
         {
             var sessionAl = db.UsersAccounts.Where(x => x.user_account_name == girisYap.KADI).FirstOrDefault().user_id;
             Session["OturumID"] = sessionAl;
             return(Json("1"));
         }
         else
         {
             return(Json("2"));
         }
     }
     return(Json("2"));
 }
        public ActionResult Login(GirisModel login)
        {
            if (login.thisNull)
            {
                ViewBag.hata = "Boş Değer Girmeyiniz";
                return(RedirectToAction("Login", "Account"));
            }

            if (login.kullaniciAdi == "akif" && login.password == "akif")
            {
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                ViewBag.hata = "Yanlış Bilgi";
                return(RedirectToAction("Login", "Account"));
            }
        }
        public DataResponse GirisYap(GirisModel model)
        {
            var kullanici = KullaniciGetir(model);

            if (kullanici == null)
            {
                return new DataResponse
                       {
                           Tamamlandi = false,
                           Mesaj      = "kullanıcı Adı veya şifre hatalı",
                       }
            }
            ;
            CreateTicket(kullanici);
            return(new DataResponse
            {
                Mesaj = "Merhaba " + kullanici.KullaniciAdi.ToUpper() + " !!!",
                Tamamlandi = true,
            });
        }
Esempio n. 10
0
        public ActionResult GirisYap(GirisModel model, string ReturnUrl)
        {
            if (ModelState.IsValid && kullaniciServis.KullaniciDogrula(model.Eposta, model.Sifre))
            {
                var kullanici = kullaniciServis.Bul(model.Eposta);
                if (!kullanici.Onayli)
                {
                    TempData["epostaOnayMesaj"] = "E-posta adresiniz onaylı değildir. Lütfen e-posta adresinizdeki linki kullanarak e-posta adresinizi onaylayınız.";

                    return(View());
                }
                FormsAuthentication.SetAuthCookie(model.Eposta, model.BeniHatirla);
                return(RedirectToLocal(ReturnUrl));
            }
            else
            {
                ModelState.AddModelError("", "Kullanıcı adı ve ya şifre geçersiz!");
            }

            return(View(model));
        }
 // POST api/<controller>
 public UyeModel Post(GirisModel bilgiler)
 {
     return(islem.girisyap(bilgiler.mail, bilgiler.sifre));
 }