Ejemplo n.º 1
0
 public ActionResult login(string phone, string pass)
 {
     if (!string.IsNullOrEmpty(pass) && !string.IsNullOrEmpty(phone))
     {
         DAL.EntityFramework.Tables.Musteriler
             result
             = _cari.Login(phone, _hash.Create(pass));
         if (result == null)
         {
             TempData["hata"] = "0";
             return(RedirectToAction("login", "account"));
         }
         else
         {
             FormsAuthentication.SetAuthCookie(result.Id.ToString(), false);
             _hareket.Insert(new MusteriGirisHareketleri()
             {
                 IslemTarihi        = DateTime.Now,
                 Islem              = HareketTipleri.Giris,
                 IslemAciklama      = "Giriş yaptınız.",
                 MusteriId          = result.Id,
                 CihazIp            = _client.GetClientIp(),
                 CihazBrowserAnonId = _client.GetClientAnonId(),
                 CihazBrowser       = _client.GetBrowser(_client.GetUserAgent(), _client.GetVersion())
             });
             return(RedirectToAction("index", "home"));
         }
     }
     return(View());
 }
Ejemplo n.º 2
0
        public PartialViewResult _profileView()
        {
            Guid _id = getLoginUserId();

            if (_id == Guid.Empty)
            {
                return(PartialView(null));
            }
            DAL.EntityFramework.Tables.Musteriler
                cari
                = _cari.Find(id: _id);
            return(PartialView(cari));
        }