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()); }
public ActionResult create(Guid yemekid) { Siparisler model = new Siparisler(); model.YemekId = yemekid; model.Yemek = _yemek.Find(yemekid); model.Id = Guid.NewGuid(); Guid musteriId = getLoginUserId(); if (musteriId == Guid.Empty) { return(null); } model.MusteriId = musteriId; model.Musteri = _cari.Find(musteriId); model.SiparisDurum = SiparisDurumu.Onay; model.SiparisTarihi = DateTime.Now; model.YemekSayisi = model.Musteri.GunlukYemekSayisi; _hareket.Insert(new MusteriGirisHareketleri() { IslemTarihi = DateTime.Now, Islem = HareketTipleri.Siparis, IslemAciklama = $"{model.Yemek.YemekAdi} yemeğini [yemek tarihi:{model.Yemek.UretimZamani}] {model.YemekSayisi} kişilik sipariş verdiniz.", MusteriId = musteriId, CihazIp = _client.GetClientIp(), CihazBrowserAnonId = _client.GetClientAnonId(), CihazBrowser = _client.GetBrowser(_client.GetUserAgent(), _client.GetVersion()) }); return(View(model)); }
public ActionResult repassword(string nowpassword, string newpassword, string newpassword2) { if (string.IsNullOrWhiteSpace(newpassword)) { TempData["ok"] = "0"; return(View()); } if (string.IsNullOrWhiteSpace(newpassword2)) { TempData["ok"] = "0"; return(View()); } Guid _id = getLoginUserId(); if (_id == null) { return(new HttpNotFoundResult("Geçersiz hesap id parametresi")); } if (_id == Guid.Empty) { return(new HttpNotFoundResult("Geçersiz hesap id parametresi")); } Musteriler result = _cari.Find(_id); string nowPassHash = _hash.Create(nowpassword); if (result.GeciciPassword.Equals(nowPassHash)) { string passHash1 = _hash.Create(newpassword); string passHash2 = _hash.Create(newpassword2); if (passHash1.Equals(passHash2)) { result.GeciciPassword = passHash1; _cari.Update(result); TempData["ok"] = "1"; _hareket.Insert(new MusteriGirisHareketleri() { IslemTarihi = DateTime.Now, Islem = HareketTipleri.Sifre_Degistirme, IslemAciklama = "Profilinizden şifrenizi değiştirdiniz.", MusteriId = result.Id, CihazIp = _client.GetClientIp(), CihazBrowserAnonId = _client.GetClientAnonId(), CihazBrowser = _client.GetBrowser(_client.GetUserAgent(), _client.GetVersion()) }); } else { TempData["ok"] = "2"; } } else { TempData["ok"] = "3"; } return(View()); }
public string GetBrowser(string useragent, string browserversion) { return(_manager.GetBrowser(useragent, browserversion)); }