Ejemplo n.º 1
0
        //DTO
        public OrderNoteDTO ToDto()
        {
            OrderNoteDTO dto = new OrderNoteDTO();

            dto.AuditDate      = this.AuditDate;
            dto.Id             = this.Id;
            dto.IsPublic       = this.IsPublic;
            dto.LastUpdatedUtc = this.LastUpdatedUtc;
            dto.Note           = this.Note ?? string.Empty;
            dto.OrderID        = this.OrderID ?? string.Empty;
            dto.StoreId        = this.StoreId;

            return(dto);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Allows you to populate the current order note object using a OrderNoteDTO instance
        /// </summary>
        /// <param name="dto">An instance of the order note from the REST API</param>
        public void FromDto(OrderNoteDTO dto)
        {
            if (dto == null)
            {
                return;
            }

            AuditDate      = dto.AuditDate;
            Id             = dto.Id;
            IsPublic       = dto.IsPublic;
            LastUpdatedUtc = dto.LastUpdatedUtc;
            Note           = dto.Note ?? string.Empty;
            OrderID        = dto.OrderID ?? string.Empty;
            StoreId        = dto.StoreId;
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Allows you to convert the current order note object to the DTO equivalent for use with the REST API
        /// </summary>
        /// <returns>A new instance of OrderNoteDTO</returns>
        public OrderNoteDTO ToDto()
        {
            var dto = new OrderNoteDTO
            {
                AuditDate      = AuditDate,
                Id             = Id,
                IsPublic       = IsPublic,
                LastUpdatedUtc = LastUpdatedUtc,
                Note           = Note ?? string.Empty,
                OrderID        = OrderID ?? string.Empty,
                StoreId        = StoreId
            };

            return(dto);
        }