Example #1
0
        private void btn_Abono_Click(object sender, RoutedEventArgs e)
        {
            if (txtNuevoAbono.Text.Length == 0)
            {
                MessageBox.Show("Debe ingresar un abono");
                return;
            }

            if (int.Parse(txtNuevoAbono.Text) == 0)
            {
                MessageBox.Show("Abono debe ser mayor a 0");
                return;
            }

            if (int.Parse(txtNuevoAbono.Text) > int.Parse(txtSaldoActual.Text))
            {
                MessageBox.Show("Abono no puede ser mayor a saldo actual");
                return;
            }

            Cortina c = new Cortina();

            c.Id            = Properties.Settings.Default.idCortina;
            c.abono         = int.Parse(txtAbono.Text) + int.Parse(txtNuevoAbono.Text);
            c.saldo         = int.Parse(txtSaldoActual.Text) - int.Parse(txtNuevoAbono.Text);
            c.ClienteCodigo = Properties.Settings.Default.Codigo;

            if (c.abonar())
            {
                MessageBox.Show("Abono realizado");
                CargarLista();
                txtNuevoAbono.Text  = string.Empty;
                txtAbono.Text       = string.Empty;
                txtPrecio.Text      = string.Empty;
                txtSaldoActual.Text = string.Empty;
            }
            else
            {
                MessageBox.Show("Abono no realizado");
            }
        }
Example #2
0
        private void btn_Pagartodo_Click(object sender, RoutedEventArgs e)
        {
            Cortina c = new Cortina();

            c.Id            = Properties.Settings.Default.idCortina;
            c.abono         = int.Parse(txtPrecio.Text);
            c.saldo         = 0;
            c.ClienteCodigo = Properties.Settings.Default.Codigo;

            if (c.abonar())
            {
                MessageBox.Show("Pedido pagado completamente");
                CargarLista();
                txtNuevoAbono.Text  = string.Empty;
                txtAbono.Text       = string.Empty;
                txtPrecio.Text      = string.Empty;
                txtSaldoActual.Text = string.Empty;
            }
            else
            {
                MessageBox.Show("Pago no realizado");
            }
        }