Exception Handling

<< Click to Display Table of Contents >>

Navigation:  Developers' Guide > Using Data Interface > Events >

Exception Handling

Navigation: Developers' Guide > Using Data Interface > Events >

hm_btn_navigate_prevhm_btn_navigate_tophm_btn_navigate_next

Exception Handling

 

Show/Hide Hidden Text

This section describes exception handling in iVend Add-On Framework. Using iVend Add-On Framework, you can handle various scenario by customizing codes and showing custom message.

Download and refer to the  project files "CustomScreenSampleForMC" for MC and "POSEventsSampleAddon" for POS.

Click to expand/collapse the view.

Sample for exception handling

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using CXS.Retail.Extensibility.Modules.Transaction;

using CXS.Retail.Extensibility;

using CXS.Retail.ManagementUIComponents;

using CXS.Platform.UIComponents;

using DevExpress.XtraEditors;

using System.Windows.Forms;

using CXS.Framework.Core;

using CXS.Retail.UIComponents;

using CXS.Retail.ViewModel.Message;

using CXSRetailPOS;

 

namespace POSEventsSampleAddon

{

class Transaction : TransactionEntryModuleBase

{

    TransactionEntryView t;

   public override void OnBeforeCustomerSearch(object sender, EventArgs<CXS.SubSystem.Transaction.Transaction> args)

    {

        MessageBox.Show("On before customer search - TransactionEntry");

        //Testing Exception handling using args

        args.Message = "Validation error";

        args.Cancel = true;

        args.MessageType = MessageType.Error;

    }

}

}