コード例 #1
0
        private static void ValidateDecimal(string pFieldName, object pValue, OperationResult pOperationResult)
        {
            decimal lResult;

            if (!Decimal.TryParse(pValue.ToString(), out lResult))
            {
                pOperationResult.InvalidField(pFieldName, "Invalid", pValue);
            }
        }
コード例 #2
0
 public static void ValidateRequired(DataField pField, DataFieldCollection pValues, OperationResult pOperationResult)
 {
     if (!pValues.ContainsKey(pField))
     {
         pOperationResult.InvalidField(pField.Name, "Required", null);
     }
     else
     {
         if (pValues[pField] == null)
         {
             pOperationResult.InvalidField(pField.Name, "Required", null);
         }
         else
         {
             if (pValues[pField].ToString() == "")
                 pOperationResult.InvalidField(pField.Name, "Required", null);
         }
     }
 }
コード例 #3
0
        private static void ValidateDate(string pFieldName, object pValue, OperationResult pOperationResult)
        {
            DateTime lResult;

            if (pValue.GetType() == typeof(DateTime)) return;

            if (!DateTime.TryParse(pValue.ToString(), out lResult))
            {
                pOperationResult.InvalidField(pFieldName, "Invalid", pValue);
            }
        }