private void 添加检验项目ToolStripMenuItem1_Click(object sender, EventArgs e) { if (this.selectedMaterial != null) { List <string> filterIds = new List <string>(); foreach (var item in selectedMaterial.AllCheckItem) { filterIds.Add(item.CheckItemNcId); } DlgCheckItem dlg = new DlgCheckItem(filterIds); if (dlg.ShowDialog() == DialogResult.OK) { if (dlg.SelectedCheckItem != null) { QC_MatAllCheckItem qrc = new QC_MatAllCheckItem(); qrc.CheckItemNcId = dlg.SelectedCheckItem.CheckItemNcId; qrc.CheckItemCode = dlg.SelectedCheckItem.CheckItemCode; qrc.CheckItemName = dlg.SelectedCheckItem.CheckItemName; this.selectedMaterial.AllCheckItem.Add(qrc); } } } else { MessageBox.Show("没有选中数据", "提示"); } }
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); } } } }
/// <summary> /// 添加检验项目 /// </summary> private void tsmBtnAddCheckItem_Click(object sender, EventArgs e) { DlgCheckItem dlg = new DlgCheckItem(); if (dlg.ShowDialog() == DialogResult.OK) { if (dlg.SelectedCheckItem != null) { var ck = from c in curData.CheckItems where c.CheckItemCode == dlg.SelectedCheckItem.CheckItemNcId select c; if (ck.Count <QC_MixCheckItem>() > 0) { MessageBox.Show("已有此检验项目"); return; } QC_MixCheckItem sv = new QC_MixCheckItem(); sv.CheckItemNcId = dlg.SelectedCheckItem.CheckItemNcId; sv.CheckItemCode = dlg.SelectedCheckItem.CheckItemCode; sv.CheckItemName = dlg.SelectedCheckItem.CheckItemName; sv.CheckItemUnit = dlg.SelectedCheckItem.CheckItemUnit; sv.Source = "检验样"; curData.CheckItems.Add(sv); } } }
/// <summary> /// 添加检验项目 /// </summary> private void tsmBtnAddCheckItem_Click(object sender, EventArgs e) { DlgCheckItem dlg = new DlgCheckItem(); if (dlg.ShowDialog() == DialogResult.OK) { if (dlg.SelectedCheckItem != null) { QC_MixCheckItem sv = new QC_MixCheckItem(); sv.CheckItemNcId = dlg.SelectedCheckItem.CheckItemNcId; sv.CheckItemCode = dlg.SelectedCheckItem.CheckItemCode; sv.CheckItemName = dlg.SelectedCheckItem.CheckItemName; sv.CheckItemUnit = dlg.SelectedCheckItem.CheckItemUnit; sv.Source = "检验样"; currentData.CheckItems.Add(sv); } } }
private void 添加检验项目ToolStripMenuItem_Click(object sender, EventArgs e) { if (this.curData != null) { List <string> filterIds = new List <string>(); foreach (var item in curData.CheckItems) { filterIds.Add(item.CheckItemNcId); } DlgCheckItem dlg = null; if (string.IsNullOrEmpty(this.curData.MatPK)) { dlg = new DlgCheckItem(filterIds); } else { dlg = new DlgCheckItem(filterIds, this.curData.MatPK); } if (dlg.ShowDialog() == DialogResult.OK) { if (dlg.SelectedCheckItem != null) { QC_MixCheckItem qrc = new QC_MixCheckItem(); qrc.CheckItemNcId = dlg.SelectedCheckItem.CheckItemNcId; qrc.CheckItemCode = dlg.SelectedCheckItem.CheckItemCode; qrc.CheckItemName = dlg.SelectedCheckItem.CheckItemName; qrc.CheckItemUnit = dlg.SelectedCheckItem.CheckItemUnit; qrc.CheckGroupCode = dlg.SelectedCheckItem.CheckGroupCode; qrc.SetDataStateAsAdded(); this.curData.CheckItems.Add(qrc); } } } else { MessageBox.Show("没有选中数据", "提示"); } }