Пример #1
0
        /// <summary>
        /// Check all property that mark FieldNotNull attribute.
        /// </summary>
        /// <returns>Return list of property name which incorrect. If validate has pass it will return empty or null list.</returns>
        public List <string> ValidateFieldNotNull()
        {
            List <string> listError = new List <string>();

            PropertyInfo[] props = this.GetType().GetProperties();
            for (int i = 0; i < props.Length; i++)
            {
                object[] objs = props[i].GetCustomAttributes(typeof(FieldNotNullAttribute), false);
                if (objs == null || objs.Length < 1)
                {
                    continue;
                }

                NZBaseObject baseObject = props[i].GetValue(this, null) as NZBaseObject;
                if (baseObject == null)
                {
                    continue;
                }

                if (baseObject.IsNull)
                {
                    listError.Add(props[i].Name);
                }
            }

            return(listError);
        }
Пример #2
0
 public Parameter(string ParameterName, DataType ParameterType, NZBaseObject objectValue)
     : this(ParameterName, ParameterType, 0, objectValue.Value)
 {
 }