예제 #1
0
        private void btAddComponents_Click(object sender, EventArgs e)
        {
            frmDirectoryHardWareAndComponents frm = new frmDirectoryHardWareAndComponents();

            //frm.Text = "Добавить комплектующие";
            frm.setComponentes();
            if (DialogResult.OK == frm.ShowDialog())
            {
                DataRow addRow = dtData.Rows.Add();
                addRow["id"]           = -1;
                addRow["cName"]        = frm.getSendName();
                addRow["id_component"] = frm.getSendId();
                dtData.AcceptChanges();
                dgvData.Refresh();
                isEdit = true;
            }
        }
        private void btSelect_Click(object sender, EventArgs e)
        {
            frmDirectoryHardWareAndComponents frm = new frmDirectoryHardWareAndComponents();

            if (type == 0)
            {
                frm.setHardwaress();
            }
            else if (type == 1)
            {
                frm.setComponentes();
            }

            if (DialogResult.OK == frm.ShowDialog())
            {
                isHardWare  = frm.getIsHardWare();
                tbName.Text = frm.getSendName();
                idHardWare  = frm.getSendId();
            }
        }