public async Task <List <GarmentDOItems> > GetNewData() { var urn = await unitReceiptNoteDataUtil.GetTestData(); var doItems = urn.Items.Select(i => unitReceiptNoteDataUtil.ReadDOItemsByURNItemId((int)i.Id)).ToList(); return(doItems); }
public async Task <GarmentUnitDeliveryOrder> GetNewData(GarmentUnitReceiptNote unitReceiptNote1 = null) { DateTimeOffset now = DateTimeOffset.Now; long nowTicks = now.Ticks; var garmentUnitReceiptNote = unitReceiptNote1 ?? await Task.Run(() => UNDataUtil.GetTestDataWithStorage(nowTicks)); GarmentUnitDeliveryOrder garmentUnitDeliveryOrder = new GarmentUnitDeliveryOrder { UnitDOType = "SAMPLE", UnitDODate = DateTimeOffset.Now, UnitSenderId = garmentUnitReceiptNote.UnitId, UnitRequestCode = garmentUnitReceiptNote.UnitCode, UnitRequestName = garmentUnitReceiptNote.UnitName, UnitRequestId = garmentUnitReceiptNote.UnitId, UnitSenderCode = garmentUnitReceiptNote.UnitCode, UnitSenderName = garmentUnitReceiptNote.UnitName, StorageId = garmentUnitReceiptNote.StorageId, StorageCode = garmentUnitReceiptNote.StorageCode, StorageName = garmentUnitReceiptNote.StorageName, RONo = garmentUnitReceiptNote.Items.Select(i => i.RONo).FirstOrDefault(), Article = $"Article{nowTicks}", Items = new List <GarmentUnitDeliveryOrderItem>() }; foreach (var item in garmentUnitReceiptNote.Items) { var garmentDOItems = UNDataUtil.ReadDOItemsByURNItemId((int)item.Id); garmentUnitDeliveryOrder.Items.Add( new GarmentUnitDeliveryOrderItem { IsSave = true, DODetailId = item.DODetailId, EPOItemId = item.EPOItemId, POItemId = item.POItemId, PRItemId = item.PRItemId, FabricType = "FABRIC", URNId = garmentUnitReceiptNote.Id, URNItemId = item.Id, URNNo = garmentUnitReceiptNote.URNNo, POSerialNumber = item.POSerialNumber, RONo = item.RONo, ProductId = item.ProductId, ProductCode = item.ProductCode, ProductName = item.ProductName, Quantity = (double)(item.SmallQuantity - item.OrderQuantity), UomId = item.UomId, UomUnit = item.UomUnit, ReturUomId = item.UomId, ReturUomUnit = item.UomUnit, DOItemsId = (int)garmentDOItems.Id, DOCurrencyRate = 1 }); } return(garmentUnitDeliveryOrder); }