private void _btnAdd_Click(object sender, EventArgs e) { using (var dlg = new AddBatchForm()) { if (dlg.ShowDialog() == DialogResult.OK) { Query(); } } }
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); } } }