Exemple #1
0
        public override bool check(string input, LanguageNotification l)
        {
            try
            {
                int a = int.Parse(input);
                if (a.IsEqual(index) || a.IsGreaterThan(index))
                {
                    return(true);
                }

                this.Message = l.getErrorMessage(this.Code);
                return(false);
            }
            catch
            {
                this.Message = l.getErrorMessage(this.Code);
                return(false);
            }
        }
Exemple #2
0
        public override bool check(string input, LanguageNotification l)
        {
            if (string.Compare(input, this.compare) == 0)
            {
                return(true);
            }

            this.Message = l.getErrorMessage(this.Code);
            return(false);
        }
Exemple #3
0
        public override bool check(string input, LanguageNotification l)
        {
            if (input.IsPassword())
            {
                return(true);
            }

            this.Message = l.getErrorMessage(this.Code);
            return(false);
        }
Exemple #4
0
        public override bool check(string input, LanguageNotification l)
        {
            try
            {
                int a = int.Parse(input);
                if (a.IsExclusiveBetween(from, to))
                {
                    return(true);
                }

                this.Message = l.getErrorMessage(this.Code);
                return(false);
            }
            catch
            {
                this.Message = l.getErrorMessage(this.Code);
                return(false);
            }
        }
Exemple #5
0
        public override bool check(string input, LanguageNotification l)
        {
            try
            {
                if (input.Length != 0)
                {
                    //Tính tổng các chữ số từ chữ số thứ nhất bên phải qua cách nhau một chữ số
                    for (i = input.Length - 1; i >= 0; i -= 2)
                    {
                        this.checkSum += (input[i] - '0');
                    }

                    ////Tính tổng các chữ số từ chữ số thứ hai bên phải qua cách nhau một chữ số
                    for (i = input.Length - 2; i >= 0; i -= 2)
                    {
                        int val = ((input[i] - '0') * 2);
                        while (val > 0)
                        {
                            checkSum += (val % 10);
                            val      /= 10;
                        }
                    }

                    if ((checkSum % 10) == 0)
                    {
                        return(true);
                    }
                }

                this.Message = l.getErrorMessage(this.Code);
                return(false);
            }
            catch
            {
                this.Message = l.getErrorMessage(this.Code);
                return(false);
            }
        }