Example #1
0
        private void btnTransferir_Click(object sender, EventArgs e)
        {
            bool importeOK = false, clienteOK = false, ctaOrigenOK = false, ctaDestinoOK = false;

            if (txtCliente.Text != "")
            {
                clienteOK            = true;
                lklCliente.LinkColor = Color.Blue;
            }
            else
            {
                clienteOK            = false;
                lklCliente.LinkColor = Color.Red;
            }

            if (Herramientas.IsDecimal(txtImporte.Text))
            {
                lblImporte.ForeColor = Color.Black;
                importeOK            = true;
            }
            else
            {
                lblImporte.ForeColor = Color.Red;
                importeOK            = false;
            }

            if (cbxCuenta.DataSource != null)
            {
                ctaOrigenOK         = true;
                lblCuenta.ForeColor = Color.Black;
            }
            else
            {
                ctaOrigenOK         = false;
                lblCuenta.ForeColor = Color.Red;
            }

            if (cbxCuentaDestino.DataSource != null)
            {
                ctaDestinoOK = true;
                lklCuentaDestino.LinkColor = Color.Blue;
            }
            else
            {
                ctaDestinoOK = false;
                lklCuentaDestino.LinkColor = Color.Red;
            }


            if (clienteOK && ctaOrigenOK && ctaDestinoOK && importeOK)
            {
                List <SqlParameter> lista = Herramientas.GenerarListaDeParametros(
                    "@cliente_id", this.clienteId,
                    "@cuenta_origen", ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key,
                    "@cuenta_destino", numeroCuenta,
                    "@importe", txtImporte.Text);

                if (Herramientas.EjecutarStoredProcedure("SARASA.realizar_transferencia", lista) != null)
                {
                    string msj = "CLIENTE: " + usuario.Apellido + ", " + usuario.Nombre + " (" + usuario.ClienteId + ")\n"
                                 + "CUENTA ORIGEN: " + ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key + "\n"
                                 + "CUENTA DESTINO: " + numeroCuenta + "\n"
                                 + "IMPORTE: $" + txtImporte.Text + "\n";

                    MessageBox.Show(msj, "TRANSFERENCIA - COMPROBANTE",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);

                    cbxCuenta.SelectedIndex        = 0;
                    cbxCuentaDestino.SelectedIndex = 0;
                    txtImporte.Text = "";
                }
            }
        }
Example #2
0
        private void btnRetirar_Click(object sender, EventArgs e)
        {
            bool clienteOK = false, documentoOK = false,
                 cuentaOK = false, monedaOK = false,
                 importeOK = false, bancoOK = false;


            if (txtCliente.Text != "")
            {
                clienteOK            = true;
                lklCliente.LinkColor = Color.Blue;
            }
            else
            {
                clienteOK            = false;
                lklCliente.LinkColor = Color.Red;
            }

            if (Herramientas.IsDecimal(txtImporte.Text))
            {
                lblImporte.ForeColor = Color.Black;
                importeOK            = true;
            }
            else
            {
                lblImporte.ForeColor = Color.Red;
                importeOK            = false;
            }

            if (clienteDocumento.Equals(txtDocumento.Text))
            {
                lblDocumento.ForeColor = Color.Black;
                documentoOK            = true;
            }
            else
            {
                lblDocumento.ForeColor = Color.Red;
                documentoOK            = false;
            }


            if (cbxCuenta.DataSource != null)
            {
                cuentaOK            = true;
                lblCuenta.ForeColor = Color.Black;
            }
            else
            {
                cuentaOK            = false;
                lblCuenta.ForeColor = Color.Red;
            }

            if (cbxBanco.DataSource != null)
            {
                bancoOK            = true;
                lblBanco.ForeColor = Color.Black;
            }
            else
            {
                bancoOK            = false;
                lblBanco.ForeColor = Color.Red;
            }

            if (cbxMoneda.DataSource != null)
            {
                monedaOK            = true;
                lblMoneda.ForeColor = Color.Black;
            }
            else
            {
                monedaOK            = false;
                lblMoneda.ForeColor = Color.Red;
            }

            if (clienteOK && documentoOK && importeOK && bancoOK && monedaOK && cuentaOK)
            {
                List <SqlParameter> lista = Herramientas.GenerarListaDeParametros(
                    "@cliente_id", clienteId,
                    "@cliente_documento", txtDocumento.Text,
                    "@cuenta_nro", ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key,
                    "@moneda_id", ((KeyValuePair <string, string>)cbxMoneda.SelectedItem).Key,
                    "@importe", txtImporte.Text,
                    "@banco_codigo", ((KeyValuePair <string, string>)cbxBanco.SelectedItem).Key);

                if (Herramientas.EjecutarStoredProcedure("SARASA.retirar_efectivo", lista) != null)
                {
                    string boleta = "CLIENTE: " + txtCliente.Text + "\n"
                                    + "CUENTA: " + ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key + "\n"
                                    + "IMPORTE: $" + txtImporte.Text + " (" + ((KeyValuePair <string, string>)cbxMoneda.SelectedItem).Value + ")\n"
                                    + "BANCO: " + ((KeyValuePair <string, string>)cbxBanco.SelectedItem).Value + "\n";

                    MessageBox.Show(boleta, "RETIRO - COMPROBANTE",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);

                    txtDocumento.Text       = "";
                    txtImporte.Text         = "";
                    cbxBanco.SelectedIndex  = 0;
                    cbxCuenta.SelectedIndex = 0;
                    cbxMoneda.SelectedIndex = 0;
                }
            }
        }
