Beispiel #1
0
        public IActionResult FileReport([FromBody] FileReportRequest request)
        {
            var resp = _reportService.FileReport(request);

            if (resp.Success)
            {
                return(Ok(resp.Report));
            }
            return(BadRequest(resp.Message));
        }
Beispiel #2
0
        public FileReportResponse FileReport(FileReportRequest request)
        {
            var response = new FileReportResponse();

            try
            {
                var id = _repRepo.FileReport(request.EmpId, request.EmployeeName, request.Date, request.BusNo, request.Priority, request.ExteriorDamage, request.InteriorDamage, request.Maintenance);
                response.Report  = new Report(id, request.EmpId, request.EmployeeName, request.Date, request.BusNo, request.Priority, request.ExteriorDamage, request.InteriorDamage, request.Maintenance);
                response.Success = true;
            }
            catch (Exception ex)
            {
                response.AddMessage(ex.Message);
            }

            return(response);
        }