public ResultModel <UserModel> Login(string user, string pass) { var response = new ResultModel <UserModel>(); try { var result = userRepository.LoginUser(user, pass); if (result != null) { response.Return = result; } else { response.AddErrorMessage("El usuario o la contraseña son incorrectos."); } } catch (Exception ex) { response.AddErrorMessage(ex.ToString()); } return(response); }
public ResultModel <List <PersonaModel> > SelectAllMozos() { var response = new ResultModel <List <PersonaModel> >(); try { response.Return = personaRepository.SelectAllMozos(); } catch (Exception ex) { response.AddErrorMessage(ex.ToString()); } return(response); }
//Método que devuelve una lista de rubros de GASTOS public ResultModel <List <RubroModel> > SelectAllRubrosGastos() { var response = new ResultModel <List <RubroModel> >(); try { response.Return = rubrosRepository.SelectAllRubrosGastos(); } catch (Exception ex) { response.AddErrorMessage(ex.ToString()); } return(response); }
public ResultModel <UserModel> ChangeUserPassword(string user, string pass) { var response = new ResultModel <UserModel>(); try { userRepository.ChangeUserPassword(user, pass); //var result = userRepository.ChangeUserPassword(user, pass); //if (result != null) // response.Return = result; //else //{ // response.AddErrorMessage("El usuario o la contraseña son incorrectos."); //} } catch (Exception ex) { response.AddErrorMessage(ex.ToString()); } return(response); }