public IActionResult GeneratePassword(int id) { Models.Collaborator collaborator = _collaboratorRepository.GetCollaborator(id); collaborator.Password = KeyGenerator.GetUniqueKey(8); _collaboratorRepository.UpdatePassword(collaborator); //send email with password _sendEmail.SendPasswordPerEmail(collaborator); TempData["MSG_S"] = Message.MSG_S003; return(RedirectToAction(nameof(Index))); }
public Collaborator GetCollaborator(int CollaboratorId) { return(_CollaboratorRepository.GetCollaborator(CollaboratorId)); }
public IActionResult Update(int id) { Models.Collaborator collaboratorToUpdate = collaboratorRepository.GetCollaborator(id); collaboratorToUpdate.Password = null; return(View(collaboratorToUpdate)); }