Пример #1
0
        private void validarCampoObligatorios(TextBox oEventSender)
        {
            string errorString = "";

            if (string.IsNullOrEmpty(oEventSender.Text))
            {
                errorString += "El " + oEventSender.Name + " es un campo obligatorio";
            }

            oErrorProviderExtension.SetErrorWithCount(oEventSender, errorString);
        }
Пример #2
0
        private void validarCampoNumerico(TextBox oEventSender)
        {
            string errorString = "";

            foreach (char oChar in oEventSender.Text)
            {
                if (!(char.IsDigit(oChar)))
                {
                    errorString += "El " + oEventSender.Text + " debe ser un numero entero mayor que 0";
                    break;
                }
            }
            oErrorProviderExtension.SetErrorWithCount(oEventSender, errorString);
        }