Exemplo n.º 1
0
        public async Task <IActionResult> GetReport(int?id              = null, bool?grated = null, bool?cat = null,
                                                    bool?rubberBack     = null, bool?glassBreak       = null, bool?rubberStateOne = null,
                                                    bool?rubberStateTwo = null, bool?rubberStateThree = null, bool?rubberStateFourth = null,
                                                    string amountOfFuel = null, string status         = null, int?employeeID = null, int?clientID = null,
                                                    int?carID           = null)
        {
            try
            {
                var cars = await _repository.GetReport(id, grated, cat, rubberBack, glassBreak,
                                                       rubberStateOne, rubberStateTwo, rubberStateThree, rubberStateFourth, amountOfFuel, status,
                                                       employeeID, clientID, carID);

                return(Ok(cars));
            }
            catch (Exception e)
            {
                //Log error
                Log.Error(e.Message);
                Log.Error(e.StackTrace);
                return(BadRequest("An error ocurred, contact IT Staff"));
            }
        }