Exemplo n.º 1
0
        public void FromDto(OrderNoteDTO dto)
        {
            if (dto == null) return;

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

        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
        private List<OrderNoteDTO> TranslateNotes(data.bvc_Order o)
        {
            List<OrderNoteDTO> result = new List<OrderNoteDTO>();

            foreach (data.bvc_OrderNote item in o.bvc_OrderNote)
            {
                OrderNoteDTO n = new OrderNoteDTO();
                n.AuditDate = item.AuditDate;
                n.IsPublic = false;
                n.LastUpdatedUtc = item.AuditDate;
                n.Note = item.Note ?? string.Empty;
                n.OrderID = o.ID.ToString();
                result.Add(n);
            }

            return result;
        }
Exemplo n.º 4
0
        private List<OrderNoteDTO> TranslateNotes(string orderBvin)
        {
            List<OrderNoteDTO> result = new List<OrderNoteDTO>();

            data.BV53Entities db = new data.BV53Entities(EFConnString(settings.SourceConnectionString()));

            var old = db.bvc_OrderNote.Where(y => y.OrderId == orderBvin);
            if (old == null) return result;

            foreach (data.bvc_OrderNote item in old)
            {
                OrderNoteDTO n = new OrderNoteDTO();
                n.AuditDate = item.AuditDate;
                n.IsPublic = item.NoteType == 3;
                n.LastUpdatedUtc = item.LastUpdated;
                n.Note = item.Note ?? string.Empty;
                n.OrderID = orderBvin;
                result.Add(n);
            }

            return result;
        }