Beispiel #1
0
        private void btnRmascota_Click(object sender, EventArgs e)
        {
            Mascota       m  = new Mascota();
            RegistroNuevo rn = new RegistroNuevo();

            m.Show();
            rn.Close();
        }
Beispiel #2
0
 public void addNuevoRegistro()
 {
     try
     {
         int    i         = 0;
         string nombre    = txtNombre.Text + " " + txtApellidoPaterno.Text + " " + txtApellidoMaterno.Text;
         string direccion = txtDireccion.Text + " Col. " + txtColonia.Text;
         oClienteBO.Nombre            = nombre;
         oClienteBO.FechaN            = mtbFechaNC.Text;
         oClienteBO.Edad              = txtEdad.Text;
         oClienteBO.Genero            = GeneroCli();
         oClienteBO.Telefono          = mtbTelefono.Text;
         oClienteBO.CorreoElectronico = txtCorreoElectronico.Text;
         oClienteBO.Direccion         = direccion;
         oClienteBO.CodigoPostal      = mtbCodigoPostal.Text;
         oClienteBO.Estado            = cmbEstado.Text;
         oClienteBO.Ciudad            = txtCiudad.Text;
         i = oCliente.crearCliente(oClienteBO);
         limpiarcampos();
         if (i == 0)
         {
             RegistroNuevo opRegistroNuevo;
             opRegistroNuevo = new RegistroNuevo();
             opRegistroNuevo.Show();
             MessageBox.Show("Error al guardar los datos", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
             opRegistroNuevo.Close();
         }
         else
         {
             RegistroNuevo opRegistroNuevo2;
             opRegistroNuevo2 = new RegistroNuevo();
             opRegistroNuevo2.Show();
             MessageBox.Show("Datos guardados exitosamente", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("ERROR. La operacion no se pudo realizar", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }