Ejemplo n.º 1
0
 private void InsertDocument(decimal denomination, DeviceLibrary.Models.Enums.DocumentType type)
 {
     DeviceLibrary.Models.Document dep = new DeviceLibrary.Models.Document(denomination, type, 1);
     device.Enable();
     device.SimulateInsertion(dep);
     device.Disable();
 }
Ejemplo n.º 2
0
        void updateData(double pay)
        {
            DeviceStatus status = deviceLibrary.Status;

            if (status != DeviceStatus.Enabled)
            {
                MessageBox.Show("Error de conexion.");
                goBack();
                return;
            }

            if (lblRemaining.Text == "$0")
            {
                return;
            }

            //deviceLibrary.AcceptedDocument += DeviceLibrary_AcceptedDocument;

            Document document = new Document(Decimal.Parse(pay.ToString()), pay > 20 ? DocumentType.Bill : DocumentType.Coin, 1);

            deviceLibrary.SimulateInsertion(document);

            double newDebt = (double.Parse(lblRemaining.Text.Substring(1, lblRemaining.Text.Length - 1)) - pay);

            if (newDebt < 0)
            {
                newDebt = 0;
            }

            if (newDebt == 0)
            {
                lblChange.Text = "$" + ((double.Parse(lblDesposited.Text.Substring(1, lblDesposited.Text.Length - 1)) + pay) - double.Parse(lblDebt.Text.Substring(1, lblDebt.Text.Length - 1))).ToString();
            }

            lblRemaining.Text  = "$" + newDebt.ToString();
            lblDesposited.Text = "$" + (double.Parse(lblDesposited.Text.Substring(1, lblDesposited.Text.Length - 1)) + pay).ToString();

            dataAccess.addPayment(account.user, int.Parse(account.account), newDebt, double.Parse(lblDesposited.Text.Substring(1, lblDesposited.Text.Length - 1)) + pay);
        }
Ejemplo n.º 3
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     VariablesGlobales.c_quinientos += 1;
     dv.Enable();
     dv.SimulateInsertion(quinentos);
 }