public string this[string columnName]
        {
            get
            {
                string sReturn = null;
                switch (columnName)
                {
                case "ULN":
                    if (String.IsNullOrEmpty(ULN.ToString()))
                    {
                        sReturn = String.Format("{0} required.", columnName);
                    }

                    if (ULN != null && ULN.Length > 0)
                    {
                        sReturn += CheckPropertyLength(ULN, CLASSNAME, columnName);
                        long number;
                        bool result = Int64.TryParse(ULN, out number);
                        if (!result)
                        {
                            sReturn += String.Format("{0} has non numeric values. this will NOT be SAVED !!!", columnName);
                        }
                    }
                    break;

                default:
                    break;
                }
                return(sReturn);
            }
        }
Example #2
0
        public string this[string columnName]
        {
            get
            {
                string result = null;

                if (columnName == "LearnRefNumber")
                {
                    if (String.IsNullOrEmpty(LearnRefNumber))
                    {
                        result = String.Format("{0} required.", columnName);
                    }
                    if (ULN != null)
                    {
                        return(CheckPropertyLength(LearnRefNumber, CLASSNAME, columnName, TABS));
                    }
                    //if (LearnRefNumber != null && LearnRefNumber.ToString().Length > 12)
                    //    result = String.Format("{0} exceeds maximum length (12 digits).", columnName);
                }

                if (columnName == "ULN")
                {
                    if (String.IsNullOrEmpty(ULN.ToString()))
                    {
                        result = String.Format("{0} required.", columnName);
                    }
                    if (ULN != null)
                    {
                        return(CheckPropertyLength(ULN, CLASSNAME, columnName, TABS));
                    }
                }
                return(result);
            }
        }
        public string this[string columnName]
        {
            get
            {
                string result = null;

                if (columnName == "LearnRefNumber")
                {
                    if (String.IsNullOrEmpty(LearnRefNumber))
                    {
                        result = String.Format("{0} required.", columnName);
                    }

                    if (LearnRefNumber != null && LearnRefNumber.ToString().Length > 9)
                    {
                        result = String.Format("{0} exceeds maximum length (9 digits).", columnName);
                    }
                }

                if (columnName == "ULN")
                {
                    if (ULN != null && ULN.ToString().Length > 10)
                    {
                        result = String.Format("{0} exceeds maximum length (10 digits).", columnName);
                    }
                }
                return(result);
            }
        }
Example #4
0
        public string this[string columnName]
        {
            get
            {
                string sReturn = null;
                switch (columnName)
                {
                case "ULN":
                    if (ULN == null || ULN.ToString().Length == 0)
                    {
                        return("ULN - required\r\n");
                    }
                    if (ULN != null && ULN.Length > 0)
                    {
                        sReturn += CheckPropertyLength(ULN, CLASSNAME, columnName);
                        long number;
                        bool result = Int64.TryParse(ULN, out number);
                        if (!result)
                        {
                            sReturn += String.Format("{0} has non numeric values. this will NOT be SAVED !!!", columnName);
                        }
                    }

                    break;

                case "PrevUKPRN":
                    if (PrevUKPRN != null && PrevUKPRN.Length > 0)
                    {
                        sReturn += CheckPropertyLength(PrevUKPRN, CLASSNAME, columnName);
                        int  number;
                        bool result = Int32.TryParse(PrevUKPRN, out number);
                        if (!result)
                        {
                            sReturn += String.Format("{0} has non numeric values. this will NOT be SAVED !!!", columnName);
                        }
                    }
                    break;

                default:
                    break;
                }
                return(sReturn);
            }
        }