CancelOperation() public static méthode

分步取消
public static CancelOperation ( Resolver resolver ) : void
resolver System.Resolver
Résultat void
Exemple #1
0
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     try
     {
         if (keyData == (Keys.Control | Keys.Enter))
         {
             this.OrderConfirm();
             return(true);
         }
         else if (keyData == Keys.F1)
         {
             string message = HelpMessage();
             if (message != null)
             {
                 MessageBox.Show(this, message);
             }
         }
         if (this.tbBarCode.Focused)
         {
             if (keyData == Keys.Enter)
             {
                 this.BarCodeScan();
                 return(true);
             }
             if (keyData == Keys.Escape)
             {
                 if (this.enableCache)
                 {
                     Utility.CancelOperation(this.resolver);
                 }
                 else
                 {
                     this.resolver.Input = BusinessConstants.BARCODE_SPECIAL_MARK + BusinessConstants.BARCODE_HEAD_CANCEL;
                     this.resolver       = TheClientMgr.ScanBarcode(this.resolver);
                 }
                 this.DataBind();
                 return(true);
             }
         }
         else if (this.btnConfirm.Focused)
         {
             if (keyData == Keys.Enter)
             {
                 if (this.tbBarCode.Text.Trim() != string.Empty)
                 {
                     this.BarCodeScan();
                 }
                 else
                 {
                     this.OrderConfirm();
                 }
                 return(true);
             }
         }
         else if (this.btnQualified.Visible && this.btnQualified.Focused)
         {
             if (keyData == Keys.Enter)
             {
                 this.btnQualified_Click(null, null);
                 return(true);
             }
         }
         else if (this.gvList.Focused)
         {
             if (keyData == Keys.Enter)
             {
                 if (this.resolver != null && !this.resolver.IsScanHu)
                 {
                     int currentRowIndex = this.gvList.CurrentCell.RowIndex;
                     if (currentRowIndex == this.gvList.Rows.Count - 1)
                     {
                         this.gvHuList.ClearSelection();
                         this.btnConfirm.Focus();
                     }
                 }
                 else
                 {
                     this.btnConfirm.Focus();
                 }
                 return(true);
             }
         }
     }
     catch (Exception ex)
     {
         this.InitialAll();
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }