Beispiel #1
0
        private void btnBuscarCuenta_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtSoloNroCuenta.Text))
            {
                return;
            }
            depositoMethods = new DepositoMethods();
            datosCuenta     = new BusquedaCuenta();
            datosCuenta     = depositoMethods.ObtenerDatosCuenta(txtSoloNroCuenta.Text);
            if (datosCuenta != null)
            {
                // = datosCuenta.NroCuenta;
                //cuentas.Monto = Convert.ToDecimal(monto1.TBMonto.Text);
                epValidarCampos.SetError(txtSoloNroCuenta, "");
                lblMoneda1.Text      = datosCuenta.Moneda;
                lblTipoCuenta1.Text  = datosCuenta.TipoCuenta;
                lblDOI1.Text         = datosCuenta.Doi;
                lblPropietario1.Text = datosCuenta.Persona;
                lblEstado1.Text      = datosCuenta.Estado;

                nroCuentaDeposito = txtSoloNroCuenta.Text;
            }
            else
            {
                lblMoneda1.Text      = "";
                lblTipoCuenta1.Text  = "";
                lblDOI1.Text         = "";
                lblPropietario1.Text = "";
                lblEstado1.Text      = "";
                MensajeAviso.Show(MessageType.ERROR, "El numero de cuenta ingresado no existe.");
            }
        }
Beispiel #2
0
 private void txtCuenta2_TextChanged(object sender, EventArgs e)
 {
     beneficiario         = null;
     lblMoneda2.Text      = string.Empty;
     lblTipoCuenta2.Text  = string.Empty;
     lblDOI2.Text         = string.Empty;
     lblPropietario2.Text = string.Empty;
 }
Beispiel #3
0
 private void txtCuenta1_TextChanged(object sender, EventArgs e)
 {
     remitente            = null;
     lblMoneda1.Text      = string.Empty;
     lblTipoCuenta1.Text  = string.Empty;
     lblDOI1.Text         = string.Empty;
     lblPropietario1.Text = string.Empty;
 }
        public object[] SelectCuentaXnroCuenta(string nroCuenta)
        {
            object[] resultado = null;
            try{
                using (var connection = Util.ConnectionFactory.conexion())
                {
                    SqlCommand command = new SqlCommand("SelectCuentaXnroCuenta", connection);

                    command.Parameters.AddWithValue("@NroCuenta", nroCuenta);
                    SqlParameter sqlIdSalida = new SqlParameter("@IdMensaje", SqlDbType.Int);
                    sqlIdSalida.Direction = ParameterDirection.Output;
                    SqlParameter sqlMensaje = new SqlParameter("@Mensaje", SqlDbType.VarChar, 400);
                    sqlMensaje.Direction = ParameterDirection.Output;
                    command.Parameters.Add(sqlIdSalida);
                    command.Parameters.Add(sqlMensaje);

                    connection.Open();
                    command.CommandType = CommandType.StoredProcedure;
                    command.CommandText = "SelectCuentaXnroCuenta";
                    BusquedaCuenta consulta = null;
                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        if (reader.HasRows)
                        {
                            reader.Read();
                            consulta = new BusquedaCuenta()
                            {
                                NroCuenta  = reader["NroCuenta"].ToString().Trim(),
                                Moneda     = reader["Moneda"].ToString(),
                                TipoCuenta = reader["TipoCuenta"].ToString(),
                                Doi        = reader["doi"].ToString(),
                                Persona    = reader["persona"].ToString()
                            };
                        }
                    }
                    string idMensaje = command.Parameters["@IdMensaje"].Value.ToString();
                    string mensaje   = command.Parameters["@Mensaje"].Value.ToString();

                    return(resultado = new object[]
                    {
                        idMensaje,
                        mensaje,
                        consulta
                    });
                }
            }
            catch (Exception ex) {
                return(resultado = new object[]
                {
                    "-1",
                    ex.Message,
                    null
                });
            }
        }
