private void _riOperation_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (e.Button.Index == 0) { MdiService.JumpTo <ProduceDetailView>(); } else if (e.Button.Index == 1) { var procedure = GetFocusedProcedure(); if (procedure == null) { MessageBoxHelper.Warn("没有找到工序。"); return; } using (var dlg = new AddProcedureForm(procedure.Id)) { if (dlg.ShowDialog() == DialogResult.OK) { Query(); } } } else if (e.Button.Index == 2) { var procedure = GetFocusedProcedure(); if (procedure == null) { MessageBoxHelper.Warn("没有找到工序。"); return; } if (MessageBoxHelper.Question(string.Format("您确定要删除工序“{0}”吗?", procedure.GetDisplayText()))) { _service.DeleteProcedure(procedure.Id); } } }
private void _riOperation_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (e.Button.Index == 0) { MdiService.JumpTo <ProduceDetailView>(); } else if (e.Button.Index == 1) { var batch = GetFocusedBatch(); if (batch == null) { MessageBoxHelper.Warn("没有找到批次。"); return; } using (var dlg = new AddBatchForm(batch.Id)) { if (dlg.ShowDialog() == DialogResult.OK) { Query(); } } } else if (e.Button.Index == 2) { var batch = GetFocusedBatch(); if (batch == null) { MessageBoxHelper.Warn("没有找到批次。"); return; } if (MessageBoxHelper.Question(string.Format("您确定要删除批次“{0}”吗?", batch.BatchNo))) { ApplicationService.Instanse.DeleteBatch(batch.Id); } } }