当前位置: 首页>>代码示例>>C#>>正文


C# TechnicalException.AddMessage_Top方法代码示例

本文整理汇总了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;

            }
		}
开发者ID:Pelsoft,项目名称:fwk_10.3,代码行数:54,代码来源:DatabaseServiceConfigurationManager.cs


注:本文中的Fwk.Exceptions.TechnicalException.AddMessage_Top方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。