Beispiel #5
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(txtNroCuenta.Text))
            {
                return;
            }
            depositoMethods = new DepositoMethods();
            datosCuenta     = new BusquedaCuenta();
            using (DepositosServiceClient retirosService = new DepositosServiceClient())
            {
                datosCuenta = retirosService.ObtenerDatosCuenta(txtNroCuenta.Text);
                //datosCuenta = depositoMethods.ObtenerDatosCuenta(txtNroCuenta.Text);
            }


            if (datosCuenta != null)
            {
                epValidarCampos.SetError(txtNroCuenta, "");
                cuentas           = new CuentasTarjetasModel();
                cuentas.NroCuenta = datosCuenta.NroCuenta;
                //cuentas.Monto = Convert.ToDecimal(monto1.TBMonto.Text);

                cuentas.moneda = datosCuenta.Moneda;
                idUsuario      = Session.Turno.IdTurUsu;
                //cuentas.doi = txtDNI.Text;
                cuentas.Usuario = Session.UserName;

                if (cuentas.moneda == "Soles")
                {
                    lblSimboloMoneda.Text = "S/";
                }

                else if (cuentas.moneda == "Dolares")
                {
                    lblSimboloMoneda.Text = "$";
                }


                lblMoneda1.Text      = datosCuenta.Moneda;
                lblTipoCuenta1.Text  = datosCuenta.TipoCuenta;
                lblDOI1.Text         = datosCuenta.Doi;
                lblPropietario1.Text = datosCuenta.Persona;
                lblEstado1.Text      = datosCuenta.Estado;
            }
            else
            {
                lblMoneda1.Text       = "";
                lblTipoCuenta1.Text   = "";
                lblDOI1.Text          = "";
                lblPropietario1.Text  = "";
                lblEstado1.Text       = "";
                lblSimboloMoneda.Text = "";
                MensajeAviso.Show(MessageType.ERROR, "El numero de cuenta ingresado no existe.");
            }
        }
