private void superGridControl1_CellMouseDown(object sender, DevComponents.DotNetBar.SuperGrid.GridCellMouseEventArgs e) { CmcsBuyFuelTransportDeduct entity = cmcsbuyfueltransportdeducts.Where(a => a.Id == superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString()).FirstOrDefault(); switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name) { case "clmShow": FrmBuyFuelTransportDeduct_Oper frmShow = new FrmBuyFuelTransportDeduct_Oper(entity.Id, eEditMode.查看); if (frmShow.ShowDialog() == DialogResult.OK) { ShowDeduct(this.CmcsBuyFuelTransport.Id); } break; case "clmEdit": FrmBuyFuelTransportDeduct_Oper frmEdit = new FrmBuyFuelTransportDeduct_Oper(entity.Id, eEditMode.修改); if (frmEdit.ShowDialog() == DialogResult.OK) { ShowDeduct(this.CmcsBuyFuelTransport.Id); } break; case "clmDelete": if (MessageBoxEx.Show("确定删除扣吨记录!", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) == System.Windows.Forms.DialogResult.OK) { Dbers.GetInstance().SelfDber.Delete <CmcsBuyFuelTransportDeduct>(entity.Id); ShowDeduct(this.CmcsBuyFuelTransport.Id); } break; } }
private void superGridControl1_CellMouseDown(object sender, DevComponents.DotNetBar.SuperGrid.GridCellMouseEventArgs e) { CmcsBuyFuelTransportDeduct entity = cmcsbuyfueltransportdeducts.Where(a => a.Id == superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString()).FirstOrDefault(); switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name) { case "clmShow": FrmBuyFuelTransportDeduct_Oper frmShow = new FrmBuyFuelTransportDeduct_Oper(entity.Id, cmcsBuyFuelTransport.Id, false, cmcsbuyfueltransportdeducts); if (frmShow.ShowDialog() == DialogResult.OK) { superGridControl1.PrimaryGrid.DataSource = cmcsbuyfueltransportdeducts; dbi_DeductWeight.Value = (double)cmcsbuyfueltransportdeducts.Select(a => a.DeductWeight).Sum(); } break; case "clmEdit": FrmBuyFuelTransportDeduct_Oper frmEdit = new FrmBuyFuelTransportDeduct_Oper(entity.Id, cmcsBuyFuelTransport.Id, true, cmcsbuyfueltransportdeducts); if (frmEdit.ShowDialog() == DialogResult.OK) { cmcsbuyfueltransportdeducts = cmcsbuyfueltransportdeducts.Where(a => a.Id != frmEdit.cmcsBuyFuelTransportDeduct.Id).ToList(); cmcsbuyfueltransportdeducts.Add(frmEdit.cmcsBuyFuelTransportDeduct); superGridControl1.PrimaryGrid.DataSource = cmcsbuyfueltransportdeducts; dbi_DeductWeight.Value = (double)cmcsbuyfueltransportdeducts.Select(a => a.DeductWeight).Sum(); } break; case "clmDelete": cmcsbuyfueltransportdeducts = cmcsbuyfueltransportdeducts.Where(a => a.Id != entity.Id).ToList(); superGridControl1.PrimaryGrid.DataSource = cmcsbuyfueltransportdeducts; dbi_DeductWeight.Value = (double)cmcsbuyfueltransportdeducts.Select(a => a.DeductWeight).Sum(); CommonDAO.GetInstance().SelfDber.Delete <CmcsBuyFuelTransportDeduct>(entity.Id); break; } }
private void superGridControl1_CellMouseDown(object sender, DevComponents.DotNetBar.SuperGrid.GridCellMouseEventArgs e) { CmcsEPCCard entity = Dbers.GetInstance().SelfDber.Get <CmcsEPCCard>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString()); switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name) { case "clmShow": FrmEPCCard_Oper frmShow = new FrmEPCCard_Oper(entity.Id, eEditMode.查看); if (frmShow.ShowDialog() == DialogResult.OK) { BindData(); } break; case "clmEdit": FrmEPCCard_Oper frmEdit = new FrmEPCCard_Oper(entity.Id, eEditMode.修改); if (frmEdit.ShowDialog() == DialogResult.OK) { BindData(); } break; case "clmDelete": // 查询正在使用该标签卡的车数 if (MessageBoxEx.Show("确定要删除该标签卡?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { try { Dbers.GetInstance().SelfDber.Delete <CmcsEPCCard>(entity.Id); } catch (Exception) { MessageBoxEx.Show("该标签卡正在使用中,禁止删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } BindData(); } break; } }
private void superGridControl1_CellMouseDown(object sender, DevComponents.DotNetBar.SuperGrid.GridCellMouseEventArgs e) { }