private void openDrawer() { if (m_Drawer != null) { try { //Open the device //Use a Logical Device Name which has been set on the SetupPOS. m_Drawer.Open(); //Get the exclusive control right for the opened device. //Then the device is disable from other application. m_Drawer.Claim(1000); //Enable the device. m_Drawer.DeviceEnabled = true; //Open the drawer by using the "OpenDrawer" method. m_Drawer.OpenDrawer(); m_Drawer.DeviceEnabled = false; m_Drawer.Release(); m_Drawer.Close(); } catch (Exception) { useNativePrinter(); } } else { useNativePrinter(); } }
private void CloseResourceDeviceCashDrawer() { if (null != m_Drawer) { m_Drawer.Close(); } }
public void CloseCashDrawer() { //<<<ステップ1>>>--Start if (m_Drawer != null) { try { //デバイスを停止します。 // m_Drawer.DeviceEnabled = false; //デバイスの使用権を解除します。 m_Drawer.Release(); } catch (PosControlException) { } finally { //デバイスの使用を終了します。 m_Drawer.Close(); } } //<<<ステップ1>>>--End }
public void Dispose() { if (_cashDrawer != null) { _cashDrawer.Close(); } }
public void OpenCashDrawer() { myCashDrawer.Open(); myCashDrawer.Claim(1000); myCashDrawer.DeviceEnabled = true; myCashDrawer.OpenDrawer(); myCashDrawer.DeviceEnabled = false; myCashDrawer.Release(); myCashDrawer.Close(); }
public void openCashDrawer2() { myCashDrawer.Open(); myCashDrawer.Claim(1000); myCashDrawer.DeviceEnabled = true; myCashDrawer.OpenDrawer(); myCashDrawer.DeviceEnabled = false; myCashDrawer.Release(); myCashDrawer.Close(); //myCashDrawer.CapStatus }
public bool Close(DrawerFlag _flag, int _id, int _managerid) { lock (this.syncRoot) { CashDrawer _drawer = null; if (TryGetDrawer(_flag, out _drawer, _id, _managerid)) { return(_drawer.Close(time)); } return(false); } }
public void OpenCashDrawer() { try { myCashDrawer.Open(); myCashDrawer.Claim(1000); myCashDrawer.DeviceEnabled = true; myCashDrawer.OpenDrawer(); myCashDrawer.DeviceEnabled = false; myCashDrawer.Release(); myCashDrawer.Close(); } catch (Exception ex) { } }
private void button1_Click(object sender, EventArgs e) { if (!Turno.shiftActive) { return; } DarkForm darkForm = new DarkForm(); Form_Login formLogin = new Form_Login(string.Format("Verificación De\nUsuario")); FormShiftAddMoney formShiftAddMoney = new FormShiftAddMoney(); darkForm.Show(); formLogin.ShowDialog(); Empleado empleado = new Empleado(formLogin.ID); if (formLogin.DialogResult == DialogResult.OK && empleado.isAdmin) { if (formShiftAddMoney.ShowDialog() == DialogResult.OK) { //<<< step1 >>> --Start //When outputting to a printer,a mouse cursor becomes like a hourglass. try { if (m_Drawer != null) { //Open the device //Use a Logical Device Name which has been set on the SetupPOS. m_Drawer.Open(); //Get the exclusive control right for the opened device. //Then the device is disable from other application. m_Drawer.Claim(1000); //Enable the device. m_Drawer.DeviceEnabled = true; //Open the drawer by using the "OpenDrawer" method. m_Drawer.OpenDrawer(); m_Drawer.DeviceEnabled = false; m_Drawer.Release(); m_Drawer.Close(); } else { useDefaultPrinter(); } } catch (Exception) { if (m_Drawer != null) { m_Drawer.Release(); m_Drawer.Close(); } useDefaultPrinter(); } //<<<step1>>>--End Turno.AddCashToDrawer(empleado.ID, formShiftAddMoney.cash, formShiftAddMoney.reason); MessageBox.Show("Se realizó correctamente"); this.setGroupBoxInfo(); } } else if (formLogin.DialogResult == DialogResult.OK && !empleado.isAdmin && formLogin.ID > -1) { MessageBox.Show("No tiene los permisos necesarios para realizar esta acción"); } darkForm.Close(); }
private void PayBtn_Click(object sender, EventArgs e) { if (this.PO.delivered) { FormPagar formPagar = new FormPagar(this.PO.total - this.PO.pay, true); DarkForm darkForm = new DarkForm(); darkForm.Show(); if (formPagar.ShowDialog() == DialogResult.OK) { this.PO.MakePayment(Convert.ToDouble(formPagar.Pay), this.CurrentEmployeeID); this.updateValues(); if (m_Drawer != null) { try { //Open the device //Use a Logical Device Name which has been set on the SetupPOS. m_Drawer.Open(); //Get the exclusive control right for the opened device. //Then the device is disable from other application. m_Drawer.Claim(1000); //Enable the device. m_Drawer.DeviceEnabled = true; //Open the drawer by using the "OpenDrawer" method. m_Drawer.OpenDrawer(); m_Drawer.DeviceEnabled = false; m_Drawer.Release(); m_Drawer.Close(); } catch (PosControlException) { useNativePrinter(); } } else { useNativePrinter(); } //<<<step1>>>--End MessageBox.Show("Se realizó abono con exito"); if (this.PO.paid) { if (inASearch) { searchPO(); } else { this.loadPurchases(); } } } darkForm.Close(); } else { MessageBox.Show("Primero debe confirmar el pedido para realizar un abono", "No se puede realizar un abono", MessageBoxButtons.OK); } }