Esempio n. 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);
                    }
                }
            }
        }
Esempio n. 2
0
        private void btnImportJudgeRule_Click(object sender, EventArgs e)
        {
            if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                DbEntityTable <QC_QualityRule> rules = new DbEntityTable <QC_QualityRule>();
                DataTable dt = Xg.Tools.ExcelHelper.ImportExcelFile(this.openFileDialog1.FileName);
                DbEntityTable <QC_Material> mats = new DbEntityTable <QC_Material>();
                mats.LoadData();

                for (int i = 1; i < dt.Rows.Count; i++)
                {
                    string matCode = dt.Rows[i][0].ToString().Trim();

                    var mat = from m in mats
                              where m.MatCode == matCode
                              select m;

                    QC_QualityRule rule = new QC_QualityRule();
                    rule.MatNcId      = mat.First <QC_Material>().MatNcId;
                    rule.LocalQcLevel = dt.Rows[i][2].ToString().Trim();
                    switch (rule.LocalQcLevel)
                    {
                    case "一级":
                        rule.RuleOrder = 1;
                        break;

                    case "二级":
                        rule.RuleOrder = 2;
                        break;

                    case "三级":
                        rule.RuleOrder = 3;
                        break;

                    default:
                        rule.RuleOrder = 4;
                        break;
                    }
                    string ruleContent = dt.Rows[i][3].ToString().Trim();
                    rule.RuleStr2Contents(ruleContent);
                    rule.QualityLevelID = "1001NC100000002GF3MN";
                    rules.Add(rule);
                }
                rules.Save();
            }
        }
Esempio n. 3
0
        private void  择供应商_Click_1(object sender, EventArgs e)
        {
            DlgSupplier    dlg  = new DlgSupplier();
            QC_QualityRule rule = this.matQualityRuleBindingSource.Current as QC_QualityRule;

            if (rule != null)
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    if (dlg.SelectedSupplier != null)
                    {
                        rule.SupplierCode = dlg.SelectedSupplier.CUSTCODE;
                        rule.SupplierName = dlg.SelectedSupplier.CUSTSHORTNAME;
                    }
                }
            }
            else
            {
                MessageBox.Show("没有选中数据", "提示");
            }
        }