private void btnInStore_Click(object sender, EventArgs e) { FrmSupplier_Oper frm = new FrmSupplier_Oper(); frm.ShowDialog(); BindData(); }
private void BtnAdd_Click(object sender, EventArgs e) { FrmSupplier_Oper frmEdit = new FrmSupplier_Oper(String.Empty, true); if (frmEdit.ShowDialog() == DialogResult.OK) { BindData(); } }
private void btnAdd_Click(object sender, EventArgs e) { FrmSupplier_Oper frmEdit = new FrmSupplier_Oper(Guid.NewGuid().ToString(), eEditMode.新增); if (frmEdit.ShowDialog() == DialogResult.OK) { BindData(); } }
private void superGridControl1_CellMouseDown(object sender, DevComponents.DotNetBar.SuperGrid.GridCellMouseEventArgs e) { CmcsSupplier entity = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString()); switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name) { case "clmShow": FrmSupplier_Oper frmShow = new FrmSupplier_Oper(entity.Id, false); if (frmShow.ShowDialog() == DialogResult.OK) { BindData(); } break; case "clmEdit": FrmSupplier_Oper frmEdit = new FrmSupplier_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 <CmcsSupplier>(entity.Id); } catch (Exception) { MessageBoxEx.Show("该供应商正在使用中,禁止删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } BindData(); } break; } }