Example #3
0
        private void btnDepositar_Click(object sender, EventArgs e)
        {
            bool importeOK = false, cuentaOK = false, tarjetaOK = false,
                 monedaOK = false, clienteOK = false;

            if (Herramientas.IsDecimal(txtImporte.Text))
            {
                importeOK            = true;
                lblImporte.ForeColor = Color.Black;
            }
            else
            {
                importeOK            = false;
                lblImporte.ForeColor = Color.Red;
            }

            if (cbxCuenta.DataSource != null)
            {
                cuentaOK            = true;
                lblCuenta.ForeColor = Color.Black;
            }
            else
            {
                cuentaOK            = false;
                lblCuenta.ForeColor = Color.Red;
            }

            if (cbxTarjeta.DataSource != null)
            {
                tarjetaOK            = true;
                lblTarjeta.ForeColor = Color.Black;
            }
            else
            {
                tarjetaOK            = false;
                lblTarjeta.ForeColor = Color.Red;
            }

            if (cbxMoneda.DataSource != null)
            {
                monedaOK            = true;
                lblMoneda.ForeColor = Color.Black;
            }
            else
            {
                monedaOK            = false;
                lblMoneda.ForeColor = Color.Red;
            }


            if (txtCliente.Text != "")
            {
                clienteOK            = true;
                lklCliente.LinkColor = Color.Blue;
            }
            else
            {
                clienteOK            = false;
                lklCliente.LinkColor = Color.Red;
            }

            if (clienteOK && importeOK && cuentaOK && tarjetaOK && monedaOK)
            {
                List <SqlParameter> lista = Herramientas.GenerarListaDeParametros(
                    "@cliente_id", this.clienteId,
                    "@deposito_fecha", dtpFecha.Value.ToShortDateString(),
                    "@deposito_importe", txtImporte.Text,
                    "@deposito_moneda_id", ((KeyValuePair <string, string>)cbxMoneda.SelectedItem).Key,
                    "@deposito_tarjeta_num", ((KeyValuePair <string, string>)cbxTarjeta.SelectedItem).Key,
                    "@deposito_cuenta_num", ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key);

                if (Herramientas.EjecutarStoredProcedure("SARASA.realizar_deposito", lista) != null)
                {
                    string msj = "CLIENTE: " + usuario.Apellido + ", " + usuario.Nombre + " (" + this.clienteId + ")\n"

                                 + "CUENTA: " + ((KeyValuePair <string, string>)cbxCuenta.SelectedItem).Key + "\n"
                                 + "TARJETA: " + ((KeyValuePair <string, string>)cbxTarjeta.SelectedItem).Value + "\n"
                                 + "IMPORTE: $" + txtImporte.Text + "\n";

                    MessageBox.Show(msj, "DEPOSITO - COMPROBANTE",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);

                    cbxCuenta.SelectedIndex  = 0;
                    cbxMoneda.SelectedIndex  = 0;
                    cbxTarjeta.SelectedIndex = 0;
                    txtImporte.Text          = "";
                }
                else
                {
                    MessageBox.Show("Verificar que el formulario este completo", "Depositos", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }