Exemple #1
0
        private void dgvljjl_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //MessageBox.Show(e.ColumnIndex.ToString());
            this.tabControl_main.SelectedIndex = 1;
            if (e.RowIndex >= 0 && e.RowIndex < dgvljjl.Rows.Count && e.ColumnIndex >= 0 && e.ColumnIndex < dgvljjl.Columns.Count)
            {
                // MessageBox.Show(dgvljjl.Columns.Count.ToString() + " "+ e.ColumnIndex);
                if (dgvljjl.Columns[e.ColumnIndex].HeaderText == "零件类型基础管理")
                {
                    addparts addp    = new addparts();
                    string   ljh     = dgvljjl.Rows[e.RowIndex].Cells["PN"].Value.ToString();
                    string   Barcode = dgvljjl.Rows[e.RowIndex].Cells["Barcode"].Value.ToString();
                    addp.setenableSetValue(ljh, Barcode);
                    addp.ShowDialog();
                    return;

                    MessageBox.Show("设置位置");
                }
                string id = dgvljjl.Rows[e.RowIndex].Cells["component"].Value.ToString();
                this.textBox_query.Text = id;
                string where_str = "";
                // 通过零件的id或者零件的名字
                where_str += string.Format("  componentId= '{0}' ", this.textBox_query.Text);

                Maticsoft.BLL.component com_bll = new Maticsoft.BLL.component();
                DataSet   ds = com_bll.GetListByPage2(where_str, "", cur_step, cur_step + cur_page_lenb);
                DataTable dt = ds.Tables[0];
                this.dataGridView1.DataSource = dt;
            }
            else
            {
                //  MessageBox.Show("选中了无效的行");
            }
        }
Exemple #2
0
        private void buttolj_add_Click(object sender, EventArgs e)
        {
            addparts add_from = new addparts();

            if (DialogResult.OK == add_from.ShowDialog())
            {
                requery2();
            }
        }