Exemplo n.º 1
0
        public virtual ApiSaleTicketsServerResponseModel MapEntityToModel(
            SaleTickets item)
        {
            var model = new ApiSaleTicketsServerResponseModel();

            model.SetProperties(item.Id,
                                item.SaleId,
                                item.TicketId);
            if (item.SaleIdNavigation != null)
            {
                var saleIdModel = new ApiSaleServerResponseModel();
                saleIdModel.SetProperties(
                    item.SaleIdNavigation.Id,
                    item.SaleIdNavigation.IpAddress,
                    item.SaleIdNavigation.Notes,
                    item.SaleIdNavigation.SaleDate,
                    item.SaleIdNavigation.TransactionId);

                model.SetSaleIdNavigation(saleIdModel);
            }

            if (item.TicketIdNavigation != null)
            {
                var ticketIdModel = new ApiTicketServerResponseModel();
                ticketIdModel.SetProperties(
                    item.TicketIdNavigation.Id,
                    item.TicketIdNavigation.PublicId,
                    item.TicketIdNavigation.TicketStatusId);

                model.SetTicketIdNavigation(ticketIdModel);
            }

            return(model);
        }
Exemplo n.º 2
0
        public virtual ApiTicketServerResponseModel MapServerRequestToResponse(
            int id,
            ApiTicketServerRequestModel request)
        {
            var response = new ApiTicketServerResponseModel();

            response.SetProperties(id,
                                   request.PublicId,
                                   request.TicketStatusId);
            return(response);
        }
Exemplo n.º 3
0
        public virtual ApiTicketServerResponseModel MapEntityToModel(
            Ticket item)
        {
            var model = new ApiTicketServerResponseModel();

            model.SetProperties(item.Id,
                                item.PublicId,
                                item.TicketStatusId);
            if (item.TicketStatusIdNavigation != null)
            {
                var ticketStatusIdModel = new ApiTicketStatusServerResponseModel();
                ticketStatusIdModel.SetProperties(
                    item.TicketStatusIdNavigation.Id,
                    item.TicketStatusIdNavigation.Name);

                model.SetTicketStatusIdNavigation(ticketStatusIdModel);
            }

            return(model);
        }