本文整理汇总了C#中com.Sconit.Entity.MasterData.OrderHead.AddOrderDetail方法的典型用法代码示例。如果您正苦于以下问题:C# OrderHead.AddOrderDetail方法的具体用法?C# OrderHead.AddOrderDetail怎么用?C# OrderHead.AddOrderDetail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.Sconit.Entity.MasterData.OrderHead
的用法示例。
在下文中一共展示了OrderHead.AddOrderDetail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateOrderDetail
//.........这里部分代码省略.........
// count++;
// if (!convertRate.HasValue)
// {
// if (itemKit.ParentItem.Uom.Code != orderDetail.Uom.Code)
// {
// convertRate = this.uomConversionMgrE.ConvertUomQty(orderDetail.Item, orderDetail.Uom, 1, itemKit.ParentItem.Uom);
// }
// else
// {
// convertRate = 1;
// }
// }
// OrderDetail orderDetailOfChildKit = new OrderDetail();
// CloneHelper.CopyProperty(orderDetail, orderDetailOfChildKit, OrderDetailOfChildKitCloneFields);
// orderDetailOfChildKit.Sequence = orderDetailOfChildKit.Sequence + count;
// orderDetailOfChildKit.Item = itemKit.ChildItem;
// orderDetailOfChildKit.ReferenceItemCode = this.itemReferenceMgrE.GetItemReferenceByItem(itemKit.ChildItem.Code, orderDetail.OrderHead.PartyFrom.Code, orderDetail.OrderHead.PartyTo.Code);
// orderDetailOfChildKit.Uom = itemKit.ChildItem.Uom;
// orderDetailOfChildKit.UnitCount = itemKit.ChildItem.UnitCount;
// //orderDetailOfChildKit.RequiredQty = orderDetailOfChildKit.RequiredQty * itemKit.Qty * convertRate;
// //orderDetailOfChildKit.OrderedQty = orderDetailOfChildKit.OrderedQty * itemKit.Qty * convertRate;
// orderDetailOfChildKit.GoodsReceiptLotSize = orderDetailOfChildKit.GoodsReceiptLotSize * itemKit.Qty * convertRate;
// orderDetailOfChildKit.BatchSize = orderDetailOfChildKit.BatchSize * itemKit.Qty * convertRate;
// if (orderDetailOfChildKit.HuLotSize.HasValue)
// {
// orderDetailOfChildKit.HuLotSize = int.Parse((orderDetailOfChildKit.HuLotSize.Value * itemKit.Qty * convertRate.Value).ToString("#"));
// }
// #region 计算价格
// if (orderDetailOfChildKit.DefaultPriceListFrom != null)
// {
// PriceListDetail priceListDetailFrom = priceListDetailMgrE.GetLastestPriceListDetail(orderDetailOfChildKit.DefaultPriceListFrom, orderDetailOfChildKit.Item, orderHead.StartTime, orderHead.Currency, orderDetailOfChildKit.Uom);
// if (priceListDetailFrom != null)
// {
// orderDetailOfChildKit.PriceListDetailFrom = priceListDetailFrom;
// }
// }
// if (orderDetailOfChildKit.DefaultPriceList != null)
// {
// PriceListDetail priceListDetail = priceListDetailMgrE.GetLastestPriceListDetail(orderDetailOfChildKit.DefaultPriceList, orderDetailOfChildKit.Item, orderHead.StartTime, orderHead.Currency, orderDetailOfChildKit.Uom);
// orderDetailOfChildKit.IsProvisionalEstimate = priceListDetail == null ? true : priceListDetail.IsProvisionalEstimate;
// if (priceListDetailTo != null)
// {
// orderDetailOfChildKit.UnitPrice = priceListDetail.UnitPrice;
// orderDetailOfChildKit.IsIncludeTax = priceListDetail.IsIncludeTax;
// orderDetailOfChildKit.TaxCode = entityPreferenceMgrE.LoadEntityPreference(BusinessConstants.ENTITY_PREFERENCE_CODE_TAX_RATE).Value;//priceListDetail.TaxCode;
// }
// }
// #endregion
// //重新设置Sequence
// int detailCount = orderHead.OrderDetails != null ? orderHead.OrderDetails.Count : 0;
// orderDetail.Sequence = (detailCount + 1) * seqInterval;
// orderHead.AddOrderDetail(orderDetailOfChildKit);
// orderDetailList.Add(orderDetailOfChildKit);
// }
// }
// else
// {
// throw new BusinessErrorException("ItemKit.Error.NotFoundForParentItem", orderDetail.Item.Code);
// }
// #endregion
//}
//else
//{
//重新设置Sequence
int detailCount = orderHead.OrderDetails != null ? orderHead.OrderDetails.Count : 0;
orderDetail.Sequence = (detailCount + 1) * seqInterval;
#region 参考零件号
if (orderDetail.ReferenceItemCode == null || orderDetail.ReferenceItemCode == string.Empty)
{
string firstPartyCode = string.Empty;
string secondPartyCode = string.Empty;
if (orderHead.Type == BusinessConstants.CODE_MASTER_FLOW_TYPE_VALUE_DISTRIBUTION)
{
firstPartyCode = orderHead.PartyTo.Code;
}
else
{
firstPartyCode = orderHead.PartyFrom.Code;
}
orderDetail.ReferenceItemCode = itemReferenceMgrE.GetItemReferenceByItem(orderDetail.Item.Code, firstPartyCode, secondPartyCode);
}
#endregion
#region 设置默认库位
orderDetail.LocationFrom = orderDetail.LocationFrom == null ? orderHead.LocationFrom : orderDetail.LocationFrom;
orderDetail.LocationTo = orderDetail.LocationTo == null ? orderHead.LocationTo : orderDetail.LocationTo;
#endregion
orderHead.AddOrderDetail(orderDetail);
orderDetailList.Add(orderDetail);
//}
return orderDetailList;
}