public ActionResult Login(Models.Account.LoginModels model)
 {
     System.Diagnostics.Debug.WriteLine("login postt");
     try
     {
         var user = emlakDBEntities.Members.FirstOrDefault(x => x.Password == model.Member.Password && x.Email == model.Member.Email);
         if (user != null)
         {
             Session["LogonUser"] = user;
             System.Diagnostics.Debug.WriteLine("user.id = " + user.Id);
             return(RedirectToAction("index", "i"));
         }
         else
         {
             ViewBag.ReError = "Kullanici Bilgileriniz yanlış";
             return(View());
         }
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine("Catchhh");
         ViewBag.ReError = ex.Message;
         return(View());
     }
 }
Exemplo n.º 2
0
 public ActionResult Login(Models.Account.LoginModels model)
 {
     try
     {
         var user = context.Members.FirstOrDefault(x => x.Password == model.Member.Password && x.Email == model.Member.Email);
         if (user != null)
         {
             Session["LogonUser"] = user;
             return(RedirectToAction("index", "i"));
         }
         else
         {
             ViewBag.ReError = "Kullanici Bilgileriniz yanlış";
             return(View());
         }
     }
     catch (Exception ex)
     {
         ViewBag.ReError = ex.Message;
         return(View());
     }
 }
Exemplo n.º 3
0
 public ActionResult Login(Models.Account.LoginModels model)
 {
     try
     {
         var user = context.Members.FirstOrDefault((x => x.Email == model.Member.Email && x.Password == model.Member.Password));
         if (user != null)
         {
             Session["LogonUser"] = user;
             return(RedirectToAction("index", "i"));
         }
         else
         {
             ViewBag.ReError = "Kullanici bilgileriniz yanlis."; //Giris bilgileri yanlissa ekrana basilacak
             return(View());
         }
     }
     catch (Exception ex)
     {
         ViewBag.ReError = "Kullanici bilgileriniz yanlis."; //Giris bilgileri yanlissa ekrana basilacak
         return(View());
     }
 }