using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Logic.Validate
{
public static class Format
{
///
/// Validates that an sku number string is the correct format i.e. 000000-00
///
///
///
public static bool SkuNumber(string skuNumber)
{
if (string.IsNullOrEmpty(skuNumber)) { return false;}
int count = 0;
foreach (char c in skuNumber)
{
count++;
if (count == 7)
{
string hyphen = "-";
if (c != hyphen[0])
{
return false;
}
}
else if (count > 9)
{
return false;
}
else if (!char.IsNumber(c))
{
return false;
}
}
count = 0;
return true;
}
///
/// Checks the datetime is not default and is utc
///
///
///
public static bool DateTime(DateTime dateTime)
{
if (dateTime == default(DateTime))
{ return false; }
else if (dateTime.Kind != DateTimeKind.Utc)
{ return false; }
else
{ return true; }
}
}
}