Exemple #1
0
        private void tsbtn_Add_Click(object sender, EventArgs e)
        {
            FrmNEGoods fneg = new FrmNEGoods();

            fneg.ne = 0;
            fneg.Show();
        }
Exemple #2
0
        private void tsbtn_Edit_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count != 0)
            {
                FrmNEGoods fneg = new FrmNEGoods();
                fneg.ne = 1;

                fneg.gid       = dataGridView1.SelectedCells[0].Value.ToString().Trim();
                fneg.gname     = dataGridView1.SelectedCells[1].Value.ToString().Trim();
                fneg.gcid      = dataGridView1.SelectedCells[2].Value.ToString().Trim();
                fneg.gprice    = dataGridView1.SelectedCells[3].Value.ToString().Trim();
                fneg.gbid      = dataGridView1.SelectedCells[4].Value.ToString().Trim();
                fneg.gunit     = dataGridView1.SelectedCells[7].Value.ToString().Trim();
                fneg.gsupplier = dataGridView1.SelectedCells[10].Value.ToString().Trim();
                fneg.gnotes    = dataGridView1.SelectedCells[11].Value.ToString().Trim();
                fneg.id        = dataGridView1.SelectedCells[12].Value.ToString().Trim();

                fneg.Show();
            }
            else
            {
                MessageBox.Show("请选择要修改的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }