private void btn_DutyEdit_Click(object sender, EventArgs e) { if (dgv_LawsFileInfo.SelectedRows.Count < 1) { MessageBox.Show("请选中一行数据!"); return; } CADS.Model.LawsFileInfo lawsFileInfo = new CADS.Model.LawsFileInfo(); lawsFileInfo.ID = Convert.ToInt32(dgv_LawsFileInfo.CurrentRow.Cells[0].Value); lawsFileInfo.FileName = dgv_LawsFileInfo.CurrentRow.Cells[1].Value.ToString(); lawsFileInfo.FileType = dgv_LawsFileInfo.CurrentRow.Cells[2].Value.ToString(); lawsFileInfo.IssueTime = dgv_LawsFileInfo.CurrentRow.Cells[3].Value.ToString(); lawsFileInfo.IssueOrganization = dgv_LawsFileInfo.CurrentRow.Cells[4].Value.ToString(); lawsFileInfo.IssueVersion = dgv_LawsFileInfo.CurrentRow.Cells[5].Value.ToString(); lawsFileInfo.FilePath = dgv_LawsFileInfo.CurrentRow.Cells[6].Value.ToString(); lawsFileInfo.Descrpition = dgv_LawsFileInfo.CurrentRow.Cells[7].Value.ToString(); Form_LawFileAdd addOrEdit = new Form_LawFileAdd("edit", lawsFileInfo); addOrEdit.ShowDialog(); if (addOrEdit.DialogResult == DialogResult.OK) { OpreationDB("编辑", addOrEdit.lawsFileInfo); RefreshDataGridView(); } }
private void btn_AddFile_Click(object sender, EventArgs e) { Form_LawFileAdd addOrEdit = new Form_LawFileAdd("add"); addOrEdit.ShowDialog(); if (addOrEdit.DialogResult == DialogResult.OK) { OpreationDB("添加", addOrEdit.lawsFileInfo); RefreshDataGridView(); } }