Пример #1
0
        public virtual ApiAirTransportServerResponseModel MapEntityToModel(
            AirTransport item)
        {
            var model = new ApiAirTransportServerResponseModel();

            model.SetProperties(item.Id,
                                item.AirlineId,
                                item.FlightNumber,
                                item.HandlerId,
                                item.LandDate,
                                item.PipelineStepId,
                                item.TakeoffDate);
            if (item.HandlerIdNavigation != null)
            {
                var handlerIdModel = new ApiHandlerServerResponseModel();
                handlerIdModel.SetProperties(
                    item.HandlerIdNavigation.Id,
                    item.HandlerIdNavigation.CountryId,
                    item.HandlerIdNavigation.Email,
                    item.HandlerIdNavigation.FirstName,
                    item.HandlerIdNavigation.LastName,
                    item.HandlerIdNavigation.Phone);

                model.SetHandlerIdNavigation(handlerIdModel);
            }

            return(model);
        }
Пример #2
0
        public virtual ApiHandlerServerResponseModel MapEntityToModel(
            Handler item)
        {
            var model = new ApiHandlerServerResponseModel();

            model.SetProperties(item.Id,
                                item.CountryId,
                                item.Email,
                                item.FirstName,
                                item.LastName,
                                item.Phone);

            return(model);
        }
Пример #3
0
        public virtual ApiHandlerServerResponseModel MapServerRequestToResponse(
            int id,
            ApiHandlerServerRequestModel request)
        {
            var response = new ApiHandlerServerResponseModel();

            response.SetProperties(id,
                                   request.CountryId,
                                   request.Email,
                                   request.FirstName,
                                   request.LastName,
                                   request.Phone);
            return(response);
        }
Пример #4
0
        public virtual ApiOtherTransportServerResponseModel MapEntityToModel(
            OtherTransport item)
        {
            var model = new ApiOtherTransportServerResponseModel();

            model.SetProperties(item.Id,
                                item.HandlerId,
                                item.PipelineStepId);
            if (item.HandlerIdNavigation != null)
            {
                var handlerIdModel = new ApiHandlerServerResponseModel();
                handlerIdModel.SetProperties(
                    item.HandlerIdNavigation.Id,
                    item.HandlerIdNavigation.CountryId,
                    item.HandlerIdNavigation.Email,
                    item.HandlerIdNavigation.FirstName,
                    item.HandlerIdNavigation.LastName,
                    item.HandlerIdNavigation.Phone);

                model.SetHandlerIdNavigation(handlerIdModel);
            }

            if (item.PipelineStepIdNavigation != null)
            {
                var pipelineStepIdModel = new ApiPipelineStepServerResponseModel();
                pipelineStepIdModel.SetProperties(
                    item.PipelineStepIdNavigation.Id,
                    item.PipelineStepIdNavigation.Name,
                    item.PipelineStepIdNavigation.PipelineStepStatusId,
                    item.PipelineStepIdNavigation.ShipperId);

                model.SetPipelineStepIdNavigation(pipelineStepIdModel);
            }

            return(model);
        }