public ActionResult Aktivasyon(Guid id) { if (aprep.Any(x => x.ActivationCode == id)) { aprep.Default(x => x.ActivationCode == id).IsActive = true; TempData["HesapAktif"] = "Hesabınız aktif hale getirildi"; if (Session["bekleyenUrun"] != null) { //Product bekleyenUrun = Session["bekleyenUrun"] as Product; //CartItem ci = new CartItem(); //ci.ID = bekleyenUrun.ID; //ci.Name = bekleyenUrun.ProductName; //ci.Price = Convert.ToDecimal(bekleyenUrun.UnitPrice); //ci.ImagePath = bekleyenUrun.ImagePath; //Cart c = new Cart(); //c.SepeteEkle(ci); Session["scart"] = ControlProduct.KeepProduct(Session["bekleyenUrun"]); } return(RedirectToAction("Index", "Member")); } TempData["HesapAktif"] = "Aktif edilecek hesap bulunamadı"; return(RedirectToAction("Register")); }
public ActionResult Index(int?id) { if (Session["member"] != null) { AppUserVM appUserVM = new AppUserVM() { AppUser = auRep.Default(x => x.ID == id), AppUserDetail = audRep.Default(x => x.AppUser.ID == id) }; return(View(appUserVM)); } return(RedirectToAction("Login", "Home")); }
public ActionResult Aktivasyon(Guid id) { if (aprep.Any(x => x.ActivationCode == id)) { aprep.Default(x => x.ActivationCode == id).IsActive = true; TempData["HesapAktif"] = "Hesabınız aktif hale getirildi"; if (Session["bekleyenUrun"] != null) { Session["scart"] = ControlProduct.KeepProduct(Session["bekleyenUrun"]); } return(RedirectToAction("Index", "Member")); } TempData["HesapAktif"] = "Aktif edilecek hesap bulunamadı"; return(RedirectToAction("Register")); }
public ActionResult Login(AppUser item) { if (aRep.Any(x => x.UserName == item.UserName && x.Password == item.Password)) { AppUser user = aRep.Default(x => x.UserName == item.UserName && x.Password == item.Password); if (user.Role == MODEL.Enums.UserRole.Admin) { Session["Admin"] = user; return(RedirectToAction("CategoryList", "Category")); } else if (user.Role == MODEL.Enums.UserRole.Member) { Session["Member"] = user; return(RedirectToAction("ShoppingList", "Shopping")); } else if (user.Role == MODEL.Enums.UserRole.Visitor) { Session["Visitor"] = user; return(RedirectToAction("ShoppingList", "Shopping")); } } ViewBag.KullaniciYok = "Kullanıcı Bulunamadı"; return(View()); }
public ActionResult Login(AppUser item) { AppUser girisyapan = aRep.Default(x => x.AppUserName == item.AppUserName); Session["girisyapan"] = girisyapan; return(RedirectToAction("AraView")); //if (Session["girisyapan"] != null && girisyapan.Score == null) //{ // return RedirectToAction("Quiz"); //} //else if (Session["girisyapan"] != null && girisyapan.Score != null) //{ // ViewBag.TestCozuldu = "Daha önce testi çözdünüz."; //} //else //{ // ViewBag.KullaniciYok = "KullaniciBulunamadi"; //} //return View(); }
public ActionResult ConfirmEMail(Guid activationCode) { AppUser user = userRepository.Default(x => x.ActivationCode.Equals(activationCode)); if (user != null) { user.IsActive = true; userRepository.Update(user); ViewBag.Control = "kullanıcınız aktive edilmiştir"; } else { ViewBag.Control = "bir sorun oluştu"; } return(View()); }
public ActionResult Activation(Guid id) { if (apRep.Any(x => x.ActivationCode == id)) { AppUser activation = apRep.Default(x => x.ActivationCode == id); activation.IsActive = true; apRep.Update(activation); TempData["HesapAktif"] = "Hesabınız Aktif Hale Getirildi."; return(RedirectToAction("Login", "Home")); } else { TempData["HesapAktif"] = "Aktif Edilecek Hesap Bulunamadı !"; return(RedirectToAction("Index", "Register")); } }
public ActionResult Activation(Guid id) { if (apRep.Any(x => x.ActivationCode == id)) { AppUser aktiveEdilecek = apRep.Default(x => x.ActivationCode == id); aktiveEdilecek.IsActive = true; apRep.Update(aktiveEdilecek); TempData["HesapAktif"] = "Hesabınız aktif hale getirildi"; return(RedirectToAction("Register")); } else { TempData["HesapAktif"] = "Aktif edilecek hesap bulunamadı"; return(RedirectToAction("Register")); } }
public ActionResult Login(AppUser item) { AppUser yakalanan = apRep.Default(x => x.UserName == item.UserName); string decrypted = DantexCrypt.DeCrypt(yakalanan.Password); if (item.Password == decrypted && yakalanan != null && yakalanan.Role == MODEL.Enums.UserRole.Admin) { if (!yakalanan.IsActive) { AktifKontrol(); } Session["admin"] = yakalanan; Session["LogMember"] = yakalanan; return(RedirectToAction("CategoryList", "Category", new { area = "Admin" })); } else if (item.Password == decrypted && yakalanan != null && yakalanan.Role == MODEL.Enums.UserRole.Member) { if (!yakalanan.IsActive) { AktifKontrol(); } Session["member"] = yakalanan; Session["LogMember"] = yakalanan; return(RedirectToAction("ShoppingList", "Shopping")); } if (yakalanan != null) { LogRepository lrep = new LogRepository(); Log sifreYanlis = new Log(); sifreYanlis.Description = KeyWord.Exit; sifreYanlis.Information = $"{item.UserName} adlı kullanıcı şifresini {DateTime.Now} tarihinde yanlış girdi."; lrep.Add(sifreYanlis); } TempData["KullaniciYok"] = "Kullanıcı veya şifre yanlış."; return(View()); }
public ActionResult Login(AppUser item) { AppUser user = apRep.Default(x => x.UserName == item.UserName); string decrypted = DantexCrypt.DeCrypt(user.Password); if (item.Password == decrypted && user != null) { if (user.Role == UserRole.Admin) { if (!user.IsActive) { ActiveControl(); } else { Session["admin"] = user; return(RedirectToAction("Index", "AdminHome", new { area = "Admin" })); } } else if (user.Role == UserRole.Member) { if (!user.IsActive) { ActiveControl(); } else { Session["member"] = user; return(RedirectToAction("Index", "Shopping")); } } } else { ViewBag.UserNull = "Kullanıcı Bulunamadı"; } return(View(user)); }
public ActionResult Login(AppUser item, string Remember) { if (App_repo.Any(x => x.UserName == item.UserName && x.Role == Role.Admin && x.Status != DataStatus.Deleted)) { AppUser girenKisi = App_repo.Default(x => x.UserName == item.UserName && x.Role == Role.Admin); if (girenKisi.IsBanned == true) { ViewBag.Banli = "Banlandın!"; return(View()); } bool result = Crypto.VerifyHashedPassword(girenKisi.Password, item.Password); if (result) { RememberMe(item, Remember); Session["admin"] = girenKisi; return(RedirectToAction("NewsList", "Member")); } } else if (App_repo.Any(x => x.UserName == item.UserName && x.Role == Role.Member)) { AppUser girenUye = App_repo.Default(x => x.UserName == item.UserName); if (girenUye.IsBanned == true) { ViewBag.Banli = "Banlandın!"; return(View()); } bool result = Crypto.VerifyHashedPassword(girenUye.Password, item.Password); if (result) { RememberMe(item, Remember); Session["member"] = girenUye; return(RedirectToAction("NewsList", "Member")); } } else if (Editor_repo.Any(x => x.UserName == item.UserName)) { Editor girenEditor = Editor_repo.Default(x => x.UserName == item.UserName); if (girenEditor.IsBanned == true) { ViewBag.Banli = "Banlandın!"; return(View()); } bool result = Crypto.VerifyHashedPassword(girenEditor.Password, item.Password); if (result) { RememberMe(item, Remember); Session["editor"] = girenEditor; return(RedirectToAction("NewsList", "Member")); } } else if (Columnist_repo.Any(x => x.UserName == item.UserName)) { Columnist girenYazar = Columnist_repo.Default(x => x.UserName == item.UserName); if (girenYazar.IsBanned == true) { ViewBag.Banli = "Banlandın!"; return(View()); } bool result = Crypto.VerifyHashedPassword(girenYazar.Password, item.Password); if (result) { RememberMe(item, Remember); Session["columnist"] = girenYazar; return(RedirectToAction("NewsList", "Member")); } } ViewBag.Message = "Hatalı kullanıcı adı veya şifre"; return(View()); }