示例#1
0
        private Dictionary <string, LotHistoryItem> GetLotHistoryInfo(LotHistoryInfoKey keyType)
        {
            Dictionary <string, LotHistoryItem> lotHistoryInfo = new Dictionary <string, LotHistoryItem>();
            DataTable lotHistory = _result.LoadOutput(DataConsts.Out_LotHistory);

            foreach (DataRow row in lotHistory.Rows)
            {
                string   versionNo      = row.GetString("VERSION_NO");
                string   factoryID      = row.GetString("FACTORY_ID");
                string   fromShopID     = row.GetString("FROM_SHOP_ID");
                string   fromLotID      = row.GetString("FROM_LOT_ID");
                string   fromProcessID  = row.GetString("FROM_PROCESS_ID");
                string   fromProductID  = row.GetString("FROM_PRODUCT_ID");
                string   toLotID        = row.GetString("TO_LOT_ID");
                string   toProcessID    = row.GetString("TO_PROCESS_ID");
                string   toProductID    = row.GetString("TO_PRODUCT_ID");
                DateTime fromDate       = row.GetDateTime("FROM_DATE");
                DateTime toDate         = row.GetDateTime("TO_DATE");
                Int32    fromQty        = row.GetInt32("FROM_QTY");
                Int32    toQty          = row.GetInt32("TO_QTY");
                string   targetDemandID = row.GetString("TAR_DEMAND_ID");
                DateTime targetplanDate = row.GetDateTime("TARGET_PLAN_DATE");
                Int32    targetPlanQty  = row.GetInt32("TARGET_PLAN_QTY");

                string key = string.Empty;

                if (keyType == LotHistoryInfoKey.ISFromLot)
                {
                    key = fromLotID;
                }
                else if (keyType == LotHistoryInfoKey.ISToLot)
                {
                    key = toLotID;
                }
                else if (keyType == LotHistoryInfoKey.ISFromToLot)
                {
                    key = CommonHelper.CreateKey(fromLotID, toLotID);
                }

                if (lotHistoryInfo.ContainsKey(key) == false)
                {
                    lotHistoryInfo[key] = new LotHistoryItem();
                }

                lotHistoryInfo[key].AddItem(versionNo, factoryID, fromShopID, fromLotID, fromProcessID
                                            , fromProductID, toLotID, toProcessID, toProductID, fromDate, toDate
                                            , fromQty, toQty, targetDemandID, targetplanDate, targetPlanQty, keyType);
            }

            return(lotHistoryInfo);
        }
示例#2
0
 internal void AddItem(string versionNo, string factoryID, string fromShopID, string fromLotID, string fromProcessID
                       , string fromProductID, string toLotID, string toProcessID, string toProductID, DateTime fromDate
                       , DateTime toDate, int fromQty, int toQty, string targetPlanID, DateTime targetplanDate
                       , int target_Plan_Qty, LotHistoryInfoKey keyType)
 {
     this.versionNo      = versionNo;
     this.factoryID      = factoryID;
     this.fromShopID     = fromShopID;
     this.fromLotID      = fromLotID;
     this.fromProcessID  = fromProcessID;
     this.fromProductID  = fromProductID;
     this.toLotID        = toLotID;
     this.toProcessID    = toProcessID;
     this.toProductID    = toProductID;
     this.fromDate       = fromDate;
     this.toDate         = toDate;
     this.fromQty        = fromQty;
     this.toQty          = toQty;
     this.targetPlanID   = targetPlanID;
     this.targetPlanDate = targetplanDate;
     this.targetPlanQty  = target_Plan_Qty;
     this.keyType        = keyType;
 }
示例#3
0
 internal void SetLotHistoryInfoKey(LotHistoryInfoKey keyType)
 {
     this.keyType = keyType;
 }