Exemplo n.º 1
0
		/// <summary>
		/// 获得和AppLog相关的设置
		/// </summary>
		/// <returns></returns>
		public static AppLogSettings GetConfig()
		{
			AppLogSettings settings = (AppLogSettings)ConfigurationBroker.GetSection("appLogSettings");

			if (settings == null)
				settings = new AppLogSettings();

			return settings;
		}
        public void Insert(UploadFileHistory history)
        {
            ExceptionHelper.FalseThrow <ArgumentNullException>(history != null, "history");

            string sql = ORMapping.GetInsertSql(history, TSqlBuilder.Instance) + TSqlBuilder.Instance.DBStatementSeperator +
                         "SELECT SCOPE_IDENTITY()";

            decimal identity = (decimal)DbHelper.RunSqlReturnScalar(sql, AppLogSettings.GetConfig().ConnectionName);

            history.ID = Decimal.ToInt32(identity);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获得和AppLog相关的设置
        /// </summary>
        /// <returns></returns>
        public static AppLogSettings GetConfig()
        {
            AppLogSettings settings = (AppLogSettings)ConfigurationBroker.GetSection("appLogSettings");

            if (settings == null)
            {
                settings = new AppLogSettings();
            }

            return(settings);
        }
        public UploadFileHistory Load(int id)
        {
            WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder();

            builder.AppendItem("ID", id);
            builder.AppendTenantCode(typeof(UploadFileHistory));

            string sql = string.Format("SELECT * FROM WF.UPLOAD_FILE_HISTORY WHERE {0}", builder.ToSqlString(TSqlBuilder.Instance));

            DataTable table = DbHelper.RunSqlReturnDS(sql, AppLogSettings.GetConfig().ConnectionName).Tables[0];

            ExceptionHelper.FalseThrow(table.Rows.Count > 0, "不能找到ID为{0}的UploadFileHistory的数据");

            UploadFileHistory history = new UploadFileHistory();

            ORMapping.DataRowToObject(table.Rows[0], history);

            return(history);
        }
 protected override string GetConnectionName()
 {
     return(WfRuntime.ProcessContext.SimulationContext.GetConnectionName(AppLogSettings.GetConfig().ConnectionName));
 }