public Window()
 {
     InitializeComponent();
     Drawer = new OPOSCashDrawer();
     Drawer.ClaimDevice(10);
     Drawer.Open("CashDrawer");
     Drawer.DeviceEnabled      = true;
     Drawer.StatusUpdateEvent += Drawer_StatusUpdateEvent;
 }
Example #2
0
        private void btnOpenCD_Click(object sender, EventArgs e)
        {
            OPOSCashDrawer cd  = new OPOSCashDrawer();
            int            nRC = cd.Open("DefaultCashDrawer");

            if (nRC == (int)OPOS_Constants.OPOS_SUCCESS)
            {
                cd.DeviceEnabled = true;
                nRC = cd.ClaimDevice(5000);
                if (nRC == (int)OPOS_Constants.OPOS_SUCCESS)
                {
                    cd.DeviceEnabled = true;
                    cd.OpenDrawer();
                }
            }
            else
            {
                MessageBox.Show("Open failed");
            }

            cd.ReleaseDevice();
            cd.Close();
        }