2007-11-20 20:12:45 +00:00

40 lines
1.4 KiB
C#

// ========================================================================
// Copyright 2007 - Volian Enterprises, Inc. All rights reserved.
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
// ------------------------------------------------------------------------
// $Workfile: $ $Revision: $
// $Author: $ $Date: $
//
// $History: $
// ========================================================================
using System;
using System.Data;
using System.Data.SqlClient;
using Csla;
using Csla.Data;
using System.Configuration;
using System.IO;
using System.ComponentModel;
using Csla.Validation;
using System.Reflection;
namespace VEPROMS.CSLA.Library
{
/// <summary>
/// CommonRules Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
public static class CommonRules
{
public static bool Required(object target, Csla.Validation.RuleArgs e)
{
PropertyInfo propertyInfoObj = target.GetType().GetProperty(e.PropertyName);
if (propertyInfoObj == null) return true;
if (propertyInfoObj.GetValue(target, null) == null)
{
e.Description = e.PropertyName + " is a required field";
return false;
}
return true;
}
}
}