Beispiel #1
0
        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());
            }
        }
Beispiel #2
0
 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());
     }
 }