コード例 #1
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();
        }
コード例 #2
0
 public void FillTheTable(AmbleClient.AmbleStock.stockDataSet.amblestockRow row)
 {
     this.stockId = row.stockId;
     tbMpn.Text   = row.mpn;
     tbMfg.Text   = row.mfg;
     tbDc.Text    = row.dc;
     try
     {
         tbQty.Text = row.qty.ToString();
     }
     catch
     {
         tbQty.Text = "";
     }
     try
     {
         tbResale.Text = row.resale.ToString();
     }
     catch
     {
         tbResale.Text = "";
     }
     try
     {
         tbCost.Text = row.cost.ToString();
     }
     catch
     {
         tbCost.Text = "";
     }
     tbPacking.Text = row.packing;
     tbContact.Text = row.contact;
     cbStatus.Text  = row.statu;
     tbNotes.Text   = row.notes;
     tbDate.Text    = row.stockDate;
 }