Exemplo n.º 1
0
 public ActionResult EditLogIn(int id, EmployeeEditLogin inEEL)
 {
     if (ModelState.IsValid)
     {
         var bll = _AdminBll;
         if (bll.correctOldPassword(id, inEEL.OldPassword))
         {
             if (bll.editEmployeeLogin(id, inEEL))
             {
                 ViewBag.EditLogin = true;
                 return(View());
             }
             else
             {
                 ViewBag.EditLogin = false;
                 return(View());
             }
         }
         else
         {
             ViewBag.OPOK = false;
         }
         return(View());
     }
     else
     {
         return(RedirectToAction("Error"));
     }
 }
Exemplo n.º 2
0
 public bool editEmployeeLogin(int id, EmployeeEditLogin inEEL)
 {
     if (id == 0)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Exemplo n.º 3
0
        public ActionResult EditLogIn(int id)
        {
            if ((bool)Session["LoggedIn"] == false)
            {
                return(RedirectToAction("LogIn"));
            }
            var EEL = new EmployeeEditLogin();

            EEL.Username = _AdminBll.getUsername(id);
            return(View(EEL));
        }
Exemplo n.º 4
0
 public bool editEmployeeLogin(int id, EmployeeEditLogin inEEL)
 {
     using (var db = new WAPPContext())
     {
         try
         {
             var    editShadow    = db.Shadow.Find(id);
             string salt          = Salt();
             var    passwordNSalt = inEEL.Password + salt;
             byte[] passwordDB    = Hash(passwordNSalt);
             editShadow.Username = inEEL.Username;
             editShadow.Password = passwordDB;
             editShadow.Salt     = salt;
             db.SaveChanges();
             return(true);
         }
         catch (Exception exception)
         {
             LogException(exception);
             return(false);
         }
     }
 }
Exemplo n.º 5
0
 public bool editEmployeeLogin(int id, EmployeeEditLogin inEEL)
 {
     return(_repository.editEmployeeLogin(id, inEEL));
 }