public ActionResult SifreDegistir(LoginVM newLogin) { try { var guncellenecekLogin = _adminLogin.SelectByID(1); if (ModelState.IsValid) { if (newLogin.Password == newLogin.ConfirmPassword) { guncellenecekLogin.Password = LoginController.MD5Sifrele(newLogin.Password); _adminLogin.Guncelle(guncellenecekLogin); Session.Abandon(); return(RedirectToAction("Giris", "Login")); } else { throw new LoginException("Şifreler Eşleşmiyor..."); } } return(View()); } catch (Exception e) { ViewBag.Message = e.Message; return(View()); } }
public ActionResult PersonelGuncelle(Personel personel, int id) { try { if (ModelState.IsValid) { personel.PersonelID = id; _personel.Guncelle(personel); return(RedirectToAction("PersonelDetay", new RouteValueDictionary(new { controller = "Admin", action = "PersonelDetay", Id = id }))); } ViewBag.Departmanlar = _departman.SelectList(); ViewBag.Personeller = _rehberView.personelTamAd(); return(View()); } catch (Exception e) { ViewBag.Message = e.Message; return(View()); } }