コード例 #1
0
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            StockOp op = new StockOp(true);

            if (DialogResult.OK == op.ShowDialog())
            {
                Stock_Load(this, null);
            }
        }
コード例 #2
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!UserCombine.GetuserCanBeLogistics().Contains((int)UserInfo.Job))
            {
                return;
            }

            if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
            {
                if (e.RowIndex > dataGridView1.RowCount - 1)
                {
                    return;
                }

                //get the real index.
                int stockId = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value);

                AmbleClient.AmbleStock.stockDataSet.amblestockRow selectedRow = null;

                foreach (AmbleClient.AmbleStock.stockDataSet.amblestockRow row in this.stockDataSet1.amblestock.Rows)
                {
                    if (row.stockId == stockId)
                    {
                        selectedRow = row;
                        break;
                    }
                }
                if (selectedRow != null)
                {
                    StockOp op = new StockOp(false);
                    op.FillTheTable(selectedRow);
                    if (DialogResult.OK == op.ShowDialog())
                    {
                        Stock_Load(this, null);
                    }
                }
            }
            RestoreSelectedRow();
        }