Example #1
0
 private void Guardar()
 {
     try
     {
         if (!ValidarDatosFormulario())
         {
             estado.Nombre = txtNombreEstado.Text;
             if (_idEstado <= 0)
             {
                 if (EstadoBL.Guardar(estado) > 0)
                 {
                     MessageBox.Show("Registro exitoso");
                     this.Close();
                 }
             }
             else
             {
                 if (EstadoBL.Modificar(estado) > 0)
                 {
                     MessageBox.Show("Registro exitoso");
                     this.Close();
                 }
             }
         }
     }
     catch (Exception) {
         MessageBox.Show("Ocurrio un error al intentar guardar");
     }
 }
        private void Guardar()
        {
            try
            {
                if (!ValidarDatosForm())
                {
                    estado.Nombre = textNombreEstado.Text;

                    if (_idEstado <= 0)
                    {
                        if (EstadoBL.Guardar(estado) > 0)
                        {
                            MessageBox.Show("Se guardo correctamente");
                            this.Close();
                        }
                    }
                    else
                    {
                        if (EstadoBL.Modificar(estado) > 0)
                        {
                            MessageBox.Show("Se guardo correctamente");
                            this.Close();
                        }
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Ocurrio un error al intentar Guardar");
            }
        }