Esempio n. 1
0
        public static List<SalesOrderLine> SplitSOLineByPromisedDateAndPriority(List<SalesOrderLine> SOLines)
        {
            List<SalesOrderLine> ListTmp = new List<SalesOrderLine>();

            foreach (SalesOrderLine SOLine in SOLines)
            {
                SOLine.InitPList();
                Dictionary<int, ProjInfo> DictProjInfo = DateAndPriorityToDict(SOLine.PriorityList, SOLine.PromisedDateList);
                int OrderSubIndex = 1;

                foreach (KeyValuePair<int, ProjInfo> KvpProjInfo in DictProjInfo)
                {
                    ProjInfo ProjInfo = KvpProjInfo.Value;
                    SalesOrderLine NewSOLine = new SalesOrderLine();
                    NewSOLine.Copy(SOLine);
                    NewSOLine.PromisedDate = ProjInfo.Date;
                    NewSOLine.Priority = ProjInfo.Priority;
                    NewSOLine.NeedQty = ProjInfo.Qty;
                    NewSOLine.ShippedQty = 0;
                    NewSOLine.PriorityList = string.Format("{0} ({1})", ProjInfo.Priority, ProjInfo.Qty);
                    NewSOLine.PromisedDateList = string.Format("{0} ({1})", ProjInfo.Date.ToString("yy-MMM-dd"), ProjInfo.Qty);
                    NewSOLine.OrderSubIndex = OrderSubIndex;
                    OrderSubIndex++;

                    ListTmp.Add(NewSOLine);
                }
            }

            return ListTmp;
        }
 public void Copy(SalesOrderLine OldSOLine)
 {
     Customer = OldSOLine.Customer;
     ItemNo = OldSOLine.ItemNo;
     ItemName = OldSOLine.ItemName;
     ItemType = OldSOLine.ItemType;
     Material = OldSOLine.Material;
     OrderNo = OldSOLine.OrderNo;
     OrderIndex = OldSOLine.OrderIndex;
     CustomerItemNo = OldSOLine.CustomerItemNo;
     OurPrice = OldSOLine.OurPrice;
     ShipMethod = OldSOLine.ShipMethod;
     NeedQty = OldSOLine.NeedQty;
     ShippedQty = OldSOLine.ShippedQty;
     Priority = OldSOLine.Priority;
     PriorityList = OldSOLine.PriorityList;
     PromisedDate = OldSOLine.PromisedDate;
     PromisedDateList = OldSOLine.PromisedDateList;
     OrderDate = OldSOLine.OrderDate;
     NeedDate = OldSOLine.NeedDate;
 }