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


C# Table.GetColumnsFullHierarchy方法代码示例

本文整理汇总了C#中Table.GetColumnsFullHierarchy方法的典型用法代码示例。如果您正苦于以下问题:C# Table.GetColumnsFullHierarchy方法的具体用法?C# Table.GetColumnsFullHierarchy怎么用?C# Table.GetColumnsFullHierarchy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Table的用法示例。


在下文中一共展示了Table.GetColumnsFullHierarchy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetBody

			public static string GetBody(Table table, ModelRoot model)
			{
				try
				{
					List<Column> allColumns = new List<Column>();
					foreach (Column dc in table.GetColumnsFullHierarchy())
					{
						if (!(dc.DataType == System.Data.SqlDbType.Binary ||
							dc.DataType == System.Data.SqlDbType.Image ||
							dc.DataType == System.Data.SqlDbType.NText ||
							dc.DataType == System.Data.SqlDbType.Text ||
							dc.DataType == System.Data.SqlDbType.Timestamp ||
							dc.DataType == System.Data.SqlDbType.Udt ||
							dc.DataType == System.Data.SqlDbType.VarBinary ||
							dc.DataType == System.Data.SqlDbType.Variant ||
						dc.DataType == System.Data.SqlDbType.Money))
						{
							allColumns.Add(dc);
						}
					}

					if (allColumns.Count != 0)
					{
						return BuildStoredProcedure(table, model, allColumns);
					}

					return "";

				}
				catch (Exception ex)
				{
					throw new Exception(table.DatabaseName + ": Failed on generation of paging select statement", ex);
				}
			}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:34,代码来源:SQLGeneratedBodyHelper.cs

示例2: BuildParameterList

		private static string BuildParameterList(Table table, ModelRoot model)
		{
			ArrayList items = new ArrayList();
			List<Column> columnList = new List<Column>();
			foreach (Column c in table.GetColumnsFullHierarchy())
				columnList.Add(c);

			for (int ii = 0; ii < columnList.Count; ii++)
			{
				Column dc = columnList[ii];
				//if (dc.Identity != IdentityTypeConstants.Database)
				items.Add(columnList[ii]);
			}

			StringBuilder output = new StringBuilder();
			for (int ii = 0; ii < items.Count; ii++)
			{
				Column dc = (Column)(items[ii]);
				output.Append("	@" + ValidationHelper.MakeDatabaseScriptIdentifier(dc.DatabaseName) + " " + dc.GetSQLDefaultType() + " = default");
				if (ii < items.Count - 1 || (table.AllowCreateAudit) || (table.AllowModifiedAudit))
					output.Append(",");
				output.AppendLine();

			}
			if (table.AllowCreateAudit)
			{
				//Create Date
				output.AppendFormat("	@{0} datetime", model.Database.CreatedDateColumnName);
				output.Append(",");
				output.AppendLine();

				//Create By
				output.AppendFormat("	@{0} varchar (50)", model.Database.CreatedByColumnName);
				if (table.AllowModifiedAudit)
					output.Append(",");
				output.AppendLine();
			}

			if (table.AllowModifiedAudit)
			{
				//Modified By
				output.AppendFormat("	@{0} varchar (50)", model.Database.ModifiedByColumnName);
				output.AppendLine();
			}

			return output.ToString();
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:47,代码来源:SQLInsertBusinessObjectTemplate.cs

示例3: BuildSelectList

		public static string BuildSelectList(Table table, ModelRoot model, bool useFullHierarchy)
		{
			int index = 0;
			StringBuilder output = new StringBuilder();
			List<Column> columnList = new List<Column>();
			if (useFullHierarchy)
			{
				foreach (Column c in table.GetColumnsFullHierarchy())
					columnList.Add(c);
			}
			else
			{
				foreach (Reference r in table.GeneratedColumns)
					columnList.Add((Column)r.Object);
			}

			foreach (Column dc in columnList)
			{
				Table parentTable = (Table)dc.ParentTableRef.Object;
				output.AppendFormat("	[{0}].[{1}]", GetTableDatabaseName(model, parentTable), dc.DatabaseName.ToLower());
				if ((index < columnList.Count - 1) || (table.AllowCreateAudit) || (table.AllowModifiedAudit) || (table.AllowTimestamp))
					output.Append(",");
				output.AppendLine();
				index++;
			}

			if (table.AllowCreateAudit)
			{
				output.AppendFormat("	[{0}].[{1}],", GetTableDatabaseName(model, table), model.Database.CreatedByColumnName);
				output.AppendLine();

				output.AppendFormat("	[{0}].[{1}]", GetTableDatabaseName(model, table), model.Database.CreatedDateColumnName);
				if ((table.AllowModifiedAudit) || (table.AllowTimestamp))
					output.Append(",");
				output.AppendLine();
			}

			if (table.AllowModifiedAudit)
			{
				output.AppendFormat("	[{0}].[{1}],", GetTableDatabaseName(model, table), model.Database.ModifiedByColumnName);
				output.AppendLine();

				output.AppendFormat("	[{0}].[{1}]", GetTableDatabaseName(model, table), model.Database.ModifiedDateColumnName);
				if (table.AllowTimestamp)
					output.Append(",");
				output.AppendLine();
			}

			if (table.AllowTimestamp)
			{
				output.AppendFormat("	[{0}].[{1}]", GetTableDatabaseName(model, table), model.Database.TimestampColumnName);
				output.AppendLine();
			}

			return output.ToString();
		}
开发者ID:nHydrate,项目名称:nHydrate,代码行数:56,代码来源:Globals.cs


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