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

            FormZYDAWH_CARD frmZYDAWH_CARD = new FormZYDAWH_CARD();

            frmZYDAWH_CARD.strConn = strConn;
            frmZYDAWH_CARD.dt      = dt;
            frmZYDAWH_CARD.iStyle  = 1;

            frmZYDAWH_CARD.ShowDialog();
            initDataView();
        }
Exemple #2
0
        private void ToolStripButtonADD_Click(object sender, EventArgs e)
        {
            dSet.Tables["职员表1"].Clear();
            DataTable dt = dSet.Tables["职员表1"];

            FormZYDAWH_CARD frmZYDAWH_CARD = new FormZYDAWH_CARD();

            frmZYDAWH_CARD.strConn = strConn;
            frmZYDAWH_CARD.dt      = dt;
            frmZYDAWH_CARD.iStyle  = 0;

            frmZYDAWH_CARD.ShowDialog();
            initDataView();
        }