private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e) { // SJBMC,ZDMC,SY,SSJCX,LX string ID = dataGridView1.Rows[e.RowIndex].Cells["ID"].Value.ToString(); string BH = dataGridView1.Rows[e.RowIndex].Cells["BH"].Value.ToString(); string MTable = dataGridView1.Rows[e.RowIndex].Cells["MTable"].Value.ToString(); string STable = dataGridView1.Rows[e.RowIndex].Cells["STable"].Value.ToString(); string BZTable = dataGridView1.Rows[e.RowIndex].Cells["BZTable"].Value.ToString(); string YTable = dataGridView1.Rows[e.RowIndex].Cells["YTable"].Value.ToString(); string DataFiled = dataGridView1.Rows[e.RowIndex].Cells["DataFiled"].Value.ToString(); ProjectInfos project = new ProjectInfos(); ProjectInfo info = new ProjectInfo(); info.ID = Convert.ToInt16(ID); info.BH = BH; info.MTable = MTable; info.STable = STable; info.BZTable = BZTable; info.YTable = YTable; info.DataFiled = DataFiled; int ret = project.UpdateProInfos(info); if (ret == -1) { MessageBox.Show("修改失败"); } }
public FormMain() { InitializeComponent(); this.StartPosition = FormStartPosition.CenterScreen; _projectInfo = new ProjectInfos(); Init(); CalInit(); InitBaseData(); _qybh = ConfigurationHelper.GetConfig("Qybh"); }