public static void RunAddUserInfo(PasswordConfirmation password, string id) { using (HREntities db = new HREntities()) { var employee = db.Employees.Where(l => l.UserName == id).FirstOrDefault(); var result = db.AddUserInfo(employee.ID, employee.UserName, password.password); } }
public static string SaveChangedPassword(PasswordConfirmation password, string username) { using (HREntities db = new HREntities()) { var emp = db.UserInfoes.Where(l => l.UserName == username).FirstOrDefault(); emp.Password = password.password; db.SaveChanges(); return("Successfully Changed"); } }
public static string Password(PasswordConfirmation pass) { pass.password = PWHashing.Hash(pass.password); pass.confirmpassword = PWHashing.Hash(pass.confirmpassword); if (pass.password == pass.confirmpassword) { return("Successfull"); } else { return("Passswords Don't Match"); } }
public static string SaveChangedPassword(PasswordConfirmation password, string username) //Saving the Changed password in the db { try { using (HREntities db = new HREntities()) { var emp = db.UserInfoes.Where(l => l.UserName == username).FirstOrDefault(); emp.Password = password.password; db.SaveChanges(); return("Successfully Changed"); } } catch (Exception ex) { LogFile.WriteLog(ex); return("Exception While trying to save in DB"); } }