using Quadarax.Foundation.Core.Exceptions; namespace Quadarax.Application.QLiberace.Common { public class ExceptionLibrary : ExceptionCodes { protected override void OnSetupCodes() { AddCode(ExceptionsCodes.ValidationErrorsCode, ExceptionsCodes.ValidationErrorsMsg); AddCode(ExceptionsCodes.SettingsNotFoundCode, ExceptionsCodes.SettingsNotFoundMsg); AddCode(ExceptionsCodes.SettingsNotFoundForModuleCode, ExceptionsCodes.SettingsNotFoundForModuleMsg); AddCode(ExceptionsCodes.SettingsHasNoPropertyCode, ExceptionsCodes.SettingsHasNoPropertyMsg); AddCode(ExceptionsCodes.SettingsAlreadyExistsCode, ExceptionsCodes.SettingsAlreadyExistsMsg); AddCode(ExceptionsCodes.TenantNotFoundCode, ExceptionsCodes.TenantNotFoundMsg); AddCode(ExceptionsCodes.TenantAlreadyExistsCode, ExceptionsCodes.TenantAlreadyExistsMsg); AddCode(ExceptionsCodes.TenantLockedCode, ExceptionsCodes.TenantLockedMsg); AddCode(ExceptionsCodes.TenantDifferentContextCode, ExceptionsCodes.TenantDifferentContextMsg); AddCode(ExceptionsCodes.UserNotFoundCode, ExceptionsCodes.UserNotFoundMsg); AddCode(ExceptionsCodes.UserAlreadyExistsCode, ExceptionsCodes.UserAlreadyExistsMsg); AddCode(ExceptionsCodes.CustomerNotFoundCode, ExceptionsCodes.CustomerNotFoundMsg); AddCode(ExceptionsCodes.CustomerUserAlreadyAssignedCode, ExceptionsCodes.CustomerUserAlreadyAssignedMsg); AddCode(ExceptionsCodes.CustomerUserNotFoundAssignedCode, ExceptionsCodes.CustomerUserNotFoundAssignedMsg); } public static class ExceptionsCodes { public const string ValidationErrorsMsg = "Validation errors follows:"; public const int ValidationErrorsCode = 1000; public const string SettingsNotFoundMsg = "Setting '{0}' not found fo module '{1}'"; public const int SettingsNotFoundCode = 10000; public const string SettingsNotFoundForModuleMsg = "Any setting not found for module '{0}'"; public const int SettingsNotFoundForModuleCode = 10001; public const string SettingsHasNoPropertyMsg = "Setting '{0}' has no defined property in class '{1}'"; public const int SettingsHasNoPropertyCode = 10002; public const string SettingsAlreadyExistsMsg = "Setting '{0}' for module '{1}' already exists."; public const int SettingsAlreadyExistsCode = 10003; public const string TenantNotFoundMsg = "Tenant with identifier {0}='{1}' not found"; public const int TenantNotFoundCode = 10010; public const string TenantAlreadyExistsMsg = "Tenant with code '{0}' already exists"; public const int TenantAlreadyExistsCode = 10011; public const string TenantLockedMsg = "Tenant with code '{0}' is LOCKED! Cannot access."; public const int TenantLockedCode = 10012; public const string TenantDifferentContextMsg = "Cannot update different Tenant with code '{0}' in tenant context '{1}'"; public const int TenantDifferentContextCode = 10013; public const string UserNotFoundMsg = "User with identifier {0}='{1}' not found"; public const int UserNotFoundCode = 10020; public const string UserAlreadyExistsMsg = "User with login name '{0}' already exists"; public const int UserAlreadyExistsCode = 10021; public const string CustomerNotFoundMsg = "Customer with identifier {0}='{1}' not found"; public const int CustomerNotFoundCode = 10030; public const string CustomerUserAlreadyAssignedMsg = "Customer with identifier {0}='{1}' has already user '{2}' assigned."; public const int CustomerUserAlreadyAssignedCode = 10031; public const string CustomerUserNotFoundAssignedMsg = "Customer with identifier {0}='{1}' has no user '{2}' assigned."; public const int CustomerUserNotFoundAssignedCode = 10032; } } }