| | | 1 | | using DocumentFormat.OpenXml.Vml.Spreadsheet; |
| | | 2 | | using System; |
| | | 3 | | using System.Collections.Generic; |
| | | 4 | | using System.Linq; |
| | | 5 | | using System.Threading.Tasks; |
| | | 6 | | using WinSolutions.Sveta.Server.Data.DataModel.Entities; |
| | | 7 | | using WinSolutions.Sveta.Server.Data.DataModel.Extensions; |
| | | 8 | | |
| | | 9 | | namespace SVETA.Api.Data.DTO.DepartmentDTO |
| | | 10 | | { |
| | | 11 | | public class GoodSettingResponseDTO |
| | | 12 | | { |
| | | 13 | | public GoodSettingResponseDTO() { } |
| | | 14 | | public GoodSettingResponseDTO(DepartmentGoodSetting data) |
| | | 15 | | { |
| | | 16 | | Id = data.Id; |
| | | 17 | | GoodId = data.Good.Id; |
| | | 18 | | Name = data.Good.Name; |
| | | 19 | | VendorCode = data.GetActualVendorCode(); |
| | | 20 | | MinQuantity = data.MinQuantity; |
| | | 21 | | PickingQuantum = data.PickingQuantum; |
| | | 22 | | Photo = (PhotoPrevDto) data.Good.Photos.FirstOrDefault(); |
| | | 23 | | UniqueCode = data.Good.UniqueCode; |
| | | 24 | | Labels = new List<GoodLabelResponseDTO>(); |
| | | 25 | | if (data.GoodSettingsLabels?.Count > 0) |
| | | 26 | | Labels.AddRange(data.GoodSettingsLabels.Select(x => new GoodLabelResponseDTO(x.GoodLabel))); |
| | | 27 | | ShowcaseVisible = data.ShowcaseVisible; |
| | | 28 | | } |
| | | 29 | | public long Id { get; set; } |
| | | 30 | | public long GoodId { get; set; } |
| | | 31 | | public string Name { get; set; } |
| | | 32 | | public string VendorCode { get; set; } |
| | | 33 | | public decimal MinQuantity { get; set; } |
| | | 34 | | public decimal PickingQuantum { get; set; } |
| | | 35 | | public PhotoPrevDto Photo { get; set; } |
| | | 36 | | public string UniqueCode { get; set; } |
| | | 37 | | public List<GoodLabelResponseDTO> Labels { get; set; } |
| | | 38 | | public bool ShowcaseVisible { get; set; } |
| | | 39 | | } |
| | | 40 | | |
| | | 41 | | public class GoodSettingsSourceGoodsResponseDTO |
| | | 42 | | { |
| | 0 | 43 | | public long Id { get; set; } |
| | 0 | 44 | | public string VendorCode { get; set; } |
| | 0 | 45 | | public string Name { get; set; } |
| | 0 | 46 | | public bool IsInSetting { get; set; } |
| | 0 | 47 | | public long? SettingId { get; set; } |
| | 0 | 48 | | public PhotoPrevDto Photo { get; set; } |
| | | 49 | | |
| | 0 | 50 | | public string UniqueCode { get; set; } |
| | | 51 | | } |
| | | 52 | | } |