Пример #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;

        }
Пример #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;
        }
Пример #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;
        }
Пример #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;
        }