public GetAgentDriverResponse GetAgentDriver(GetAgentDriverRequest request) { GetAgentDriverResponse response = new GetAgentDriverResponse(); Driver driver = null; try { if (!CheckAuthDriver(request.user_id, request.auth_token)) { _userServices.MakeNouserResponse(response); return(response); } using (DriverDao dao = new DriverDao()) { driver = dao.FindById(request.user_id); DTOs.Driver.DriverDetailsDto dto = new DTOs.Driver.DriverDetailsDto(); DriverHelper.CopyFromEntity(dto, driver); response.code = 0; response.has_resource = 1; response.driver_details = dto; response.message = MessagesSource.GetMessage("got.agent.driver"); } } catch (Exception ex) { response.MakeExceptionResponse(ex); } return(response); }
public NegotiatedContentResult <GetAgentDriverResponse> PostGetAgentDriver([FromBody] GetAgentDriverRequest request) { GetAgentDriverResponse resp = _driverServices.GetAgentDriver(request); return(Content(HttpStatusCode.OK, resp)); }