void cargaDatosBusqueda()
        {
            string cedulaBusqueda = txtcedulaBuscar.Text;

            txtcedulaBuscar.ReadOnly = true;

            BLCliente datos = new BLCliente();

            sp_SeleccionaClienteCedula_Result datosCliente = new sp_SeleccionaClienteCedula_Result();

            ///se almacena la información brindado por el mentodo almacenado de la clase BLGastoCategoriaModificaR

            datosCliente = datos.RetornaClienteCed(cedulaBusqueda);

            ///verifica que el objeto retornado no sea nulo

            if (datosCliente == null)
            {
                Response.Write("<script>alert('El número de Cédula no esta en la base de datos')</script>");
            }
            else
            {
                ///se asigna los valores correspondientes
                ///

                this.txtNombre.Text = datosCliente.Nombre;

                this.txtApellido1.Text = datosCliente.Primer_Apellido;

                this.txtApellido2.Text = datosCliente.Segundo_Apellido;

                this.txtCedula.Text = datosCliente.Cedula;

                this.ddGenero.SelectedValue = datosCliente.Genero;

                this.txtFechanacimiento.Text = datosCliente.Fecha_Nacimiento.ToString("yyyy-MM-dd");

                this.ddProvincia.SelectedValue = datosCliente.ID_Provincia.ToString();

                this.cargarCanton();

                this.ddCanton.SelectedValue = datosCliente.ID_Cantón.ToString();

                this.cargarDistrito();

                this.ddDistrito.SelectedValue = datosCliente.ID_Distrito.ToString();

                this.txtDireccion.Text = datosCliente.Direccion;

                this.txtTelefono1.Text = datosCliente.Primer_Teléfono;

                this.txtTelefono2.Text = datosCliente.Segundo_Teléfono;

                this.txtCorreo.Text = datosCliente.Correo;
            }
        }
        /// <summary>
        /// Este método retorna una busque de cliente con la cédula del cliente
        /// </summary>
        /// <param name="pID_Cliente"></param>
        /// <returns></returns>

        public sp_SeleccionaClienteCedula_Result RetornaClienteCed(string pID_Cliente)
        {
            /// crea la variable que se retornará con la información del cliente

            sp_SeleccionaClienteCedula_Result Resultado = new sp_SeleccionaClienteCedula_Result();

            /// asigna a la variable el resultado de la consulta a la BD

            Resultado = this.modeloBD.sp_SeleccionaClienteCedula(pID_Cliente).FirstOrDefault();

            return(Resultado);
        }
        void cargaNombre(string pCedula)
        {
            BLCliente oCliente = new BLCliente();

            sp_SeleccionaClienteCedula_Result cliente = oCliente.RetornaClienteCed(pCedula);

            ///verifica que el objeto retornado no sea nulo

            if (cliente == null)
            {
                Response.Write("<script>alert('El número de cédula ingresado no corresponde a ningún cliente')</script>");
            }
            else
            {
                /// una vez validado si el cliente existe se va a cargar el nombre del cliente

                this.txtNombreCompleto.Text = cliente.Nombre + " " + cliente.Primer_Apellido + " " + cliente.Segundo_Apellido;
            }
        }
