init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
29
Kreta.BusinessLogic/Classes/Validations/BasicValidations.cs
Normal file
29
Kreta.BusinessLogic/Classes/Validations/BasicValidations.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.BusinessLogic.Classes.Validations
|
||||
{
|
||||
public static class BasicValidations
|
||||
{
|
||||
public static void ValidateNonZeroFields(params int?[] fields)
|
||||
{
|
||||
foreach (var field in fields)
|
||||
{
|
||||
if (!field.HasValue || field <= 0)
|
||||
{
|
||||
throw new BlException(ErrorResource.PropertyCantBeZeroOrNULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void ValidateMustBeNullFields(params object[] fields)
|
||||
{
|
||||
foreach (var field in fields)
|
||||
{
|
||||
if (field != null)
|
||||
{
|
||||
throw new BlException(ErrorResource.PropertyMustBeNULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue