예제 #1
0
 //Cuando se llenen, se retira el error
 private void SinErrores()
 {
     Provider1.SetError(txtCiTrabajador, "");
     Provider2.SetError(txtNombre, "");
     Provider3.SetError(txtContrasena, "");
     Provider4.SetError(richDireccion, "");
     Provider5.SetError(txtTelefono, "");
     Provider6.SetError(txtCorreo, "");
 }
예제 #2
0
        //Validar datos al ingresar
        private bool validar()
        {
            bool error = true;

            if (txtCiTrabajador.Text == "")
            {
                error = false;
                Provider1.SetError(txtCiTrabajador, "Agrega el CI del trabajador");
            }
            if (txtNombre.Text == "")
            {
                error = false;
                Provider2.SetError(txtNombre, "Inserta un nombre");
            }
            if (txtContrasena.Text == "")
            {
                error = false;
                Provider3.SetError(txtContrasena, "¡Crea una contraseña!");
            }
            if (richDireccion.Text == "")
            {
                error = false;
                Provider4.SetError(richDireccion, "Agrega la dirección del trabajdor");
            }
            if (txtTelefono.Text == "")
            {
                error = false;
                Provider5.SetError(txtTelefono, "Inserta un número telefónico");
            }
            if (txtCorreo.Text == "")
            {
                error = false;
                Provider6.SetError(txtCorreo, "No olvides el correo electrónico");
            }
            return(error);
        }
예제 #3
0
        public void TestAttemptToCacheStruct()
        {
            var provider = new Provider4();

            Assert.Throws <ArgumentException>(() => DependencyActivator.MergeDependencies(provider, new DependencyContainer()));
        }