Esempio n. 1
0
        public ActionResult Index(HomeIndex formData)
        {
            table_user kayit = new table_user();
            string     kadi, parola;//pass;
            Boolean    dogrulama = false;

            if (!ModelState.IsValid)
            {
                return(View());
            }

            foreach (var err in db.table_user)
            {
                kadi   = err.kadi;
                parola = err.password;
                if (kadi == formData.kadi && parola == formData.parola)
                {
                    FormsAuthentication.SetAuthCookie(err.kadi, true);
                    Session.Add("Kullanici", err.kadi);
                    dogrulama = true;
                }
            }

            if (dogrulama)
            {
                return(RedirectToRoute("akis"));
                //Session.Add("Kullanici",)
                //return View("akis");
            }
            else
            {
                return(View());
            }
        }
Esempio n. 2
0
        public ActionResult Reg(RegisterReg model, RegisterReg formData)
        {
            table_user kayit = new table_user();

            kayit.kadi     = model.Kadi;
            kayit.password = model.Parola;
            kayit.email    = model.Email;
            kayit.name     = model.Name;
            kayit.surname  = model.Surname;
            kayit.telno    = model.Telno;

            db.table_user.Add(kayit);

            db.SaveChanges();

            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            return(View("olusturuldu"));
        }