本文整理汇总了C#中com.Sconit.Entity.ORD.OrderMaster.AddOrderDetail方法的典型用法代码示例。如果您正苦于以下问题:C# OrderMaster.AddOrderDetail方法的具体用法?C# OrderMaster.AddOrderDetail怎么用?C# OrderMaster.AddOrderDetail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.Sconit.Entity.ORD.OrderMaster
的用法示例。
在下文中一共展示了OrderMaster.AddOrderDetail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateExScrapOrder
public OrderMaster CreateExScrapOrder(MrpExScrap mrpExScrap)
{
var newOrder = new OrderMaster();
Item item = this.itemMgr.GetCacheItem(mrpExScrap.Item);
mrpExScrap.ItemDescription = item.Description;
this.genericMgr.Create(mrpExScrap);
if(mrpExScrap.Item == BusinessConstants.VIRTUALSECTION)
{
//nothing todo
}
else if(mrpExScrap.ScrapType == CodeMaster.ScheduleType.MES24 || mrpExScrap.ScrapType == CodeMaster.ScheduleType.MES25)
{
//只记录废品数,无材料消耗
DateTime startTime = mrpExScrap.EffectDate;
DateTime windowTime = mrpExScrap.EffectDate;
workingCalendarMgr.GetStartTimeAndWindowTime(mrpExScrap.Shift, mrpExScrap.EffectDate, out startTime, out windowTime);
FlowMaster flowMaster = this.genericMgr.FindById<FlowMaster>(mrpExScrap.Flow);
newOrder = orderMgr.TransferFlow2Order(flowMaster, false);
newOrder.Shift = mrpExScrap.Shift;
newOrder.StartTime = startTime;
newOrder.WindowTime = windowTime;
newOrder.EffectiveDate = mrpExScrap.EffectDate;
newOrder.ReferenceOrderNo = mrpExScrap.Id.ToString();
newOrder.Priority = CodeMaster.OrderPriority.Normal;
OrderDetail newOrderDetail = new OrderDetail();
newOrderDetail.Item = item.Code;
newOrderDetail.UnitCount = (decimal)item.UnitCount;
newOrderDetail.Uom = "KG";
newOrderDetail.BaseUom = item.Uom;
newOrderDetail.ItemDescription = item.Description;
newOrderDetail.Sequence = 10;
newOrderDetail.MinUnitCount = item.UnitCount;
newOrderDetail.OrderedQty = (decimal)mrpExScrap.ScrapQty;
newOrderDetail.LocationFrom = flowMaster.LocationFrom;
newOrderDetail.LocationTo = flowMaster.LocationTo;
newOrderDetail.CurrentScrapQty = newOrderDetail.OrderedQty;
newOrderDetail.ScheduleType = mrpExScrap.ScrapType;
newOrder.ExternalOrderNo = newOrderDetail.ScheduleType.ToString();
newOrder.AddOrderDetail(newOrderDetail);
newOrder.SubType = CodeMaster.OrderSubType.Other;
newOrder.IsQuick = true;
newOrder.IsShipScanHu = false;
newOrder.IsReceiveScanHu = false;
newOrder.CreateHuOption = CodeMaster.CreateHuOption.None;
orderMgr.CreateOrder(newOrder, true);
mrpExScrap.OrderNo = newOrder.OrderNo;
}
return newOrder;
}