EnVisageOnline/Main-RMO/Source/EnVisage/Code/BLL/BLLException.cs

57 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace EnVisage.Code.BLL
{
/// <summary>
/// Represents an exception occurred inside the business logic layer.
/// </summary>
public class BLLException : Exception
{
public bool DisplayError { get; set; }
public BLLException(bool displayError = true)
{
DisplayError = displayError;
}
public BLLException(string message) : base(message)
{
DisplayError = true;
}
public BLLException(string message, bool displayError = true) : base(message)
{
DisplayError = displayError;
}
}
#region BLLException Implementations
public class UOMNotExistsException : BLLException
{
public UOMNotExistsException()
: base("Unit of Measure does not exist or it's value equal to zero. Unable to calculate data.", true)
{
}
}
public class RestorePasswordTokenExpiredException : BLLException
{
public RestorePasswordTokenExpiredException()
: base("Restore password link is expired.", true)
{
}
}
public class MongoCollectionNotExistsException : BLLException
{
public MongoCollectionNotExistsException(string collectionName)
: base(string.Format("{0} collection does not exist. Make sure MongoDB is started and collection exists.", collectionName), true)
{
}
}
#endregion
}