Beispiel #6
0
        private void btnBuscar2_Click(object sender, EventArgs e)
        {
            if (Session.Turno == null)
            {
                alert1.Show(MessageType.WARNING, "Ud. no puede hacer operaciones porque no tiene turno o su turno esta inactivo");
                return;
            }
            Error.SetError(txtCuenta2, "");
            if (remitente == null)
            {
                alert1.Show(MessageType.WARNING, "El número de cuenta de remitente fue modificado o esta vacío");
                return;
            }
            if (remitente.NroCuenta.Equals(txtCuenta2.Text.Trim()))
            {
                alert1.Show(MessageType.WARNING, "El número de cuenta no pueden ser iguales");
                return;
            }
            transferenciasMethods = new TransferenciasMethods();

            object[] response;
            //using (TransferenciaServiceClient transService = new TransferenciaServiceClient())
            //{
            //    response = transService.SelectCuentaXnroCuenta(txtCuenta2.Text.Trim());
            //}
            transferenciasMethods = new TransferenciasMethods();
            response = transferenciasMethods.SelectCuentaXnroCuenta(txtCuenta2.Text.Trim());
            if (response[0].Equals("1"))
            {
                beneficiario         = (BusquedaCuenta)response[2];
                lblMoneda2.Text      = beneficiario.Moneda;
                lblTipoCuenta2.Text  = beneficiario.TipoCuenta;
                lblDOI2.Text         = beneficiario.Doi;
                lblPropietario2.Text = beneficiario.Persona;

                if (!remitente.Moneda.Equals(beneficiario.Moneda))
                {
                    AparecerTipoCambio();
                    EstablecerCambioMoneda();
                    return;
                }
            }
            else
            {
                alert1.Show(MessageType.ERROR, response[1].ToString());
            }
            DesaparecerTipoCambio();
        }
        public List <BusquedaCuenta> SelectTopTransferenciasXpromotor(int IdTurUsu)
        {
            List <BusquedaCuenta> resultado = new List <BusquedaCuenta>();

            try
            {
                using (var connection = Util.ConnectionFactory.conexion())
                {
                    SqlCommand command = new SqlCommand("SelectTopTransferenciasXpromotor", connection);

                    command.Parameters.AddWithValue("@IdTurnoUsuario", IdTurUsu);

                    connection.Open();
                    command.CommandType = CommandType.StoredProcedure;
                    command.CommandText = "SelectTopTransferenciasXpromotor";

                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        if (reader.HasRows)
                        {
                            while (reader.Read())
                            {
                                BusquedaCuenta consulta = new BusquedaCuenta()
                                {
                                    ID         = Convert.ToInt32(reader["ID_Movimiento"].ToString()),
                                    NroCuenta  = reader["ID_Cuenta"].ToString().Trim(),
                                    Moneda     = reader["Moneda"].ToString(),
                                    TipoCuenta = reader["TipoCuenta"].ToString(),
                                    Monto      = Convert.ToDecimal(reader["Monto"].ToString()),
                                    Persona    = reader["Persona"].ToString(),
                                    Fecha      = Convert.ToDateTime(reader["Fecha_Creacion"].ToString())
                                };
                                resultado.Add(consulta);
                            }
                        }
                    }
                    return(resultado);
                }
            }
            catch (Exception ex)
            {
                return(resultado = null);
            }
        }
        public BusquedaCuenta ObtenerDatosCuenta(string NroCuenta)
        {
            BusquedaCuenta cuenta = null;

            try
            {
                using (var connection = Util.ConnectionFactory.conexion())
                {
                    connection.Open();

                    SqlCommand command = connection.CreateCommand();

                    command.Parameters.AddWithValue("@NroCuenta", NroCuenta);

                    command.CommandType = CommandType.StoredProcedure;

                    command.CommandText = "ObtenerDatosCuenta";

                    SqlDataReader reader = command.ExecuteReader();

                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            cuenta = (new BusquedaCuenta
                            {
                                NroCuenta = reader["NroCuenta"].ToString().Trim(),
                                Estado = reader["Estado"].ToString().Trim(),
                                Moneda = reader["Moneda"].ToString(),
                                TipoCuenta = reader["TipoCuenta"].ToString(),
                                Doi = reader["doi"].ToString(),
                                Persona = reader["persona"].ToString()
                            });
                        }
                    }
                }

                return(cuenta);
            }
            catch (Exception e)
            {
                return(cuenta);
            }
        }
Beispiel #9
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            if (Session.Turno == null)
            {
                alert1.Show(MessageType.WARNING, "Ud. no puede hacer operaciones porque no tiene turno o su turno esta inactivo");
                return;
            }
            if (txtCuenta1.Text.Trim().Length != 11)
            {
            }
            monto1.TBMonto.Text = string.Empty;
            Error.SetError(txtCuenta1, "");
            object[] response;

            //using (TransferenciaServiceClient transService=new TransferenciaServiceClient())
            //{
            //    response = await transService.SelectCuentaXnroCuentaAsync(txtCuenta1.Text.Trim());
            //}
            transferenciasMethods = new TransferenciasMethods();
            response = transferenciasMethods.SelectCuentaXnroCuenta(txtCuenta1.Text.Trim());
            if (response[0].Equals("1"))
            {
                remitente            = (BusquedaCuenta)response[2];
                lblMoneda1.Text      = remitente.Moneda;
                lblTipoCuenta1.Text  = remitente.TipoCuenta;
                lblDOI1.Text         = remitente.Doi;
                lblPropietario1.Text = remitente.Persona;
                if (remitente.Moneda.Equals("Soles"))
                {
                    lblMonto1.Text = "Monto soles :";
                }
                if (remitente.Moneda.Equals("Dolares"))
                {
                    lblMonto1.Text = "Monto dólares :";
                }
            }
            else
            {
                alert1.Show(MessageType.ERROR, response[1].ToString());
            }
        }