Exemple #1
0
        private void SetProdIdCheckBox()
        {
            this.prodIdCheckedComboBoxEdit.Properties.Items.Clear();

            var modelContext = this._result.GetCtx <ModelDataContext>();

            // ProductID CheckComboBox
            this.prodIdCheckedComboBoxEdit.Properties.Items.Clear();

            var prodIDs = modelContext.Product.Where(x => this.SelectedShopID == x.SHOP_ID).Select(x => x.PRODUCT_ID)
                          .Distinct();

            string filter = Globals.CreateFilter(string.Empty, SimResultData.StepWipSchema.SHOP_ID, "=",
                                                 this.SelectedShopID);

            filter = Globals.CreateFilter(filter, SimResultData.EqpPlanSchema.START_TIME, ">=",
                                          this.FromTime.ToString(), "AND");
            filter = Globals.CreateFilter(filter, SimResultData.EqpPlanSchema.START_TIME, "<",
                                          this.ToTime.ToString(), "AND");

            DataTable dtEqpPlan      = _result.LoadOutput(SimResultData.OutputName.EqpPlan, filter);
            var       prodsInEqpPlan = ComboHelper.Distinct(dtEqpPlan, SimResultData.EqpPlanSchema.PRODUCT_ID, string.Empty);

            var seleProds = prodIDs.Where(x => prodsInEqpPlan.Contains(x));

            foreach (var item in seleProds)
            {
                this.prodIdCheckedComboBoxEdit.Properties.Items.Add(item.ToString());
            }

            this.prodIdCheckedComboBoxEdit.CheckAll();
        }
Exemple #2
0
        private void SetProdIdCheckBox()
        {
            this.prodIdCheckedComboBoxEdit.Properties.Items.Clear();

            var modelContext = this._result.GetCtx <ModelDataContext>();

            // ProductID CheckComboBox
            this.prodIdCheckedComboBoxEdit.Properties.Items.Clear();

            var prodIDs = modelContext.Product.Where(x => this.SelectedShopID == x.SHOP_ID).Select(x => x.PRODUCT_ID)
                          .Distinct();

            //List<string> prodsInTatList;
            //if (_prodIdsInTatDic.TryGetValue(this.SelectedShopID, out prodsInTatList) == false)
            //    prodsInTatList = new List<string>();

            //var seleProds = prodsInTatList.Where(x => prodIDs.Contains(x));

            string filter = Globals.CreateFilter(string.Empty, SimResultData.StepWipSchema.SHOP_ID, "=",
                                                 this.SelectedShopID);

            filter = Globals.CreateFilter(filter, SimResultData.StepWipSchema.TARGET_DATE, ">=",
                                          this.FromTime.ToString(), "AND");
            filter = Globals.CreateFilter(filter, SimResultData.StepWipSchema.TARGET_DATE, "<",
                                          this.ToTime.ToString(), "AND");

            DataTable dtStepWip      = _result.LoadOutput(SimResultData.OutputName.StepWip, filter);
            var       prodsInStepWip = ComboHelper.Distinct(dtStepWip, SimResultData.StepWipSchema.PRODUCT_ID, string.Empty);

            var seleProds = prodIDs.Where(x => prodsInStepWip.Contains(x));

            foreach (var item in seleProds)
            {
                this.prodIdCheckedComboBoxEdit.Properties.Items.Add(item.ToString());
            }

            this.prodIdCheckedComboBoxEdit.CheckAll();
        }