示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        //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);
        }
示例#4
0
        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);
        }