Example #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);
            }

            FormDWDAWH_CARD frmDWDAWH_CARD = new FormDWDAWH_CARD();

            frmDWDAWH_CARD.strConn = strConn;
            frmDWDAWH_CARD.dt      = dt;
            frmDWDAWH_CARD.iStyle  = 1;

            frmDWDAWH_CARD.ShowDialog();
            initDataView(frmDWDAWH_CARD.iSelect);
        }
Example #2
0
        private void ToolStripButtonADD_Click(object sender, EventArgs e)
        {
            dSet.Tables["单位表1"].Clear();
            DataTable dt = dSet.Tables["单位表1"];

            FormDWDAWH_CARD frmDWDAWH_CARD = new FormDWDAWH_CARD();

            frmDWDAWH_CARD.strConn = strConn;
            frmDWDAWH_CARD.dt      = dt;
            frmDWDAWH_CARD.iStyle  = 0;

            frmDWDAWH_CARD.ShowDialog();
            initDataView(frmDWDAWH_CARD.iSelect);
        }