private void OnModifyDevCfg() { string id = this.textBox5.Text; MesDBAccess.BLL.DevLineBatteryCfgBll devCfgBll = new MesDBAccess.BLL.DevLineBatteryCfgBll(); MesDBAccess.Model.DevLineBatteryCfgModel devCfgModel = devCfgBll.GetModel(id); if (devCfgModel == null) { MessageBox.Show(string.Format("不存在的配置:{0}", id), "提示"); return; } devCfgModel.batteryCataCode = this.comboBox4.Text; devCfgModel.mark = this.textBox4.Text; devCfgBll.Update(devCfgModel); }
private void dataGridView2_RowEnter(object sender, DataGridViewCellEventArgs e) { //Console.WriteLine("hh{0}",e.RowIndex); string id = this.dataGridView2.Rows[e.RowIndex].Cells["DevBatteryCfgID"].Value.ToString(); MesDBAccess.BLL.DevLineBatteryCfgBll devCfgBll = new MesDBAccess.BLL.DevLineBatteryCfgBll(); MesDBAccess.Model.DevLineBatteryCfgModel devCfgModel = devCfgBll.GetModel(id); if (devCfgModel == null) { Console.WriteLine("不存在的配置:{0}", id); return; } this.textBox5.Text = devCfgModel.DevBatteryCfgID; this.comboBox4.Text = devCfgModel.batteryCataCode; this.textBox4.Text = devCfgModel.mark; }