Exemple #1
0
        private void 添加检验项目ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QC_QualityRule rule = this.matQualityRuleBindingSource.Current as QC_QualityRule;

            if (rule != null)
            {
                List <string> filterIds = new List <string>();
                DlgCheckItem  dlg       = null;
                if (string.IsNullOrEmpty(this.selectedMaterial.MatNcId))
                {
                    dlg = new DlgCheckItem(filterIds);
                }
                else
                {
                    dlg = new DlgCheckItem(filterIds, this.selectedMaterial.MatNcId);
                }

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    if (dlg.SelectedCheckItem != null)
                    {
                        QC_QualityRuleContent qrc = new QC_QualityRuleContent();
                        qrc.CheckItemNcId = dlg.SelectedCheckItem.CheckItemNcId;
                        qrc.CheckItemCode = dlg.SelectedCheckItem.CheckItemCode;
                        qrc.CheckItemName = dlg.SelectedCheckItem.CheckItemName;
                        qrc.Relation      = "<=";
                        qrc.ConstraintVal = 0;
                        rule.RuleContents.Add(qrc);
                    }
                }
            }
        }
Exemple #2
0
        private void  除条件ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QC_QualityRuleContent selData = this.ruleContentsBindingSource.Current as QC_QualityRuleContent;

            if (selData != null)
            {
                if (MessageBox.Show("确实要删除此判定条件吗?", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    this.ruleContentsBindingSource.RemoveCurrent();
                }
            }
            else
            {
                MessageBox.Show("没有选中数据", "提示");
            }
        }