Esempio n. 1
0
        private void lblProd_Click(object sender, EventArgs e)
        {
            lblMsg.Text = "";

            ProdFinder pop = new ProdFinder();

            pop.cbGubun.Text   = "<전체>";
            pop._kind          = "%";
            pop._stockFlag     = "1";
            pop.FormSendEvent += new ProdFinder.FormSendDataHandler(ProdEventMethod);
            pop.ShowDialog();
        }
Esempio n. 2
0
        private void lblProd_Click(object sender, EventArgs e)
        {
            if (G.Authority == "D")
            {
                return;
            }

            ProdFinder pop = new ProdFinder();

            pop.cbGubun.SelectedIndex = 0;
            pop._kind          = "%";
            pop._stockFlag     = "%";
            pop.FormSendEvent += new ProdFinder.FormSendDataHandler(ProdEventMethod);
            pop.ShowDialog();
        }
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            lblMsg.Text = "";
            if (G.Authority == "D")
            {
                return;
            }
            if (e.RowIndex < 0)
            {
                return;
            }

            if (e.ColumnIndex == 3) //"품목"
            {
                ProdFinder pop = new ProdFinder();
                pop.cbGubun.SelectedIndex = 1;
                pop._kind          = "%";
                pop._stockFlag     = "%";
                pop.FormSendEvent += new ProdFinder.FormSendDataHandler(ProdEventMethod);
                pop.ShowDialog();
            }
            else if (e.ColumnIndex == 23) //"도면 자료관리"
            {
                int lastRow = dataGridView1.Rows.GetLastRow(DataGridViewElementStates.Visible);
                if (e.RowIndex == lastRow)
                {
                    return;
                }

                if ((dataGridView1.Rows[e.RowIndex].Cells[0].Value == null ||
                     string.IsNullOrEmpty(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString())) ||
                    (dataGridView1.Rows[e.RowIndex].Cells[1].Value == null ||
                     string.IsNullOrEmpty(dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString())))
                {
                    lblMsg.Text = "저장 후 사용이 가능합니다.";
                    return;
                }

                P1B03_RORDER_DOC sub = new P1B03_RORDER_DOC();
                sub.parentWin = this;
                sub.rowIdx    = e.RowIndex;
                sub.sNo       = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                sub.sSeq      = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
                sub.sFileName = dataGridView1.Rows[e.RowIndex].Cells[22].Value.ToString();
                sub.ShowDialog();
            }
            else if (e.ColumnIndex == 24) //"X"
            {
                try
                {
                    string sNo = tbNo.Text;

                    if (string.IsNullOrEmpty(sNo))
                    {
                        dataGridView1.Rows.Remove(dataGridView1.Rows[e.RowIndex]);
                        return;
                    }

                    if (dataGridView1.Rows[e.RowIndex].Cells[1].Value == null ||
                        string.IsNullOrEmpty(dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString()))
                    {
                        dataGridView1.Rows.Remove(dataGridView1.Rows[e.RowIndex]);
                        return;
                    }

                    string sSeq = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();

                    DialogResult dr = MessageBox.Show("해당 정보를 삭제하시겠습니까?", this.lblTitle.Text + "[삭제]", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    if (dr == DialogResult.No)
                    {
                        return;
                    }

                    MariaCRUD m   = new MariaCRUD();
                    string    sql = "delete from tb_rorder_sub where rorder_id = '" + sNo + "' and rorder_seq = " + sSeq;
                    string    msg = string.Empty;
                    m.dbCUD(sql, ref msg);

                    if (msg != "OK")
                    {
                        MessageBox.Show(msg);
                        return;
                    }

                    //string sEstimateNo = dataGridView1.Rows[e.RowIndex].Cells[17].Value.ToString();
                    //string sEstimateSeq = dataGridView1.Rows[e.RowIndex].Cells[18].Value.ToString();
                    //if (!string.IsNullOrEmpty(sEstimateNo))
                    //{
                    //    sql = "update tb_estimate_sub set rorder_flag = 0 where estimate_id = '" + sEstimateNo + "' and estimate_seq = " + sEstimateSeq;
                    //    m.dbCUD(sql, ref msg);
                    //}

                    dataGridView1.Rows.Remove(dataGridView1.Rows[e.RowIndex]);
                    m.TransLogCreate(G.Authority, G.UserID, "D", this.Name, lblTitle.Text, sNo + " " + sSeq);
                }
                catch (Exception)
                {
                    return;
                }
            }

            ListSearch4();
        }