Пример #1
0
        private void toolStripButtonEDIT_Click(object sender, EventArgs e)
        {
            object[] oT = new object[dataGridViewDJMX.ColumnCount];

            if (dataGridViewDJMX.SelectedRows.Count < 1)
            {
                MessageBox.Show("请选择要修改的库房", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            dSet.Tables["库房表1"].Clear();
            DataTable dt = dSet.Tables["库房表1"];

            for (int i = dataGridViewDJMX.SelectedRows.Count - 1; i >= 0; i--)
            {
                for (int j = 0; j < oT.Length; j++)
                {
                    oT[j] = dataGridViewDJMX.SelectedRows[i].Cells[j].Value;
                }
                dt.Rows.Add(oT);
            }

            FormKFDAWH_CARD frmKFDAWH_CARD = new FormKFDAWH_CARD();

            frmKFDAWH_CARD.strConn = strConn;
            frmKFDAWH_CARD.dt      = dt;
            frmKFDAWH_CARD.iStyle  = 1;

            frmKFDAWH_CARD.ShowDialog();
            initDataView();
        }
Пример #2
0
        private void ToolStripButtonADD_Click(object sender, EventArgs e)
        {
            dSet.Tables["库房表1"].Clear();
            DataTable dt = dSet.Tables["库房表1"];

            FormKFDAWH_CARD frmKFDAWH_CARD = new FormKFDAWH_CARD();

            frmKFDAWH_CARD.strConn = strConn;
            frmKFDAWH_CARD.dt      = dt;
            frmKFDAWH_CARD.iStyle  = 0;

            frmKFDAWH_CARD.ShowDialog();
            initDataView();
        }