public ActionResult SifremiUnuttum(LoginSifremiUnuttumViewModel model) { if (ModelState.IsValid) { var calisan = _adminService.FindByUsernameAndEmail(model.Username, model.Email); if (calisan != null) { var body = new StringBuilder(); body.AppendLine("Username: "******"Email: " + calisan.Email); body.AppendLine("Parola: " + calisan.Password); var mailSender = new MailSender(); mailSender.MailGonder(body.ToString()); ViewBag.Status = true; return(View(model)); } else { ViewBag.Status = false; ModelState.AddModelError("", "Bu kullanıcı adı ve email adresine sahip bir hesap bulunamadı."); return(View(model)); } } ViewBag.Status = false; return(View(model)); }
public ActionResult SifremiUnuttum() { var model = new LoginSifremiUnuttumViewModel(); ViewBag.Status = false; return(View(model)); }