public bool EditPassword(EmployeePasswordChange passwordChange) { try { passwordChange.Password = Encrypt(passwordChange.Password, "sblw-3hn8-sqoy19"); return(_loginRepository.EditPassword(passwordChange)); } catch (Exception ex) { throw ex; } }
public IActionResult EditPassword([FromBody] EmployeePasswordChange passwordChange) { try { return(Ok(_loginService.EditPassword(passwordChange))); } catch (Exception ex) { message = ex.Message; _log.LogError(message); return(StatusCode(StatusCodes.Status500InternalServerError, message)); } }
public bool EditPassword(EmployeePasswordChange passwordChange) { try { SqlConnection sqlconn = new SqlConnection(connectionString); SqlCommand sqlComm = new SqlCommand("updatePassword"); sqlconn.Open(); sqlComm.Connection = sqlconn; sqlComm.CommandType = CommandType.StoredProcedure; sqlComm.Parameters.AddWithValue("@empId", passwordChange.Id); sqlComm.Parameters.AddWithValue("@newPassword", passwordChange.Password); sqlComm.ExecuteNonQuery(); return(true); } catch (Exception ex) { throw ex; } }