Exemplo n.º 1
0
 private void LimpiarError()
 {
     IDerrorProvider.Clear();
     UsuarioerrorProvider.Clear();
     NombreerrorProvider.Clear();
     ContraseñaerrorProvider.Clear();
     ComentarioerrorProvider.Clear();
 }
 private void LimpiarProvider()
 {
     ArticuloIdProvider.Clear();
     CantidadErrorProvider.Clear();
     ComentarioerrorProvider.Clear();
     IDerrorProvider.Clear();
     DetalleerrorProvider.Clear();
     DetalleerrorProvider.Clear();
 }
Exemplo n.º 3
0
        private int SetError(int error)
        {
            int            paso = 0;
            List <Usuario> user = new List <Usuario>();

            if (error == 1 && IDcomboBox.Text == string.Empty)
            {
                IDerrorProvider.SetError(IDcomboBox, "Llenar Campo!!");
                paso = 1;
                return(paso);
            }
            if (error == 2 && UsuariotextBox.Text == string.Empty)
            {
                UsuarioerrorProvider.SetError(UsuariotextBox, "Llenar Campo!!");
                paso = 1;
            }
            if (error == 2 && NombretextBox.Text == string.Empty)
            {
                NombreerrorProvider.SetError(NombretextBox, "Llenar Campo!!");
                paso = 1;
            }
            if (error == 2 && ContraseñatextBox.Text == string.Empty)
            {
                ContraseñaerrorProvider.SetError(ContraseñatextBox, "Llenar Campo!!");
                paso = 1;
            }
            if (error == 2 && ConfirmartextBox.Text == string.Empty)
            {
                ContraseñaerrorProvider.SetError(ConfirmartextBox, "Llenar Campo!!");
                paso = 1;
            }
            if (error == 2 && ComentariotextBox.Text == string.Empty)
            {
                ComentarioerrorProvider.SetError(ComentariotextBox, "Llenar Campo!!");
                paso = 1;
            }
            if (error == 3 && ContraseñatextBox.Text != ConfirmartextBox.Text)
            {
                ContraseñaerrorProvider.SetError(ConfirmartextBox, "Llenar Campo!!");
                ContraseñaerrorProvider.SetError(ContraseñatextBox, "Llenar Campo!!");
                paso = 1;
            }

            if (error == 4 && BLL.UsuarioBLL.GetList(t => t.NombreUsuario == UsuariotextBox.Text).Exists(t => t.NombreUsuario == UsuariotextBox.Text) && IDcomboBox.Text == string.Empty)
            {
                UsuarioerrorProvider.SetError(UsuariotextBox, "Debe de crear otro usuario!!");
                paso = 1;
            }


            return(paso);
        }
        private bool SetErrorProvider(int Abrir)
        {
            bool paso = false;

            if (Abrir == 1 || Abrir == 3 || Abrir == 4)
            {
                if (ArticuloIDnumericUpDown.Value == 0)
                {
                    ArticuloIdProvider.SetError(ArticuloIDnumericUpDown, "Campos Vacio");
                    paso = false;
                }
                else
                {
                    paso = true;
                }
            }
            if (Abrir == 2 || Abrir == 3 || Abrir == 4)
            {
                if (CantidadnumericUpDown.Value == 0)
                {
                    CantidadErrorProvider.SetError(CantidadnumericUpDown, "Campo vacio");
                    paso = false;
                }
                else
                {
                    paso = true;
                }
            }
            if (Abrir == 4)
            {
                if (ComentariotextBox.Text == string.Empty)
                {
                    ComentarioerrorProvider.SetError(ComentariotextBox, "Campo Vacio");
                    paso = false;
                }
                else
                {
                    paso = true;
                }
            }
            if (Abrir == 5)
            {
                if (CotizaciontextBox.Text == string.Empty)
                {
                    IDerrorProvider.SetError(CotizaciontextBox, "Campo vacio");
                }
                else
                {
                    paso = true;
                }
            }

            if (Abrir == 6)
            {
                if (DetallenumericUpDown.Value == 0)
                {
                    DetalleerrorProvider.SetError(DetallenumericUpDown, "Campo vacio");
                    paso = false;
                }
                else
                {
                    paso = true;
                }
            }



            return(paso);
        }