Пример #1
0
        public ActionResult Create2(Uye uye, byte Plaka)
        {
            ViewBag.SehirId = new SelectList(db.Sehirs, "Plaka", "Sehir1");
            if (ModelState.IsValid)
            {
                uye.Tip = 2;
                uye.Sehir =Plaka;
                db.Uyes.Add(uye);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(uye);
        }
Пример #2
0
        public ActionResult Login2(Uye uye)
        {
            string mail = uye.Mail;
            string sifre = uye.Sifre;

            var user1 = (from u in db.Uyes where u.Mail == mail select u).FirstOrDefault();
            if (user1 != null && (user1.Mail == mail && user1.Sifre == sifre))
            {
                FormsAuthentication.SetAuthCookie(mail, true);

                return RedirectToAction("Index", "Home");
            }
            else
            {
                ModelState.AddModelError("", " Mail veya şifre hatalı!");
            }
            return View(uye);
        }