private void toolStripButton4_Click(object sender, EventArgs e) { if (!PowerCheckCsClass.IfHasPower(LoginClass.LogID, CommFunction.GSYSNAME, sender, CommFunction.ConnectString)) { return; } if (dataGridView1.Rows.Count <= 0) { return; } FrmEditCode.falg = "Edit"; FrmEditCode.pLx = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[0].Value.ToString(); FrmEditCode.pDm = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[1].Value.ToString(); FrmEditCode.pMc = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[2].Value.ToString(); FrmEditCode.pPym = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[3].Value.ToString(); FrmEditCode.pBz = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[4].Value.ToString(); FrmEditCode.pBl1 = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[5].Value.ToString(); FrmEditCode.pBl2 = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[6].Value.ToString(); FrmEditCode.pBl3 = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[7].Value.ToString(); FrmEditCode.pBl4 = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[8].Value.ToString(); FrmEditCode.pBl5 = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[9].Value.ToString(); FrmEditCode.pBl6 = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[10].Value.ToString(); FrmEditCode.pBl7 = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[11].Value.ToString(); FrmEditCode.pBl8 = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[12].Value.ToString(); FrmEditCode.pBl9 = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[13].Value.ToString(); FrmEditCode.pBl10 = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[14].Value.ToString(); FrmEditCode.pTy = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells[17].Value.ToString(); FrmEditCode.ShowUniqueForm(true); if (FrmEditCode.ifSave) { OleDbDataAdapter sda = new OleDbDataAdapter(ResultSelect, CommFunction.ConnectString); DataSet ds = new DataSet(); sda.Fill(ds, "chk_con2"); dataGridView1.DataSource = ds.Tables["chk_con2"]; dataGridView1.AutoResizeColumns(); } }
private void 新增ToolStripMenuItem_Click(object sender, EventArgs e) { if (!PowerCheckCsClass.IfHasPower(LoginClass.LogID, CommFunction.GSYSNAME, sender, CommFunction.ConnectString)) { return; } FrmEditCode.falg = "Add"; FrmEditCode.ShowUniqueForm(true); if (FrmEditCode.ifSave) { string sql = "select type as 类型,ysid as 代码,ysfs as 名称,pym as 拼音码,memo as 备注,reserve1 as 保留字段1,reserve2 as 保留字段2,reserve3 as 保留字段3," + "reserve4 as 保留字段4,reserve5 as 保留字段5,reserve6 as 保留字段6,reserve7 as 保留字段7,reserve8 as 保留字段8," + "reserve9 as 保留字段9,reserve10 as 保留字段10,create_date_time as 创建时间,user_name as 操作员,flag as 是否停用 " + "from ysfs where 1=1 and type in (" + FrmEditCode.ResultCode_type + "') and ysid in (" + FrmEditCode.ResultCode_id + "') order by type,ysid"; OleDbDataAdapter sda = new OleDbDataAdapter(sql, CommFunction.ConnectString); DataSet ds = new DataSet(); sda.Fill(ds, "chk_con2"); dataGridView1.DataSource = ds.Tables["chk_con2"]; dataGridView1.AutoResizeColumns(); } }