Example #1
0
        /// <summary>
        /// Валидация и сообщения об ошибках
        /// </summary>
        /// <param name="columnName"></param>
        /// <returns></returns>
        public string this[string columnName]
        {
            get
            {
                var error = string.Empty;
                switch (columnName)
                {
                case "Login":
                    if (Login == null)
                    {
                        error = "Enter your e-mail";
                    }
                    else if (!ValidationMethods.EmailValidation(Login))
                    {
                        error = "Enter correct e-mail";
                    }

                    break;

                case "Password":

                    break;
                }
                return(error);
            }
        }
Example #2
0
        /// <summary>
        /// Валидация и сообщения об ошибках
        /// </summary>
        /// <param name="columnName"></param>
        /// <returns></returns>
        public string this[string columnName]
        {
            get
            {
                var error = string.Empty;
                switch (columnName)
                {
                case "Email":
                    if (Email == null)
                    {
                        error = "Enter your e-mail";
                    }
                    else if (!ValidationMethods.EmailValidation(Email))
                    {
                        error = "Enter correct e-mail";
                    }

                    break;

                case "FirstName":
                    if (FirstName == null)
                    {
                        error = "Enter your first name";
                    }
                    else if (!ValidationMethods.NameValidation(FirstName))
                    {
                        error = "Enter correct first name";
                    }
                    break;

                case "LastName":
                    if (LastName == null | LastName == string.Empty)
                    {
                        error = "Enter your last name";
                    }
                    else if (!ValidationMethods.NameValidation(LastName))
                    {
                        error = "Enter correct last name";
                    }

                    break;

                case "Password":
                    if (LastName == null)
                    {
                        error = "Enter your last name";
                    }
                    else if (!ValidationMethods.NameValidation(LastName))
                    {
                        error = "Enter correct last name";
                        MessageBox.Show("Wrong password");
                    }

                    break;
                }
                return(error);
            }
        }