Exemple #4
0
        void cargaDatosBusqueda()
        {
            int id = Convert.ToInt16(this.ddCodigoBurcar.SelectedValue);

            string cedulaBuscar = txtcedulaBuscar.Text;


            BLAdicciones_Cliente datosAdiccionesCliente = new BLAdicciones_Cliente();

            sp_AdiccionesClienteBuscaDuplicados_Result datosCliente = new sp_AdiccionesClienteBuscaDuplicados_Result();

            ///se almacena la información brindado por el mentodo almacenado de la clase BLAdicionCliente

            datosCliente = datosAdiccionesCliente.consultaDuplicado(id, cedulaBuscar);

            ///verifica que el objeto retornado no sea nulo

            if (datosCliente == null)
            {
                Response.Write("<script>alert('La Adicción ingresado no esta asociado a este Cliente')</script>");
            }
            else
            {
                ///se asigna los valores correspondientes
                ///

                this.ddAdicciones.SelectedValue = datosCliente.ID_Adiccion.ToString();

                this.cargaCodigoAdiccion();

                BLCliente oNombre = new BLCliente();

                sp_SeleccionaClienteCedula_Result nombreCliente = oNombre.RetornaClienteCed(txtcedulaBuscar.Text);

                this.txtNombreCompleto.Text = nombreCliente.Nombre + " " + nombreCliente.Primer_Apellido + " " + nombreCliente.Segundo_Apellido;

                this.hdCedula.Value = this.txtcedulaBuscar.Text;

                this.hdIDAdiccion.Value = datosCliente.ID.ToString();
            }
        }
        void cargaCantidadAdicciones()
        {
            BLRegistro_Poliza oCantidad = new BLRegistro_Poliza();

            BLCliente oCliente = new BLCliente();

            sp_CantidadAdCliente_Result cantidad = oCantidad.RetornaCatidadAdiccionesCliente(this.txtCedula.Text);

            sp_SeleccionaClienteCedula_Result cliente = oCliente.RetornaClienteCed(this.txtCedula.Text);

            ///verifica que el objeto retornado no sea nulo

            if (cliente == null)
            {
                Response.Write("<script>alert('El número de cédula ingresado no corresponde a ningún cliente')</script>");
            }
            else
            {
                /// una vez validado si el cliente existe se va a cargar el nombre del cliente

                this.txtNombreCompleto.Text = cliente.Nombre + " " + cliente.Primer_Apellido + " " + cliente.Segundo_Apellido;


                if (cantidad == null)
                {
                    ///Si se retorna null en la tabla de adicciones por cliente se va a asignar 0

                    this.txtTotalAdicciones.Text = "0";
                }
                else
                {
                    /// Si hay adicciones registradas se van a cargar la cantidad que el cliente tenga registrados

                    this.txtTotalAdicciones.Text = cantidad.Cantidad.ToString();
                }
            }
        }
Exemple #6
0
        void cargaDatosRegistroEnviado()
        {
            ///Optiene el parámetro enviado del grid

            string parametroID = this.Request.QueryString["id"];

            /// Valida si el parametro es correcto

            if (!string.IsNullOrEmpty(parametroID))
            {
                ///Variable que recibe el parametro enviado

                int ID = Convert.ToInt16(parametroID);

                ///Se trae la información del registro por el ID

                BLAdicciones_Cliente oAdiccionCliente = new BLAdicciones_Cliente();

                sp_SelecionaAdiccionesClienteID_Result datosClienteAdiccion = new sp_SelecionaAdiccionesClienteID_Result();

                ///se almacena la información brindado por el ID

                datosClienteAdiccion = oAdiccionCliente.RetornaAdicionClienteID(ID);

                ////
                ///

                BLAdicciones_Cliente datosAdiccionesCliente = new BLAdicciones_Cliente();

                sp_AdiccionesClienteBuscaDuplicados_Result datosCliente = new sp_AdiccionesClienteBuscaDuplicados_Result();

                ///se almacena la información brindado por el mentodo almacenado de la clase BLAdicionCliente

                datosCliente = datosAdiccionesCliente.consultaDuplicado(datosClienteAdiccion.ID_Adiccion, datosClienteAdiccion.ID_Cliente);

                ///verifica que el objeto retornado no sea nulo

                if (datosCliente == null)
                {
                    Response.Write("<script>alert('La Adicción ingresado no esta asociado a este Cliente')</script>");
                }
                else
                {
                    ///se asigna los valores correspondientes
                    ///

                    this.txtcedulaBuscar.Text = datosClienteAdiccion.ID_Cliente;

                    this.txtcedulaBuscar.ReadOnly = true;

                    this.ddAdicciones.SelectedValue = datosCliente.ID_Adiccion.ToString();

                    this.ddCodigoBurcar.SelectedValue = datosCliente.ID_Adiccion.ToString();

                    this.ddCodigoBurcar.Enabled = false;

                    this.cargaCodigoAdiccion();

                    BLCliente oNombre = new BLCliente();

                    sp_SeleccionaClienteCedula_Result nombreCliente = oNombre.RetornaClienteCed(datosClienteAdiccion.ID_Cliente);

                    this.txtNombreCompleto.Text = nombreCliente.Nombre + " " + nombreCliente.Primer_Apellido + " " + nombreCliente.Segundo_Apellido;

                    this.hdCedula.Value = this.txtcedulaBuscar.Text;

                    this.hdIDAdiccion.Value = datosCliente.ID.ToString();
                }
            }
        }