SourceCode/PROMS/DataLoader/ErrorReport.cs

31 lines
788 B
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Csla.Validation;
namespace DataLoader
{
public static class ErrorRpt
{
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static void ErrorReport(IVEHasBrokenRules mybr)
{
string smess = mybr.GetType().Name;
IVEHasBrokenRules hbr = mybr.HasBrokenRules;
if (hbr == null) smess += "\n Unknown Error";
else
{
smess += "\n In object" + hbr.GetType().Name;
foreach (BrokenRule br in hbr.BrokenRules)
{
smess += "\n" + br.Property + " - " + br.Description;
}
}
//MessageBox.Show(smess);
_MyLog.Error(smess);
}
}
}