private void btnInStore_Click(object sender, EventArgs e) { FrmCommonAutotruck_Oper frm = new FrmCommonAutotruck_Oper(); frm.ShowDialog(); BindData(); }
private void BtnAdd_Click(object sender, EventArgs e) { FrmCommonAutotruck_Oper frmEdit = new FrmCommonAutotruck_Oper(String.Empty, true); if (frmEdit.ShowDialog() == DialogResult.OK) { BindData(); } }
private void superGridControl1_CellMouseDown(object sender, DevComponents.DotNetBar.SuperGrid.GridCellMouseEventArgs e) { CmcsAutotruck entity = Dbers.GetInstance().SelfDber.Get <CmcsAutotruck>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString()); switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name) { case "clmShow": FrmCommonAutotruck_Oper frmShow = new FrmCommonAutotruck_Oper(entity.Id, false); if (frmShow.ShowDialog() == DialogResult.OK) { BindData(); } break; case "clmEdit": FrmCommonAutotruck_Oper frmEdit = new FrmCommonAutotruck_Oper(entity.Id, true); if (frmEdit.ShowDialog() == DialogResult.OK) { BindData(); } break; case "clmDelete": // 查询正在使用该车牌号的车数 if (MessageBoxEx.Show("确定要删除该车牌号?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { Dbers.GetInstance().SelfDber.Delete <CmcsAutotruck>(entity.Id); } catch (Exception) { MessageBoxEx.Show("该车牌号正在使用中,禁止删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } BindData(); } break; } }