private void BindPivotGrid(string batchID) { _detailDict = new Dictionary <string, DetailInfo>(); bool isFirstItem = true; foreach (DataRow row in _eqpPlanTable.Rows) { JobChangePlanData.EqpPlan ep = new JobChangePlanData.EqpPlan(row); if (ep.ProductID.StartsWith("CE")) { ep.ProductID = GetCellProductID(ep.ProductID); } if (ep.BatchID != batchID) { continue; } string layer = FindLayer(ep.ShopID, ep.StepID); string stepDesc = FindDesc(ep.ShopID, ep.StepID); if (layer == string.Empty) { continue; } string key = layer + ep.StepID; DetailInfo info; if (_detailDict.TryGetValue(key, out info) == false) { info = new DetailInfo(ep.BatchID, ep.ShopID, layer, ep.StepID, stepDesc); if (isFirstItem) { info.FillDummyDates(_shiftList); } _detailDict.Add(key, info); } DateTime shift = ShopCalendar.ShiftStartTimeOfDayT(ep.StartTime); info.AddQty(shift, ep.OutTargetQty); if (ep.StepID == "T02100") { Console.WriteLine("a"); } info.CalculateTimes(ep.StartTime, ep.EndTime); isFirstItem = false; } }
private void LoadData() { _eqpPlanTable = _result.LoadOutput(JobChangePlanData.EQP_PLAN_DATA_TABLE); List <string> prodList = _prodGroupDict[SelectedProdGrp]; _resultDict = new Dictionary <string, ProductInfo>(); if (SelectedProduct != Consts.ALL) { prodList = new List <string>(); prodList.Add(SelectedProduct); } foreach (DataRow epRow in _eqpPlanTable.Rows) { JobChangePlanData.EqpPlan ep = new JobChangePlanData.EqpPlan(epRow); if (ep.ProductID.StartsWith("CE")) { ep.ProductID = GetCellProductID(ep.ProductID); } if (prodList.Contains(ep.ProductID) == false) { continue; } ProductInfo info; if (_resultDict.TryGetValue(ep.ProductID, out info) == false) { info = new ProductInfo(ep.ProductID, ep.ShopID); _resultDict.Add(ep.ProductID, info); } if (IsInStep(ep.StepID)) { info.AddInfo(ep.OutTargetQty, 0, 0); info.SetInOutTime(ep.StartTime, ep.EndTime, true); } if (IsOutStep(ep.StepID)) { info.AddInfo(0, ep.OutTargetQty, 0); info.SetInOutTime(ep.StartTime, ep.EndTime, false); } } }
private void UpdateProductList() { this.productCombo.Items.Clear(); string prodGrp = this.prodGrpCombo.SelectedItem.ToString(); if (_prodGroupDict.ContainsKey(prodGrp) == false) { return; } //this.productCombo.Items.Add(Consts.ALL); List <string> validProds = _prodGroupDict[prodGrp]; _eqpPlan = _result.LoadOutput(JobChangePlanData.EQP_PLAN_DATA_TABLE); foreach (DataRow row in _eqpPlan.Rows) { JobChangePlanData.EqpPlan item = new JobChangePlanData.EqpPlan(row); string prodID = item.ProductID; if (item.ProductID.StartsWith("CE")) { prodID = GetCellProductID(item.ProductID); } if (!string.IsNullOrWhiteSpace(item.BatchID) && validProds.Contains(prodID) && this.productCombo.Items.Contains(item.ProductID) == false) { this.productCombo.Items.Add(item.ProductID); } } if (productCombo.Items.Count > 0) { this.productCombo.SelectedIndex = 0; } }
private void LoadData() { _eqpPlanTable = _result.LoadOutput(JobChangePlanData.EQP_PLAN_DATA_TABLE); List <string> prodList = _prodGroupDict[SelectedProdGrp]; _resultDict = new Dictionary <string, ProductInfo>(); if (SelectedProduct != Consts.ALL) { prodList = new List <string>(); prodList.Add(SelectedProduct); } foreach (DataRow epRow in _eqpPlanTable.Rows) { JobChangePlanData.EqpPlan ep = new JobChangePlanData.EqpPlan(epRow); if ((SelectedProduct != Consts.ALL && ep.ProductID != SelectedProduct) || string.IsNullOrWhiteSpace(ep.BatchID)) { continue; } if (ep.ProductID.StartsWith("CE")) { ep.ProductID = GetCellProductID(ep.ProductID); } ProductInfo info; if (_resultDict.TryGetValue(ep.BatchID, out info) == false) { info = new ProductInfo(ep.ProductID, ep.BatchID, ep.ShopID); _resultDict.Add(ep.BatchID, info); string filter = string.Format("{0} = '{1}'", JobChangePlanData.EqpPlan.Schema.LOT_ID, ep.LotID); DataTable temp = _result.LoadOutput(JobChangePlanData.EQP_PLAN_DATA_TABLE, filter); foreach (DataRow item in temp.Rows) { JobChangePlanData.EqpPlan t = new JobChangePlanData.EqpPlan(item); if (IsShopStep(t.StepID)) { info.LotInTime(t.LotID, t.StartTime); } } } if (IsInStep(ep.StepID)) { info.AddInfo(ep.OutTargetQty, 0, 0); info.SetInOutTime(ep.StartTime, ep.EndTime, true); } if (IsOutStep(ep.StepID)) { info.AddInfo(0, ep.OutTargetQty, 0); info.SetInOutTime(ep.StartTime, ep.EndTime, false); info.LotOutTime(ep.LotID, ep.EndTime); } } }