Exemplo n.º 1
0
        private void BTNcalcular_Click(object sender, EventArgs e)
        {
            Curp _curp = new Curp();

            if (ValidaCampos())
            {
                try
                {
                    char[] sexo = CBOsexo.SelectedItem.ToString().ToCharArray();
                    Debug.WriteLine(">>> " + sexo[0].ToString()[0] + " - " + DTPnac.Value.ToString("dd/MM/yyyy") + " - " + CBOedonac.Text + " - " + Clases.Funciones.ParseEstados(CBOedonac.Text));
                    string curp = _curp.ObtenCurp(TXTnombre.Text, TXTappat.Text, TXTapmat.Text, sexo[0], DTPnac.Value.ToString("dd/MM/yyyy"), Clases.Funciones.ParseEstados(CBOedonac.Text));
                    TXTcurp.Text = curp;
                }
                catch (Exception exception)
                {
                    MessageBox.Show(MSG_ERROR_CURP, MSG_ERROR_GENERAL, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Debug.Write("ERROR: " + exception.Message);
                }
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            using (testEntities5 db = new testEntities5())
            {
                Curp   crp2    = new Curp();
                string sexAux2 = comboBox1.Text;
                char   sexAux  = sexAux2[0];
                string CurpAux = crp2.ObtenCurp(txtPNombre.Text, txtPApellido.Text, txtSApellido.Text, sexAux, dateTimePicker1.Value.ToString(), txtENacimiento.Text);

                if (i == null)
                {
                    db.IUsuario(pNombre: txtPNombre.Text, sNombre: txtSNombre.Text, pApellido: txtPApellido.Text, sApellido: txtSApellido.Text, sexo: comboBox1.Text, telefono: maskedTextBox1.Text, fNacimiento: dateTimePicker1.Value, estadoC: txtEstadoC.Text, delegacionM: txtDelegaionM.Text, colonia: txtColonia.Text, calleN: txtCalleN.Text, eNacimiento: txtENacimiento.Text, cURP: CurpAux);
                }
                else
                {
                    db.Edit_Usr(pNombre: txtPNombre.Text, sNombre: txtSNombre.Text, pApellido: txtPApellido.Text, sApellido: txtSApellido.Text, sexo: comboBox1.Text, telefono: maskedTextBox1.Text, fNacimiento: dateTimePicker1.Value, estadoC: txtEstadoC.Text, delegacionM: txtDelegaionM.Text, colonia: txtColonia.Text, calleN: txtCalleN.Text, cURP: CurpAux);
                }
                this.Close();
            }
        }
Exemplo n.º 3
0
        public void NoVocalInternaTest()
        {
            var curp = Curp.Generar("Andres", "Ich", "Rodriguez", Sexo.Hombre, new DateTime(1984, 12, 06), Estado.Campeche);

            Assert.AreEqual("IXRA", curp.Substring(0, 4));
        }
Exemplo n.º 4
0
        public void PalabraAltisonanteTest()
        {
            var curp = Curp.Generar("Ofelia", "Pedrero", "Dominguez", Sexo.Mujer, new DateTime(1995, 03, 12), Estado.Campeche);

            Assert.AreEqual("PXDO", curp.Substring(0, 4));
        }
Exemplo n.º 5
0
        public void UnApellidoTest()
        {
            var curp = Curp.Generar("Luis", "Perez", null, Sexo.Hombre, new DateTime(1979, 01, 01), Estado.Zacatecas);

            Assert.AreEqual("PEXL", curp.Substring(0, 4));
        }
Exemplo n.º 6
0
        public void ApellidoCompuestoTest()
        {
            var curp = Curp.Generar("Carlos", "Mc Gregor", "Lopez", Sexo.Hombre, new DateTime(1963, 01, 01), Estado.Sonora);

            Assert.AreEqual("GELC", curp.Substring(0, 4));
        }
Exemplo n.º 7
0
        public void NombreCompuestoTest()
        {
            var curp = Curp.Generar("Ma. de los angeles", "Moreno", "Sanchez", Sexo.Mujer, new DateTime(1998, 01, 01), Estado.San_Luis_Potosi);

            Assert.AreEqual("RNN", curp.Substring(13, 3));
        }
Exemplo n.º 8
0
        public void LetraInicialÑTest()
        {
            var curp = Curp.Generar("Alberto", "Ñando", "Rodriguez", Sexo.Hombre, new DateTime(2000, 01, 01), Estado.Aguascalientes);

            Assert.AreEqual("XARA", curp.Substring(0, 4));
        }
Exemplo n.º 9
0
 public OpCurp()
 {
     critza = new Curp();
 }