コード例 #1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (G.Authority == "D")
            {
                return;
            }
            if (e.RowIndex < 0)
            {
                return;
            }
            if (e.ColumnIndex != 5)
            {
                return;
            }

            string         sNo  = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
            P1B05_DELIVERY form = new P1B05_DELIVERY();

            if (formIsExist(form.GetType()))
            {
                form.Dispose();
            }
            else
            {
                MDIForm parent = (MDIForm)this.MdiParent;
                form.MdiParent = parent;
                form.Dock      = DockStyle.Fill;
                form.Show();

                form.tbSearch.Text = "";
                form.ListSearch1();

                for (int i = 0; i < form.dataGridViewList.Rows.Count; i++)
                {
                    if (form.dataGridViewList.Rows[i].Cells[0].Value.ToString() == sNo)
                    {
                        form.dataGridViewList.CurrentCell          = form.dataGridViewList[2, i];
                        form.dataGridViewList.CurrentCell.Selected = true;

                        form.ListSearch2(i);
                        form.ListSearch3();
                        form.ListSearch4();
                        break;
                    }
                }
            }
        }
コード例 #2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (G.Authority == "D")
            {
                return;
            }
            if (e.RowIndex < 0)
            {
                return;
            }

            string sNo = string.Empty;

            if (e.ColumnIndex == 12) //견적
            {
                //sNo = dataGridView1.Rows[e.RowIndex].Cells[10].Value.ToString();
                //P1B01_ESTIMATE form = new P1B01_ESTIMATE();

                //if (formIsExist(form.GetType()))
                //    form.Dispose();
                //else
                //{
                //    MDIForm parent = (MDIForm)this.MdiParent;
                //    form.MdiParent = parent;
                //    form.Dock = DockStyle.Fill;
                //    form.Show();
                //    form.tbSearch.Text = "";
                //    form.ListSearch1();

                //    for (int i = 0; i < form.dataGridViewList.Rows.Count; i++)
                //    {
                //        if (form.dataGridViewList.Rows[i].Cells[0].Value.ToString() == sNo)
                //        {
                //            form.dataGridViewList.CurrentCell = form.dataGridViewList[2, i];
                //            form.dataGridViewList.CurrentCell.Selected = true;
                //            form.ListSearch2(i);
                //            form.ListSearch3();
                //            form.ListSearch4();
                //            break;
                //        }
                //    }
                //}
            }
            else if (e.ColumnIndex == 13) //수주
            {
                sNo = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                P1B03_RORDER form = new P1B03_RORDER();

                if (formIsExist(form.GetType()))
                {
                    form.Dispose();
                }
                else
                {
                    MDIForm parent = (MDIForm)this.MdiParent;
                    form.MdiParent = parent;
                    form.Dock      = DockStyle.Fill;
                    form.Show();
                    form.tbSearch.Text = "";
                    form.ListSearch1();

                    for (int i = 0; i < form.dataGridViewList.Rows.Count; i++)
                    {
                        if (form.dataGridViewList.Rows[i].Cells[0].Value.ToString() == sNo)
                        {
                            form.dataGridViewList.CurrentCell          = form.dataGridViewList[2, i];
                            form.dataGridViewList.CurrentCell.Selected = true;
                            form.ListSearch2(i);
                            form.ListSearch3();
                            form.ListSearch4();
                            break;
                        }
                    }
                }
            }
            else if (e.ColumnIndex == 15) //생산
            {
                //
            }
            else if (e.ColumnIndex == 16) //출하
            {
                sNo = dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString();
                P1B05_DELIVERY form = new P1B05_DELIVERY();

                if (formIsExist(form.GetType()))
                {
                    form.Dispose();
                }
                else
                {
                    MDIForm parent = (MDIForm)this.MdiParent;
                    form.MdiParent = parent;
                    form.Dock      = DockStyle.Fill;
                    form.Show();
                    form.tbSearch.Text = "";
                    form.ListSearch1();

                    for (int i = 0; i < form.dataGridViewList.Rows.Count; i++)
                    {
                        if (form.dataGridViewList.Rows[i].Cells[0].Value.ToString() == sNo)
                        {
                            form.dataGridViewList.CurrentCell          = form.dataGridViewList[2, i];
                            form.dataGridViewList.CurrentCell.Selected = true;
                            form.ListSearch2(i);
                            form.ListSearch3();
                            form.ListSearch4();
                            break;
                        }
                    }
                }
            }
            else
            {
                return;
            }
        }