Example #1
0
        private void btnSiguiente_Click(object sender, EventArgs e)
        {
            try
            {
                string nombre = txtNombre.Text;
                string Apaterno = txtPaterno.Text;
                string Amaterno = txtMaterno.Text;
                string telefono = txtTel.Text;
                string email = new MailAddress(txtMail.Text).ToString();

                if (String.IsNullOrWhiteSpace(nombre) || String.IsNullOrWhiteSpace(Apaterno) || String.IsNullOrWhiteSpace(email) || String.IsNullOrWhiteSpace(telefono))
                {
                    MessageBox.Show("Favor de llenar todos los campos requeridos.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                if (!telLengt(telefono))
                {
                    MessageBox.Show("Teléfono no válido.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                GuardarCliente(nombre, Apaterno, Amaterno, telefono, email);
                Invitados inv = new Invitados();
                inv.Show();
                this.Close();
            }
            catch
            {
                MessageBox.Show("Email no válido.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void btnAnterior_Click(object sender, EventArgs e)
        {
            string   nombre     = txtNombre.Text;
            DateTime fecha      = dtpFecha.Value;
            string   hora       = txtHora.Text;
            string   calle      = txtCalle.Text;
            string   colonia    = txtColonia.Text;
            string   cp         = txtCP.Text;
            string   numero     = txtNumero.Text;
            string   comentario = txtComent.Text;

            GuardarEvento(nombre, fecha, hora, calle, colonia, cp, numero, comentario);

            Invitados inv = new Invitados();

            inv.Show();
            this.Close();
        }