Пример #1
0
        /// <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);
                }
            }
        }
Пример #2
0
        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("没有选中数据", "提示");
            }
        }
Пример #3
0
        /// <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);
                }
            }
        }