Example #1
0
        private void btnBuscarRuc_Click(object sender, EventArgs e)
        {
            UnObjeto = clsRuc.Buscar_PorNumeroRUC(txtRUC.Text);

            if (UnObjeto == null)
            {
                MessageBox.Show("Numero de RUC no encontrado");
                //Preguntar si desea registrar al cliente
                if (MessageBox.Show("¿Desea registrar un nuevo RUC?",
                                    "Confirmación",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question) ==
                    System.Windows.Forms.DialogResult.Yes)
                {
                    txtRazonSocial.Enabled = true; txtDireccion.Enabled = true;
                    txtRazonSocial.Clear(); txtDireccion.Clear();
                    txtRUC.SelectAll(); txtRazonSocial.Focus();

                    //Activar banderita
                    Bandera = true;
                }
            }
            else
            {
                txtRazonSocial.Text = UnObjeto.RazonSocial;
                txtDireccion.Text   = UnObjeto.DireccionRuc;
            }
        }
Example #2
0
        public static clsRuc Buscar_PorNumeroRUC(string parNroRUC)
        {
            clsRuc        Resultado = null;
            SqlConnection cn;

            cn = new SqlConnection(mdlVarirablesAplicacion.Cadena);
            SqlCommand cmd = new SqlCommand("usp_RUC_Buscar_PorNroRUC", cn);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@parRUC", parNroRUC);
            SqlDataReader contenedor;

            cn.Open();
            contenedor = cmd.ExecuteReader();
            while (contenedor.Read() == true)
            {
                Resultado = new clsRuc(Convert.ToInt32(contenedor["idRuc"]),
                                       contenedor["numeroRuc"].ToString(),
                                       contenedor["razonSocial"].ToString(),
                                       contenedor["direccion"].ToString()
                                       );
            }
            cn.Close();
            return(Resultado);
        }
Example #3
0
 //CREACIÓN DEL CONSTRUCTOR:
 public clsHuesped(string parametroDocumentoIdentidadHuesped,
                   string parametroNombresHuesped,
                   string parametroApellidoPaternoHuesped,
                   string parametroApellidoMaternoHuesped,
                   DateTime parametroFechaNacimientoHuesped,
                   string parametroProcedenciaHuesped,
                   Char parametroGeneroHuesped,
                   clsRuc parametroRUC)
 {
     DocumentoIdentidadHuesped = parametroDocumentoIdentidadHuesped;
     NombresHuesped            = parametroNombresHuesped;
     ApellidoPaternoHuesped    = parametroApellidoPaternoHuesped;
     ApellidoMaternoHuesped    = parametroApellidoMaternoHuesped;
     FechaNacimientoHuesped    = parametroFechaNacimientoHuesped;
     ProcedenciaHuesped        = parametroProcedenciaHuesped;
     GeneroHuesped             = parametroGeneroHuesped;
     RucH = parametroRUC;
 }