Beispiel #1
0
        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();
            }
        }
Beispiel #2
0
        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
        }
Beispiel #3
0
 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
 }
Beispiel #5
0
 public void Release()
 {
     if (_drawer.Claimed)
     {
         if (_drawer.DeviceEnabled)
         {
             _drawer.DeviceEnabled = false;
         }
         _drawer.Release();
     }
 }
Beispiel #6
0
Datei: POS.cs Projekt: PCDCOM/RT
 public void OpenCashDrawer()
 {
     try
     {
         myCashDrawer.Open();
         myCashDrawer.Claim(1000);
         myCashDrawer.DeviceEnabled = true;
         myCashDrawer.OpenDrawer();
         myCashDrawer.DeviceEnabled = false;
         myCashDrawer.Release();
         myCashDrawer.Close();
     }
     catch (Exception ex) {
     }
 }
Beispiel #7
0
        private void ShopInfo_Main_Form_FormClosing(object sender, FormClosingEventArgs e)
        {
            //<<<step1>>>--Start
            if (m_Drawer != null)
            {
                try
                {
                    //Cancel the device
                    m_Drawer.DeviceEnabled = false;

                    //Release the device exclusive control right.
                    m_Drawer.Release();
                }
                catch (PosControlException)
                {
                }
                finally
                {
                    //Finish using the device.
                    m_Drawer.Close();
                }
            }
            //<<<step1>>>--End
        }
Beispiel #8
0
        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();
        }
Beispiel #9
0
        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);
            }
        }