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