Пример #1
0
        private WIPRouteLine CWIPRouteLine(RouteLine rLine)
        {
            WIPRouteLine wipRouteLine = rLine.Session.FindObject<WIPRouteLine>(CriteriaOperator.Parse(string.Format("Item.Oid = '{0}' AND OperNo = {1}",
                rLine.Item.Oid, rLine.OperNo)));

            if (wipRouteLine == null)
            {
                wipRouteLine = new WIPRouteLine(rLine.Session);
                wipRouteLine.Item = rLine.Item;
                wipRouteLine.OperNo = rLine.OperNo;
                wipRouteLine.NextOperNo = rLine.NextOperNo;
                wipRouteLine.ProcessQty = rLine.ProcessQty;
                wipRouteLine.QtyofWorkCenter = rLine.QtyofWorkCenter;
                wipRouteLine.RunTime = rLine.RunTime;
                wipRouteLine.SetupTime = rLine.SetupTime;
                wipRouteLine.wipItem = rLine.wipItem;
                wipRouteLine.WorkCenter = rLine.WorkCenter;
                wipRouteLine.WorkDesc = rLine.WorkDesc;
                wipRouteLine.WorkOper = rLine.WorkOper;
                wipRouteLine.Save();
            }
            else
            {
                wipRouteLine.NextOperNo = rLine.NextOperNo;
                wipRouteLine.ProcessQty = rLine.ProcessQty;
                wipRouteLine.QtyofWorkCenter = rLine.QtyofWorkCenter;
                wipRouteLine.RunTime = rLine.RunTime;
                wipRouteLine.SetupTime = rLine.SetupTime;
                wipRouteLine.wipItem = rLine.wipItem;
                wipRouteLine.WorkCenter = rLine.WorkCenter;
                wipRouteLine.WorkDesc = rLine.WorkDesc;
                wipRouteLine.WorkOper = rLine.WorkOper;
                wipRouteLine.Save();
            }

            return wipRouteLine;
        }
Пример #2
0
        private void CWIPRouteLine(RouteLine rLine)
        {
            WIPRouteLine wipRouteLine = rLine.Session.FindObject<WIPRouteLine>(CriteriaOperator.Parse(string.Format("Item.Oid = '{0}' AND OperNo = {1}",
                rLine.Item.Oid, rLine.OperNo)));

            string key = rLine.Item.ItemNo + "_" + rLine.OperNo;

            if (wipRouteLine == null)
            {
                if (dictWIPRouteLine.ContainsKey(key))
                    wipRouteLine = dictWIPRouteLine[key];
                else
                    wipRouteLine = new WIPRouteLine(rLine.Session);
            }

            wipRouteLine.Item = rLine.Item;
            wipRouteLine.OperNo = rLine.OperNo;
            wipRouteLine.NextOperNo = rLine.NextOperNo;
            wipRouteLine.ProcessQty = rLine.ProcessQty;
            wipRouteLine.QtyofWorkCenter = rLine.QtyofWorkCenter;
            wipRouteLine.RunTime = rLine.RunTime;
            wipRouteLine.SetupTime = rLine.SetupTime;
            wipRouteLine.wipItem = rLine.wipItem;
            wipRouteLine.WorkCenter = rLine.WorkCenter;
            wipRouteLine.WorkDesc = rLine.WorkDesc;
            wipRouteLine.WorkOper = rLine.WorkOper;
            wipRouteLine.Save();

            if (dictWIPRouteLine.ContainsKey(key) == false)
                dictWIPRouteLine.Add(key, wipRouteLine);
        }