public ActionResult Authenticate(string Email, string Password) { var AuthResult = AuthService.AuthUser(Email, Password, GlobalParams.ProjectType); if (AuthResult.IsSuccess) { Session[GlobalParams.UserSessionKey] = AuthResult; return(RedirectToAction("Index", "Material")); } else { InternalNotification.Subscribe(new AlertMessage() { Message = "Email or Password incorrect", MessageType = InternalNotificationType.error }); return(View("index")); } }
public ActionResult CreateUser(string cpf) { if (string.IsNullOrEmpty(cpf)) { InternalNotification.Subscribe(new AlertMessage() { Message = "CPF is requered", MessageType = InternalNotificationType.error }); return(View("index")); } if (UserService.Exists(cpf)) { InternalNotification.Subscribe(new AlertMessage() { Message = "There is already a user for this cpf", MessageType = InternalNotificationType.error }); return(View("index")); } return(RedirectToAction("Insert", "Users")); }