private void InitMaintainGrid() { var eqptMaintainBll = new BLL.EqptMaintain(); _eqptMaintians = eqptMaintainBll.GetModelList(String.Format("SmId = {0} and LayerName = '{1}'", _smId, _layerInfo.LayerName)); gc_Maintain.DataSource = _eqptMaintians; }
private void btn_DeleteMaintain_Click(object sender, EventArgs e) { if (gv_Maintain.FocusedRowHandle < 0) { XtraMessageBox.Show("当前未选中维护记录!", "提示"); return; } var maintainId = Convert.ToInt32(gv_Maintain.GetFocusedRowCellValue("Id")); if (XtraMessageBox.Show("删除后不可恢复,您确定要删除?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { var eqptMaintainBll = new BLL.EqptMaintain(); if (eqptMaintainBll.Delete(maintainId)) { var eqptMaintain = _eqptMaintians.First(m => m.Id == maintainId); _eqptMaintians.Remove(eqptMaintain); gc_Maintain.RefreshDataSource(); } } }
private void InitMaintainGrid() { var eqptMaintainBll = new BLL.EqptMaintain(); _eqptMaintians = eqptMaintainBll.GetModelList(String.Format("SmId = {0} and LayerName = '{1}'", _smId, _layerInfo.LayerName)); gc_Maintain.DataSource = _eqptMaintians; }
private void btn_DeleteMaintain_Click(object sender, EventArgs e) { if (gv_Maintain.FocusedRowHandle < 0) { XtraMessageBox.Show("当前未选中维护记录!", "提示"); return; } var maintainId = Convert.ToInt32(gv_Maintain.GetFocusedRowCellValue("Id")); if (XtraMessageBox.Show("删除后不可恢复,您确定要删除?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { var eqptMaintainBll = new BLL.EqptMaintain(); if(eqptMaintainBll.Delete(maintainId)) { var eqptMaintain = _eqptMaintians.First(m => m.Id == maintainId); _eqptMaintians.Remove(eqptMaintain); gc_Maintain.RefreshDataSource(); } } }