本文整理汇总了C#中Fwk.Exceptions.TechnicalException.AddMessage_Top方法的典型用法代码示例。如果您正苦于以下问题:C# TechnicalException.AddMessage_Top方法的具体用法?C# TechnicalException.AddMessage_Top怎么用?C# TechnicalException.AddMessage_Top使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fwk.Exceptions.TechnicalException
的用法示例。
在下文中一共展示了TechnicalException.AddMessage_Top方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddServiceConfiguration
/// <summary>
/// Almacena la configuración de un nuevo servicio de negocio.
/// </summary>
/// <param name="pServiceConfiguration">Configuración del servicio de negocio.</param>
/// <param name="applicationId">Identificador de aplicacion a la que pertenece el servicio</param>
/// <param name="cnnString">Nombre de cadena de conexion</param>
/// <date>2010-04-13T00:00:00</date>
/// <author>moviedo</author>
internal static void AddServiceConfiguration(ServiceConfiguration pServiceConfiguration, string applicationId, string cnnString)
{
try
{
Database wBPConfig = DatabaseFactory.CreateDatabase(cnnString);
using (System.Data.Common.DbCommand wCmd = wBPConfig.GetStoredProcCommand("fwk_Service_i"))
{
wBPConfig.AddInParameter(wCmd, "Name", System.Data.DbType.String, pServiceConfiguration.Name);
wBPConfig.AddInParameter(wCmd, "Description", System.Data.DbType.String, pServiceConfiguration.Description);
wBPConfig.AddInParameter(wCmd, "Handler", System.Data.DbType.String, pServiceConfiguration.Handler);
wBPConfig.AddInParameter(wCmd, "Request", System.Data.DbType.String, pServiceConfiguration.Request);
wBPConfig.AddInParameter(wCmd, "Response", System.Data.DbType.String, pServiceConfiguration.Response);
wBPConfig.AddInParameter(wCmd, "Available", System.Data.DbType.String, pServiceConfiguration.Available);
wBPConfig.AddInParameter(wCmd, "Audit", System.Data.DbType.String, pServiceConfiguration.Audit);
wBPConfig.AddInParameter(wCmd, "TransactionalBehaviour", System.Data.DbType.String, Enum.GetName(typeof(TransactionalBehaviour), pServiceConfiguration.TransactionalBehaviour));
wBPConfig.AddInParameter(wCmd, "IsolationLevel", System.Data.DbType.String, Enum.GetName(typeof(Fwk.Transaction.IsolationLevel), pServiceConfiguration.IsolationLevel));
wBPConfig.AddInParameter(wCmd, "ApplicationId", System.Data.DbType.String, pServiceConfiguration.ApplicationId);
wBPConfig.AddInParameter(wCmd, "CreatedUserName", System.Data.DbType.String, pServiceConfiguration.CreatedUserName);
if (Fwk.HelperFunctions.DateFunctions.IsSqlDateTimeOutOverflow(pServiceConfiguration.CreatedDateTime) == false)
wBPConfig.AddInParameter(wCmd, "CreatedDateTime", System.Data.DbType.DateTime, pServiceConfiguration.CreatedDateTime);
wBPConfig.ExecuteNonQuery(wCmd);
}
}
catch (Exception ex)
{
TechnicalException te = new TechnicalException("Problemas con Fwk.ServiceManagement al realizar operaciones con la base de datos \r\n", ex);
ExceptionHelper.SetTechnicalException<DatabaseServiceConfigurationManager>(te);
if (ex is SqlException && ((SqlException)ex).Number == 2627)
{
te.AddMessage_Top("El servicio ya exiiste. Clave duplicada ");
}
te.ErrorId = "7200";
throw te;
}
}