Exemple #1
0
        public IHttpActionResult GetAllNombreEmpresas()
        {
            var manager = new TarifaManager();

            _apiResponse = new ApiResponse
            {
                Data    = manager.RetrieveAll().GroupBy(x => x.Operator).Select(group => group.First()),
                Message = "Proceso realizado"
            };

            return(Ok(_apiResponse));
        }
Exemple #2
0
        public IHttpActionResult UpdateTarifas()
        {
            try
            {
                var mng = new TarifaManager();
                mng.UpdateTarifasAresep();
                apiResp.Message = "Tarifas actualizadas.";

                return(Ok(apiResp));
            }
            catch (BusinessException bex)
            {
                return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message)));
            }
        }
Exemple #3
0
        public IHttpActionResult GetOperadores()
        {
            try
            {
                var mng = new TarifaManager();
                apiResp.Data    = mng.RetrieveEmpresarios();
                apiResp.Message = "Operadores";

                return(Ok(apiResp));
            }
            catch (BusinessException bex)
            {
                return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message)));
            }
        }
Exemple #4
0
        public IHttpActionResult GetTarifa(int id)
        {
            try
            {
                var mng = new TarifaManager();
                apiResp.Data = mng.Retrieve(new Tarifa {
                    RouteId = id
                });
                apiResp.Message = "Tarifa";

                return(Ok(apiResp));
            }
            catch (BusinessException bex)
            {
                return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message)));
            }
        }