You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(74) |
Apr
(35) |
May
(43) |
Jun
(25) |
Jul
(28) |
Aug
(51) |
Sep
(54) |
Oct
(31) |
Nov
(6) |
Dec
(23) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(7) |
Feb
(40) |
Mar
(24) |
Apr
(14) |
May
(18) |
Jun
(16) |
Jul
(24) |
Aug
(16) |
Sep
(37) |
Oct
(2) |
Nov
(14) |
Dec
(15) |
| 2008 |
Jan
(7) |
Feb
(6) |
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ms...@us...> - 2008-03-31 11:57:17
|
Revision: 711
http://nettiers.svn.sourceforge.net/nettiers/?rev=711&view=rev
Author: mshatny
Date: 2008-03-31 04:57:19 -0700 (Mon, 31 Mar 2008)
Log Message:
-----------
[FIX] Fixes EntityProviderBaseCoreClass.generated.cst template compile error.
Modified Paths:
--------------
source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst 2008-03-29 19:36:33 UTC (rev 710)
+++ source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst 2008-03-31 11:57:19 UTC (rev 711)
@@ -1,4 +1,4 @@
-?<%@ CodeTemplate Language="C#" TargetLanguage="C#" Src="..\..\TemplateLib\CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Debug="False" Description="Generates the EntityProviderBaseCore type." ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
+<%@ CodeTemplate Language="C#" TargetLanguage="C#" Src="..\..\TemplateLib\CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Debug="False" Description="Generates the EntityProviderBaseCore type." ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
<%@ Property Name="BLLNameSpace" Optional="False" Type="System.String" Category="Style" Description="Object Namespace." %>
<%@ Property Name="DALNameSpace" Optional="False" Type="System.String" Category="Style" Description="DAL Namespace." %>
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-03-29 19:36:33 UTC (rev 710)
+++ source/trunk/Source/changes.log 2008-03-31 11:57:19 UTC (rev 711)
@@ -1,5 +1,7 @@
-.netTiers v2.2.0.710
+.netTiers v2.2.0.711
+03/31/2008
+ - [FIX] Fixes EntityProviderBaseCoreClass.generated.cst template compile error.
03/29/2008
- [ENH] Extending Query Builder classes to use strongly typed orderby parameter. More info: the http://community.codesmithtools.com/forums/t/7539.aspx (contrib. Rippo, CitizenBane)
- [FIX] Repeater dataSource null fix (contrib. CitizenBane)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-03-29 19:36:37
|
Revision: 710
http://nettiers.svn.sourceforge.net/nettiers/?rev=710&view=rev
Author: mshatny
Date: 2008-03-29 12:36:33 -0700 (Sat, 29 Mar 2008)
Log Message:
-----------
[ENH] Extending Query Builder classes to use strongly typed orderby parameter. More info: the http://community.codesmithtools.com/forums/t/7539.aspx (contrib. Rippo, CitizenBane)
[FIX] Repeater dataSource null fix (contrib. CitizenBane)
Modified Paths:
--------------
source/trunk/Source/Components/ComponentDataAccess.cst
source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCore.generated.cst
source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst
source/trunk/Source/DataAccessLayer/Bases/Views/EntityViewProviderBaseCore.generated.cst
source/trunk/Source/DataAccessLayer/Bases/Views/EntityViewProviderBaseCoreClass.generated.cst
source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst
source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst
source/trunk/Source/WebLibrary/UI/TableRepeater.cst
source/trunk/Source/WebLibrary/UI/ViewRepeater.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/Components/ComponentDataAccess.cst
===================================================================
--- source/trunk/Source/Components/ComponentDataAccess.cst 2008-03-19 13:13:53 UTC (rev 709)
+++ source/trunk/Source/Components/ComponentDataAccess.cst 2008-03-29 19:36:33 UTC (rev 710)
@@ -544,16 +544,27 @@
#region Parameterized <%= MethodNames.Find %> Methods
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
/// <returns>Returns a typed collection of <c><%= className %></c> objects.</returns>
<%= constructorAccessModifier %> <%=collectionClassName%> <%= MethodNames.Find %>(IFilterParameterCollection parameters)
{
- return <%= MethodNames.Find %>(parameters, null);
+ return <%= MethodNames.Find %>(parameters, (string) null);
}
/// <summary>
+ /// Returns rows from the DataSource that meet the parameter conditions.
+ /// </summary>
+ /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
+ /// <param name="sortColumns">A collection of <see cref="SqlSortColumn"/> objects.</param>
+ /// <returns>Returns a typed collection of <c><%= className %></c> objects.</returns>
+ <%= constructorAccessModifier %> <%=collectionClassName%> <%= MethodNames.Find %>(IFilterParameterCollection parameters, ISortColumnCollection sortColumns)
+ {
+ return <%= MethodNames.Find %>(parameters, sortColumns.ToString());
+ }
+
+ /// <summary>
/// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
@@ -566,6 +577,20 @@
}
/// <summary>
+ /// Returns rows from the DataSource that meet the parameter conditions.
+ /// </summary>
+ /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
+ /// <param name="sortColumns">A collection of <see cref="SqlSortColumn"/> objects.</param>
+ /// <param name="start">Row number at which to start reading.</param>
+ /// <param name="pageLength">Number of rows to return.</param>
+ /// <param name="count">out. The number of rows that match this query.</param>
+ /// <returns>Returns a typed collection of <c><%= className %></c> objects.</returns>
+ <%= constructorAccessModifier %> <%=collectionClassName%> <%= MethodNames.Find %>(IFilterParameterCollection parameters, ISortColumnCollection sortColumns, int start, int pageLength, out int count)
+ {
+ return <%= MethodNames.Find %>(parameters, sortColumns.ToString(), start, pageLength, out count);
+ }
+
+ /// <summary>
/// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
Modified: source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCore.generated.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCore.generated.cst 2008-03-19 13:13:53 UTC (rev 709)
+++ source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCore.generated.cst 2008-03-29 19:36:33 UTC (rev 710)
@@ -1335,6 +1335,28 @@
}
#endregion <%= entityClassName %>ParameterBuilder
+
+ #region <%= entityClassName %>SortBuilder
+
+ /// <summary>
+ /// A strongly-typed instance of the <see cref="SqlSortBuilder<<%= GetClassName(SourceTable, ClassNameFormat.Column) %>>"/> class
+ /// that is used exclusively with a <see cref="<%= entityClassName %>"/> object.
+ /// </summary>
+ [CLSCompliant(true)]
+ public class <%= entityClassName %>SortBuilder : SqlSortBuilder<<%= GetClassName(SourceTable, ClassNameFormat.Column) %>>
+ {
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <%= entityClassName %>SqlSortBuilder class.
+ /// </summary>
+ public <%= entityClassName %>SortBuilder() : base() { }
+
+ #endregion Constructors
+
+ }
+ #endregion <%= entityClassName %>SortBuilder
+
} // end namespace
<script runat="template">
private void CreateManyToManySourceAssignments(TableKeySchema tableKey,System.Collections.Generic.List<string> m2mfilled)
Modified: source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst 2008-03-19 13:13:53 UTC (rev 709)
+++ source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst 2008-03-29 19:36:33 UTC (rev 710)
@@ -1,4 +1,4 @@
-<%@ CodeTemplate Language="C#" TargetLanguage="C#" Src="..\..\TemplateLib\CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Debug="False" Description="Generates the EntityProviderBaseCore type." ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
+?<%@ CodeTemplate Language="C#" TargetLanguage="C#" Src="..\..\TemplateLib\CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Debug="False" Description="Generates the EntityProviderBaseCore type." ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
<%@ Property Name="BLLNameSpace" Optional="False" Type="System.String" Category="Style" Description="Object Namespace." %>
<%@ Property Name="DALNameSpace" Optional="False" Type="System.String" Category="Style" Description="DAL Namespace." %>
@@ -357,7 +357,7 @@
#region Parameterized <%= MethodNames.Find %> Methods
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> or <see cref="ParameterizedSqlFilterBuilder<T>"/> objects.</param>
/// <returns>Returns a typed collection of Entity objects.</returns>
@@ -366,19 +366,43 @@
return <%= MethodNames.Find %>((TransactionManager) null, parameters);
}
+
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter and sortColumn conditions.
+ /// </summary>
+ /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> or <see cref="ParameterizedSqlFilterBuilder<T>"/> objects.</param>
+ /// <param name="sortColumns">A collection of <see cref="SqlSortColumn"/> or <see cref="SqlSortBuilder<T>"/> objects</param>
+ /// <returns></returns>
+ public virtual <%=listName%><Entity> <%= MethodNames.Find %>(IFilterParameterCollection parameters, ISortColumnCollection sortColumns)
+ {
+ return <%= MethodNames.Find %>((TransactionManager) null, parameters, sortColumns);
+ }
+
+ /// <summary>
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> or <see cref="ParameterizedSqlFilterBuilder<T>"/> objects.</param>
/// <returns>Returns a typed collection of Entity objects.</returns>
public virtual <%=listName%><Entity> <%= MethodNames.Find %>(TransactionManager transactionManager, IFilterParameterCollection parameters)
{
- return <%= MethodNames.Find %>(transactionManager, parameters, null);
+ return <%= MethodNames.Find %>(transactionManager, parameters, (string) null);
}
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter and sortColumn conditions.
+ /// </summary>
+ /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
+ /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> or <see cref="ParameterizedSqlFilterBuilder<T>"/> objects.</param>
+ /// <param name="sortColumns">A collection of <see cref="SqlSortColumn"/> or <see cref="SqlSortBuilder<T>"/> objects</param>
+ /// <returns></returns>
+ public virtual <%=listName%><Entity> <%= MethodNames.Find %>(TransactionManager transactionManager, IFilterParameterCollection parameters, ISortColumnCollection sortColumns)
+ {
+ return <%= MethodNames.Find %>(transactionManager, parameters, sortColumns.ToString());
+ }
+
+ /// <summary>
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> or <see cref="ParameterizedSqlFilterBuilder<T>"/> objects.</param>
/// <param name="orderBy">Specifies the sort criteria for the rows in the DataSource (Name ASC; BirthDay DESC, Name ASC);</param>
@@ -389,7 +413,7 @@
}
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> or <see cref="ParameterizedSqlFilterBuilder<T>"/> objects.</param>
@@ -402,7 +426,7 @@
}
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> or <see cref="ParameterizedSqlFilterBuilder<T>"/> objects.</param>
/// <param name="orderBy">Specifies the sort criteria for the rows in the DataSource (Name ASC; BirthDay DESC, Name ASC);</param>
@@ -416,7 +440,21 @@
}
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter and sortColumn conditions.
+ /// </summary>
+ /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> or <see cref="ParameterizedSqlFilterBuilder<T>"/> objects.</param>
+ /// <param name="sortColumns">A collection of <see cref="SqlSortColumn"/> or <see cref="SqlSortBuilder<T>"/> objects</param>
+ /// <param name="start">Row number at which to start reading.</param>
+ /// <param name="pageLength">Number of rows to return.</param>
+ /// <param name="count">out. The number of rows that match this query.</param>
+ /// <returns>Returns a typed collection of Entity objects.</returns>
+ public virtual <%=listName%><Entity> <%= MethodNames.Find %>(IFilterParameterCollection parameters, ISortColumnCollection sortColumns, int start, int pageLength, out int count)
+ {
+ return <%= MethodNames.Find %>((TransactionManager) null, parameters, sortColumns.ToString(), start, pageLength, out count);
+ }
+
+ /// <summary>
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> or <see cref="ParameterizedSqlFilterBuilder<T>"/> objects.</param>
Modified: source/trunk/Source/DataAccessLayer/Bases/Views/EntityViewProviderBaseCore.generated.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Bases/Views/EntityViewProviderBaseCore.generated.cst 2008-03-19 13:13:53 UTC (rev 709)
+++ source/trunk/Source/DataAccessLayer/Bases/Views/EntityViewProviderBaseCore.generated.cst 2008-03-29 19:36:33 UTC (rev 710)
@@ -322,4 +322,26 @@
}
#endregion <%= className %>ParameterBuilder
+
+ #region <%= className %>SortBuilder
+
+ /// <summary>
+ /// A strongly-typed instance of the <see cref="SqlSortBuilder<EntityColumn>"/> class
+ /// that is used exclusively with a <see cref="<%= className %>"/> object.
+ /// </summary>
+ [CLSCompliant(true)]
+ public class <%= className %>SortBuilder : SqlSortBuilder<<%= className %>Column>
+ {
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <%= className %>SqlSortBuilder class.
+ /// </summary>
+ public <%= className %>SortBuilder() : base() { }
+
+ #endregion Constructors
+
+ }
+ #endregion <%= className %>SortBuilder
+
} // end namespace
Modified: source/trunk/Source/DataAccessLayer/Bases/Views/EntityViewProviderBaseCoreClass.generated.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Bases/Views/EntityViewProviderBaseCoreClass.generated.cst 2008-03-19 13:13:53 UTC (rev 709)
+++ source/trunk/Source/DataAccessLayer/Bases/Views/EntityViewProviderBaseCoreClass.generated.cst 2008-03-29 19:36:33 UTC (rev 710)
@@ -372,7 +372,7 @@
#region Parameterized <%= MethodNames.Find %> Methods
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
/// <returns>Returns a typed collection of Entity objects.</returns>
@@ -382,18 +382,42 @@
}
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter conditions.
+ /// </summary>
+ /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
+ /// <param name="sortColumns">A collection of <see cref="SqlSortColumn"/> objects.</param>
+ /// <returns>Returns a typed collection of Entity objects.</returns>
+ public virtual <%=vListName%><Entity> <%= MethodNames.Find %>(IFilterParameterCollection parameters, ISortColumnCollection sortColumns)
+ {
+ return <%= MethodNames.Find %>((TransactionManager)null, parameters, sortColumns);
+ }
+
+
+ /// <summary>
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
/// <returns>Returns a typed collection of Entity objects.</returns>
public virtual <%=vListName%><Entity> <%= MethodNames.Find %>(TransactionManager transactionManager, IFilterParameterCollection parameters)
{
- return <%= MethodNames.Find %>(transactionManager, parameters, null);
+ return <%= MethodNames.Find %>(transactionManager, parameters, (string) null);
}
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter conditions.
+ /// </summary>
+ /// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
+ /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
+ /// <param name="sortColumns">A collection of <see cref="SqlSortColumn"/> objects.</param>
+ /// <returns>Returns a typed collection of Entity objects.</returns>
+ public virtual <%=vListName%><Entity> <%= MethodNames.Find %>(TransactionManager transactionManager, IFilterParameterCollection parameters, ISortColumnCollection sortColumns)
+ {
+ return <%= MethodNames.Find %>(transactionManager, parameters, sortColumns.ToString());
+ }
+
+ /// <summary>
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
/// <param name="orderBy">Specifies the sort criteria for the rows in the DataSource (Name ASC; BirthDay DESC, Name ASC);</param>
@@ -404,7 +428,7 @@
}
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
@@ -417,7 +441,7 @@
}
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
/// <param name="orderBy">Specifies the sort criteria for the rows in the DataSource (Name ASC; BirthDay DESC, Name ASC);</param>
@@ -431,7 +455,21 @@
}
/// <summary>
- /// Returns rows from the DataSource that meet the parameter conditions.
+ /// Returns rows from the DataSource that meet the parameter and sort conditions.
+ /// </summary>
+ /// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
+ /// <param name="sortColumns">A collection of <see cref="SqlSortColumn"/> objects.</param>
+ /// <param name="start">Row number at which to start reading.</param>
+ /// <param name="pageLength">Number of rows to return.</param>
+ /// <param name="count">out. The number of rows that match this query.</param>
+ /// <returns>Returns a typed collection of Entity objects.</returns>
+ public virtual <%=vListName%><Entity> <%= MethodNames.Find %>(IFilterParameterCollection parameters, ISortColumnCollection sortColumns, int start, int pageLength, out int count)
+ {
+ return <%= MethodNames.Find %>((TransactionManager)null, parameters, sortColumns.ToString(), start, pageLength, out count);
+ }
+
+ /// <summary>
+ /// Returns rows from the DataSource that meet the parameter conditions.
/// </summary>
/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
/// <param name="parameters">A collection of <see cref="SqlFilterParameter"/> objects.</param>
Modified: source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst 2008-03-19 13:13:53 UTC (rev 709)
+++ source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst 2008-03-29 19:36:33 UTC (rev 710)
@@ -2852,4 +2852,299 @@
/// <returns><see cref="SqlFilterParameterCollection"/> object</returns>
SqlFilterParameterCollection GetParameters();
}
+
+ #region SqlSortBuilder
+
+ /// <summary>
+ /// Allows for building SQL OrderBy expressions using strongly-typed column enumeration values.
+ /// </summary>
+ /// <typeparam name="EntityColumn">An enumeration of entity column names.</typeparam>
+ [CLSCompliant(true)]
+ public class SqlSortBuilder<EntityColumn> : ISortColumnCollection
+ {
+ /// <summary>
+ /// holds key value pair of ScheduledFlight column and sort direction
+ /// </summary>
+ //private Dictionary<EntityColumn, SqlSortDirection> _columns = new Dictionary<EntityColumn, SqlSortDirection>();
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the SqlFilterBuilder class.
+ /// </summary>
+ public SqlSortBuilder() : base() { }
+
+ #endregion
+
+ #region Append
+
+ /// <summary>
+ /// Appends the specified column and sorts it by the specified SqlSortDirection
+ /// </summary>
+ /// <param name="column">The column to sort</param>
+ /// <param name="sortDirection">The specified column's sort direction</param>
+ /// <returns></returns>
+ public virtual void Append(Enum column, SqlSortDirection sortDirection)
+ {
+ AddColumn(column, sortDirection);
+ }
+
+ /// <summary>
+ /// Appends the specified column and sorts it Ascending
+ /// </summary>
+ /// <param name="column">The column to sort</param>
+ /// <returns></returns>
+ public virtual void AppendASC(Enum column)
+ {
+ AddColumn(column, SqlSortDirection.ASC);
+ }
+
+ /// <summary>
+ /// Appends the specified column and sorts it Descending
+ /// </summary>
+ /// <param name="column">The column to sort</param>
+ /// <returns></returns>
+ public virtual void AppendDESC(Enum column)
+ {
+ AddColumn(column, SqlSortDirection.DESC);
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// The Sort Columns member variable.
+ /// </summary>
+ private SqlSortColumnCollection sortColumns = new SqlSortColumnCollection();
+
+ private bool _isDirty = true;
+
+ /// <summary>
+ /// Gets or sets the SortColumns property.
+ /// </summary>
+ public virtual SqlSortColumnCollection SortColumns
+ {
+ get
+ {
+ if (_isDirty)
+ GetSortColumns();
+
+ return sortColumns;
+ }
+ set { sortColumns = value; }
+ }
+
+ #endregion
+
+ #region Methods
+
+
+ /// <summary>
+ /// Adds a column to the sort builder
+ /// </summary>
+ /// <param name="column">The entity's column to sort by</param>
+ /// <param name="sortDirection">The sort direction</param>
+ private void AddColumn(Enum column, SqlSortDirection sortDirection)
+ {
+ sortColumns.Add(new SqlSortColumn(column, sortDirection));
+ }
+
+ /// <summary>
+ /// Provides the actual SQL sort string.
+ /// </summary>
+ /// <returns></returns>
+ public override string ToString()
+ {
+ StringBuilder sb = new StringBuilder();
+ Int32 count = 1;
+ foreach (SqlSortColumn sc in sortColumns)
+ {
+ //sb.Append(kvp.Key).Append(" ").Append(kvp.Value);
+ sb.Append(String.Format("{0} {1}", sc.Column, sc.SortDirection));
+ if (count++ < sortColumns.Count)
+ {
+ sb.Append(", ");
+ }
+ }
+ return sb.ToString();
+ }
+
+ /// <summary>
+ /// Gets the column name from the specified column enumeration value.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <returns></returns>
+ protected virtual String GetColumnName(EntityColumn column)
+ {
+ String name = EntityHelper.GetEnumTextValue(column as Enum);
+
+ if (String.IsNullOrEmpty(name))
+ {
+ name = column.ToString();
+ }
+
+ return name;
+ }
+
+ /// <summary>
+ /// Gets the current collection of <see cref="SqlFilterParameter"/> objects and
+ /// also sets the collection's FilterExpression property.
+ /// </summary>
+ /// <returns></returns>
+ public virtual SqlSortColumnCollection GetSortColumns()
+ {
+ _isDirty = false;
+ SortColumns.SortExpression = ToString();
+
+ return SortColumns;
+ }
+ #endregion Methods
+
+ #region IFilterParameterCollection
+ /// <summary>
+ /// Gets a collection of <see cref="SqlFilterParameter"/> objects
+ /// </summary>
+ /// <returns></returns>
+ SqlSortColumnCollection ISortColumnCollection.GetSortColumns()
+ {
+ return GetSortColumns();
+ }
+ #endregion
+ }
+
+ /// <summary>
+ /// A collection of <see cref="SqlSortColumn"/> objects.
+ /// </summary>
+ [Serializable]
+ [CLSCompliant(true)]
+ public class SqlSortColumnCollection : List<SqlSortColumn>, ISortColumnCollection
+ {
+ #region Methods
+
+ /// <summary>
+ /// Sets the CurrentColumn property.
+ /// </summary>
+ /// <param name="column"></param>
+ public void SetCurrentColumn(Object column)
+ {
+ this._currentColumn = (Enum) column;
+ }
+
+ #endregion Methods
+
+ #region Properties
+
+ /// <summary>
+ /// The CurrentColumn member variable.
+ /// </summary>
+ private Enum _currentColumn;
+
+ /// <summary>
+ /// Gets the CurrentColumn property.
+ /// </summary>
+ public Enum CurrentColumn
+ {
+ get { return _currentColumn; }
+ }
+
+ /// <summary>
+ /// The SortExpression member variable.
+ /// </summary>
+ private String sortExpression;
+
+ /// <summary>
+ /// Gets or sets the SortExpression property.
+ /// </summary>
+ public String SortExpression
+ {
+ get { return sortExpression; }
+ set { sortExpression = value; }
+ }
+
+ #endregion Properties
+
+ #region IFilterParameterCollection
+ /// <summary>
+ /// Gets a list of sql parameters for the filter
+ /// </summary>
+ /// <returns></returns>
+ SqlSortColumnCollection ISortColumnCollection.GetSortColumns()
+ {
+ return this;
+ }
+ #endregion
+ }
+
+ /// <summary>
+ /// Represents the information of a sorted column.
+ /// </summary>
+ [Serializable]
+ [CLSCompliant(true)]
+ public class SqlSortColumn
+ {
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the SqlSortColumn class.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="sortDirection"></param>
+ public SqlSortColumn(Enum column, SqlSortDirection sortDirection)
+ {
+ this._column = column;
+ this._sortDirection = sortDirection;
+ }
+
+ #endregion Constructors
+
+ #region Properties
+
+ /// <summary>
+ /// The Column member variable.
+ /// </summary>
+ private Enum _column;
+
+ /// <summary>
+ /// Gets or sets the Column property.
+ /// </summary>
+ public Enum Column
+ {
+ get { return _column; }
+ set { _column = value; }
+ }
+
+ /// <summary>
+ /// The Value member variable.
+ /// </summary>
+ private SqlSortDirection _sortDirection;
+
+ /// <summary>
+ /// Gets or sets the Value property.
+ /// </summary>
+ public SqlSortDirection SortDirection
+ {
+ get { return _sortDirection; }
+ set { _sortDirection = value; }
+ }
+
+ #endregion Properties
+
+ }
+
+ ///<summary>
+ /// Represents a type which will contain a method to
+ /// retrieve the A collection of <see cref="SqlSortColumnCollection"/>
+ /// objects to generate an OrderBy clause.
+ ///</summary>
+ public interface ISortColumnCollection
+ {
+ /// <summary>
+ /// Gets a collection of <see cref="SqlSortColumn"/> objects
+ /// </summary>
+ /// <returns><see cref="SqlSortColumnCollection"/> object</returns>
+ SqlSortColumnCollection GetSortColumns();
+ }
+
+ #endregion
}
Modified: source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst 2008-03-19 13:13:53 UTC (rev 709)
+++ source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst 2008-03-29 19:36:33 UTC (rev 710)
@@ -647,4 +647,24 @@
}
#endregion SqlComparisonType Enum
+
+ #region SqlSortDirection Enum
+
+ /// <summary>
+ /// Enumeration of SQL expression Sort Directions
+ /// </summary>
+ public enum SqlSortDirection
+ {
+ /// <summary>
+ /// Database Ascending
+ /// </summary>
+ ASC,
+
+ /// <summary>
+ /// Database Descending
+ /// </summary>
+ DESC
+ }
+
+ #endregion
}
Modified: source/trunk/Source/WebLibrary/UI/TableRepeater.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/TableRepeater.cst 2008-03-19 13:13:53 UTC (rev 709)
+++ source/trunk/Source/WebLibrary/UI/TableRepeater.cst 2008-03-29 19:36:33 UTC (rev 710)
@@ -230,36 +230,39 @@
Control headerItem = new Control();
m_headerTemplate.InstantiateIn(headerItem);
Controls.Add(headerItem);
- }
- foreach (object o in dataSource)
- {
- <%=entityName%> entity = o as <%=entityName%>;
- <%=entityItem%> container = new <%=entityItem%>(entity);
-
- if (m_itemTemplate != null && (pos % 2) == 0)
- {
- m_itemTemplate.InstantiateIn(container);
- }
- else
- {
- if (m_altenateItemTemplate != null)
+ }
+ if (dataSource != null)
+ {
+ foreach (object o in dataSource)
+ {
+ <%=entityName%> entity = o as <%=entityName%>;
+ <%=entityItem%> container = new <%=entityItem%>(entity);
+
+ if (m_itemTemplate != null && (pos % 2) == 0)
{
- m_altenateItemTemplate.InstantiateIn(container);
- }
- else if (m_itemTemplate != null)
- {
m_itemTemplate.InstantiateIn(container);
}
else
{
- // no template !!!
+ if (m_altenateItemTemplate != null)
+ {
+ m_altenateItemTemplate.InstantiateIn(container);
+ }
+ else if (m_itemTemplate != null)
+ {
+ m_itemTemplate.InstantiateIn(container);
+ }
+ else
+ {
+ // no template !!!
+ }
}
- }
- Controls.Add(container);
-
- container.DataBind();
-
- pos++;
+ Controls.Add(container);
+
+ container.DataBind();
+
+ pos++;
+ }
}
//Instantiate the Footer template (if exists)
if (m_footerTemplate != null)
Modified: source/trunk/Source/WebLibrary/UI/ViewRepeater.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/ViewRepeater.cst 2008-03-19 13:13:53 UTC (rev 709)
+++ source/trunk/Source/WebLibrary/UI/ViewRepeater.cst 2008-03-29 19:36:33 UTC (rev 710)
@@ -229,38 +229,39 @@
m_headerTemplate.InstantiateIn(headerItem);
Controls.Add(headerItem);
}
-
- foreach (object o in dataSource)
- {
- <%=entityName%> entity = o as <%=entityName%>;
- <%=entityItem%> container = new <%=entityItem%>(entity);
-
- if (m_itemTemplate != null && (pos % 2) == 0)
- {
- m_itemTemplate.InstantiateIn(container);
- }
- else
- {
- if (m_altenateItemTemplate != null)
+ if (dataSource != null)
+ {
+ foreach (object o in dataSource)
+ {
+ <%=entityName%> entity = o as <%=entityName%>;
+ <%=entityItem%> container = new <%=entityItem%>(entity);
+
+ if (m_itemTemplate != null && (pos % 2) == 0)
{
- m_altenateItemTemplate.InstantiateIn(container);
- }
- else if (m_itemTemplate != null)
- {
m_itemTemplate.InstantiateIn(container);
}
else
{
- // no template !!!
+ if (m_altenateItemTemplate != null)
+ {
+ m_altenateItemTemplate.InstantiateIn(container);
+ }
+ else if (m_itemTemplate != null)
+ {
+ m_itemTemplate.InstantiateIn(container);
+ }
+ else
+ {
+ // no template !!!
+ }
}
- }
- Controls.Add(container);
-
- container.DataBind();
-
- pos++;
- }
-
+ Controls.Add(container);
+
+ container.DataBind();
+
+ pos++;
+ }
+ }
//Instantiate the Footer template (if exists)
if (m_footerTemplate != null)
{
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-03-19 13:13:53 UTC (rev 709)
+++ source/trunk/Source/changes.log 2008-03-29 19:36:33 UTC (rev 710)
@@ -1,5 +1,8 @@
-.netTiers v2.2.0.709
+.netTiers v2.2.0.710
+03/29/2008
+ - [ENH] Extending Query Builder classes to use strongly typed orderby parameter. More info: the http://community.codesmithtools.com/forums/t/7539.aspx (contrib. Rippo, CitizenBane)
+ - [FIX] Repeater dataSource null fix (contrib. CitizenBane)
03/19/2008
- [FIX] Fixed design-time entitygridview rendering in VS2008 (contrib. voracious, C#Bob)
03/16/2008
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-03-19 13:13:50
|
Revision: 709
http://nettiers.svn.sourceforge.net/nettiers/?rev=709&view=rev
Author: mshatny
Date: 2008-03-19 06:13:53 -0700 (Wed, 19 Mar 2008)
Log Message:
-----------
[FIX] Fixed design-time entitygridview rendering in VS2008 (contrib. voracious, C#Bob)
Modified Paths:
--------------
source/trunk/Source/DataAccessLayer/DataRepository.cst
source/trunk/Source/NetTiers.cst
source/trunk/Source/WebLibrary/UI/EntityGridView.cs.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/DataAccessLayer/DataRepository.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/DataRepository.cst 2008-03-16 23:34:04 UTC (rev 708)
+++ source/trunk/Source/DataAccessLayer/DataRepository.cst 2008-03-19 13:13:53 UTC (rev 709)
@@ -8,6 +8,7 @@
<%@ Property Name="SourceTables" Type="SchemaExplorer.TableSchemaCollection" Category="Connection" Description="Tables of the system." %>
<%@ Property Name="SourceViews" Type="SchemaExplorer.ViewSchemaCollection" Category="Connection" Description="Tables of the system." %>
<%@ Property Name="IncludeDesignTimeSupport" Type="System.Boolean" Default="true" Category="05. WebLibrary - Advanced" Description="Indicates if Visual Studio design-time support should be provided for the Web Library controls." %>
+<%@ Property Name="VisualStudioVersion" Type="MoM.Templates.VSNetVersion" Default="v2005" Category="02. Framework Generation - Optional" Description="Indicates the Version of Visual Studio to target. Options include v2005 and v2008" %>
#region Using directives
using System;
@@ -238,7 +239,8 @@
String path = null;
// Get an instance of the currently running Visual Studio IDE.
- EnvDTE80.DTE2 dte = (EnvDTE80.DTE2) System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.8.0");
+ EnvDTE80.DTE2 dte = <%=String.Format("(EnvDTE80.DTE2) System.Runtime.InteropServices.Marshal.GetActiveObject(\"VisualStudio.DTE.{0}\");", GetMSBuildExtensionsVersionString(VisualStudioVersion))%>
+
if ( dte != null )
{
dte.SuppressUI = true;
Modified: source/trunk/Source/NetTiers.cst
===================================================================
--- source/trunk/Source/NetTiers.cst 2008-03-16 23:34:04 UTC (rev 708)
+++ source/trunk/Source/NetTiers.cst 2008-03-19 13:13:53 UTC (rev 709)
@@ -1,4 +1,4 @@
-<%@ CodeTemplate Src="TemplateLib/CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Language="C#" TargetLanguage="Text" Description="NetTiers main template." Debug="True" ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
+<%@ CodeTemplate Src="TemplateLib/CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Language="C#" TargetLanguage="Text" Description="NetTiers main template." Debug="True" ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
<%@ Assembly Name="SchemaExplorer" %>
<%@ Assembly Name="System.Design" %>
<%@ Assembly Name="System.DirectoryServices" %>
@@ -1777,6 +1777,7 @@
this.GetTemplate("DataRepository.cst").SetProperty("SourceTables", templateSourceTables);
this.GetTemplate("DataRepository.cst").SetProperty("SourceViews", templateSourceViews);
this.GetTemplate("DataRepository.cst").SetProperty("IncludeDesignTimeSupport", IncludeDesignTimeSupport);
+ this.GetTemplate("DataRepository.cst").SetProperty("VisualStudioVersion", VisualStudioVersion);
this.RenderToFile("DataRepository.cst", rootPathDAL + "\\DataRepository.cs", true);
AddFileNode(commonNode, "IEntityProvider.cs");
Modified: source/trunk/Source/WebLibrary/UI/EntityGridView.cs.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/EntityGridView.cs.cst 2008-03-16 23:34:04 UTC (rev 708)
+++ source/trunk/Source/WebLibrary/UI/EntityGridView.cs.cst 2008-03-19 13:13:53 UTC (rev 709)
@@ -361,7 +361,7 @@
if (!String.IsNullOrEmpty(this.DataSourceID))
{
- if (Page.IsPostBack == false)
+ if (Page.IsPostBack == false && base.DesignMode == false)
{
this.Sort(DefaultSortColumnName, _defaultSortDirection);
}
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-03-16 23:34:04 UTC (rev 708)
+++ source/trunk/Source/changes.log 2008-03-19 13:13:53 UTC (rev 709)
@@ -1,4 +1,7 @@
-.netTiers v2.2.0.708
+.netTiers v2.2.0.709
+
+03/19/2008
+ - [FIX] Fixed design-time entitygridview rendering in VS2008 (contrib. voracious, C#Bob)
03/16/2008
- [ENH] Enhancement to the generated client-side javascript in EntityDropDownList.cs to pass the W3C validation (contrib. CitizenBane)
03/09/2008
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-03-16 23:33:59
|
Revision: 708
http://nettiers.svn.sourceforge.net/nettiers/?rev=708&view=rev
Author: mshatny
Date: 2008-03-16 16:34:04 -0700 (Sun, 16 Mar 2008)
Log Message:
-----------
[ENH] Enhancement to the generated client-side javascript in EntityDropDownList.cs to pass the W3C validation (contrib. CitizenBane)
Modified Paths:
--------------
source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst 2008-03-09 20:30:29 UTC (rev 707)
+++ source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst 2008-03-16 23:34:04 UTC (rev 708)
@@ -311,7 +311,6 @@
{
// define the client-side script
StringBuilder script = new StringBuilder();
- script.Append( "<script language=" + Convert.ToChar( 34 ) + "javascript" + Convert.ToChar( 34 ) + " type=" + Convert.ToChar( 34 ) + "text/javascript" + Convert.ToChar( 34 ) + ">" + System.Environment.NewLine );
script.Append( "function " + functionName + " (dropdownlist,caseSensitive) {" + System.Environment.NewLine );
script.Append( " // check the keypressBuffer attribute is defined on the dropdownlist" + System.Environment.NewLine );
script.Append( " var undefined; " + System.Environment.NewLine );
@@ -342,10 +341,9 @@
script.Append( " dropdownlist.keypressBuffer = key; " + System.Environment.NewLine );
script.Append( " return true; // give default behavior " + System.Environment.NewLine );
script.Append( "} " + System.Environment.NewLine );
- script.Append( "</script>" );
// register the client-side script block
- this.Page.ClientScript.RegisterClientScriptBlock( this.GetType(), functionName, script.ToString() );
+ this.Page.ClientScript.RegisterClientScriptBlock( this.GetType(), functionName, script.ToString(), true );
this.Attributes.Add( "onkeydown", "return " + functionName + "(this," + CaseSensitiveKeySort.ToString().ToLower() + ")" );
}
}
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-03-09 20:30:29 UTC (rev 707)
+++ source/trunk/Source/changes.log 2008-03-16 23:34:04 UTC (rev 708)
@@ -1,4 +1,6 @@
-.netTiers v2.2.0.707
+.netTiers v2.2.0.708
+03/16/2008
+ - [ENH] Enhancement to the generated client-side javascript in EntityDropDownList.cs to pass the W3C validation (contrib. CitizenBane)
03/09/2008
- [ROL] Rollback of the change that was made on 12/21/2007 - "Updated ExecuteUpdate to load entity as per data source settings"
- [FIX] Fixes the strongly typed repeater so that you can set a HeaderTemplate and FooterTemplate based on the reported bug here: http://community.codesmithtools.com/forums/p/8074/30185.aspx#30185 (contrib.CitizenBane)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-03-09 20:30:24
|
Revision: 707
http://nettiers.svn.sourceforge.net/nettiers/?rev=707&view=rev
Author: mshatny
Date: 2008-03-09 13:30:29 -0700 (Sun, 09 Mar 2008)
Log Message:
-----------
[FIX] Fixes the strongly typed repeater so that you can set a HeaderTemplate and FooterTemplate based on the reported bug here: http://community.codesmithtools.com/forums/p/8074/30185.aspx#30185 (contrib.CitizenBane)
Modified Paths:
--------------
source/trunk/Source/WebLibrary/UI/TableRepeater.cst
source/trunk/Source/WebLibrary/UI/ViewRepeater.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/WebLibrary/UI/TableRepeater.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/TableRepeater.cst 2008-03-09 19:55:20 UTC (rev 706)
+++ source/trunk/Source/WebLibrary/UI/TableRepeater.cst 2008-03-09 20:30:29 UTC (rev 707)
@@ -166,46 +166,71 @@
set { m_footerTemplate = value; }
}
- /// <summary>
- /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
- /// </summary>
- protected override void CreateChildControls()
- {
- if (ChildControlsCreated)
- {
- return;
- }
+// /// <summary>
+// /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
+// /// </summary>
+// protected override void CreateChildControls()
+// {
+// if (ChildControlsCreated)
+// {
+// return;
+// }
- Controls.Clear();
+// Controls.Clear();
- //Instantiate the Header template (if exists)
- if (m_headerTemplate != null)
- {
- Control headerItem = new Control();
- m_headerTemplate.InstantiateIn(headerItem);
- Controls.Add(headerItem);
- }
+// //Instantiate the Header template (if exists)
+// if (m_headerTemplate != null)
+// {
+// Control headerItem = new Control();
+// m_headerTemplate.InstantiateIn(headerItem);
+// Controls.Add(headerItem);
+// }
- //Instantiate the Footer template (if exists)
- if (m_footerTemplate != null)
- {
- Control footerItem = new Control();
- m_footerTemplate.InstantiateIn(footerItem);
- Controls.Add(footerItem);
- }
+// //Instantiate the Footer template (if exists)
+// if (m_footerTemplate != null)
+// {
+// Control footerItem = new Control();
+// m_footerTemplate.InstantiateIn(footerItem);
+// Controls.Add(footerItem);
+// }
+//
+// ChildControlsCreated = true;
+// }
+
+ /// <summary>
+ /// Overridden and Empty so that span tags are not written
+ /// </summary>
+ /// <param name="writer"></param>
+ public override void RenderBeginTag(HtmlTextWriter writer)
+ {
+
+ }
- ChildControlsCreated = true;
- }
+ /// <summary>
+ /// Overridden and Empty so that span tags are not written
+ /// </summary>
+ /// <param name="writer"></param>
+ public override void RenderEndTag(HtmlTextWriter writer)
+ {
+
+ }
/// <summary>
- /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
- /// </summary>
+ /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
+ /// </summary>
protected override int CreateChildControls(System.Collections.IEnumerable dataSource, bool dataBinding)
- {
+ {
int pos = 0;
if (dataBinding)
{
+ //Instantiate the Header template (if exists)
+ if (m_headerTemplate != null)
+ {
+ Control headerItem = new Control();
+ m_headerTemplate.InstantiateIn(headerItem);
+ Controls.Add(headerItem);
+ }
foreach (object o in dataSource)
{
<%=entityName%> entity = o as <%=entityName%>;
@@ -235,8 +260,16 @@
container.DataBind();
pos++;
- }
}
+ //Instantiate the Footer template (if exists)
+ if (m_footerTemplate != null)
+ {
+ Control footerItem = new Control();
+ m_footerTemplate.InstantiateIn(footerItem);
+ Controls.Add(footerItem);
+ }
+
+ }
return pos;
}
Modified: source/trunk/Source/WebLibrary/UI/ViewRepeater.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/ViewRepeater.cst 2008-03-09 19:55:20 UTC (rev 706)
+++ source/trunk/Source/WebLibrary/UI/ViewRepeater.cst 2008-03-09 20:30:29 UTC (rev 707)
@@ -165,34 +165,53 @@
get { return m_footerTemplate; }
set { m_footerTemplate = value; }
}
+
+
+ /// <summary>
+ /// Overridden and Empty so that span tags are not written
+ /// </summary>
+ /// <param name="writer"></param>
+ public override void RenderBeginTag(HtmlTextWriter writer)
+ {
+
+ }
- /// <summary>
- /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
- /// </summary>
- protected override void CreateChildControls()
- {
- if (ChildControlsCreated)
- {
- return;
- }
- Controls.Clear();
+ /// <summary>
+ /// Overridden and Empty so that span tags are not written
+ /// </summary>
+ /// <param name="writer"></param>
+ public override void RenderEndTag(HtmlTextWriter writer)
+ {
+
+ }
- if (m_headerTemplate != null)
- {
- Control headerItem = new Control();
- m_headerTemplate.InstantiateIn(headerItem);
- Controls.Add(headerItem);
- }
-
-
- if (m_footerTemplate != null)
- {
- Control footerItem = new Control();
- m_footerTemplate.InstantiateIn(footerItem);
- Controls.Add(footerItem);
- }
- ChildControlsCreated = true;
- }
+// /// <summary>
+// /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
+// /// </summary>
+// protected override void CreateChildControls()
+// {
+// if (ChildControlsCreated)
+// {
+// return;
+// }
+// Controls.Clear();
+//
+// if (m_headerTemplate != null)
+// {
+// Control headerItem = new Control();
+// m_headerTemplate.InstantiateIn(headerItem);
+// Controls.Add(headerItem);
+// }
+//
+//
+// if (m_footerTemplate != null)
+// {
+// Control footerItem = new Control();
+// m_footerTemplate.InstantiateIn(footerItem);
+// Controls.Add(footerItem);
+// }
+// ChildControlsCreated = true;
+// }
/// <summary>
/// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
@@ -203,6 +222,14 @@
if (dataBinding)
{
+ //Instantiate the Header template (if exists)
+ if (m_headerTemplate != null)
+ {
+ Control headerItem = new Control();
+ m_headerTemplate.InstantiateIn(headerItem);
+ Controls.Add(headerItem);
+ }
+
foreach (object o in dataSource)
{
<%=entityName%> entity = o as <%=entityName%>;
@@ -232,8 +259,16 @@
container.DataBind();
pos++;
- }
}
+
+ //Instantiate the Footer template (if exists)
+ if (m_footerTemplate != null)
+ {
+ Control footerItem = new Control();
+ m_footerTemplate.InstantiateIn(footerItem);
+ Controls.Add(footerItem);
+ }
+ }
return pos;
}
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-03-09 19:55:20 UTC (rev 706)
+++ source/trunk/Source/changes.log 2008-03-09 20:30:29 UTC (rev 707)
@@ -1,6 +1,7 @@
-.netTiers v2.2.0.706
+.netTiers v2.2.0.707
03/09/2008
- [ROL] Rollback of the change that was made on 12/21/2007 - "Updated ExecuteUpdate to load entity as per data source settings"
+ - [FIX] Fixes the strongly typed repeater so that you can set a HeaderTemplate and FooterTemplate based on the reported bug here: http://community.codesmithtools.com/forums/p/8074/30185.aspx#30185 (contrib.CitizenBane)
02/21/2008
- [ENH] Added "Not Range" and "Not Contains" functionality to SqlStringBuilder and SqlUtil (contrib CitizenBane)
02/20/2008
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-03-09 19:55:17
|
Revision: 706
http://nettiers.svn.sourceforge.net/nettiers/?rev=706&view=rev
Author: mshatny
Date: 2008-03-09 12:55:20 -0700 (Sun, 09 Mar 2008)
Log Message:
-----------
[ROL] Rollback of the change that was made on 12/21/2007 - "Updated ExecuteUpdate to load entity as per data source settings"
Modified Paths:
--------------
source/trunk/Source/WebLibrary/Data/BaseDataSource.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/WebLibrary/Data/BaseDataSource.cst
===================================================================
--- source/trunk/Source/WebLibrary/Data/BaseDataSource.cst 2008-02-21 08:25:42 UTC (rev 705)
+++ source/trunk/Source/WebLibrary/Data/BaseDataSource.cst 2008-03-09 19:55:20 UTC (rev 706)
@@ -1615,9 +1615,7 @@
return 0;
}
- //IList<Entity> entityList = GetEntityList();
- // causes the overridde ProviderDataSource.OnSelected to fire, enabling DeepLoad on updates
- IList<Entity> entityList = Owner.Select();
+ IList<Entity> entityList = GetEntityList();
Entity entity = GetCurrentEntity(entityList, keys);
int count = 0;
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-02-21 08:25:42 UTC (rev 705)
+++ source/trunk/Source/changes.log 2008-03-09 19:55:20 UTC (rev 706)
@@ -1,4 +1,6 @@
-.netTiers v2.2.0.705
+.netTiers v2.2.0.706
+03/09/2008
+ - [ROL] Rollback of the change that was made on 12/21/2007 - "Updated ExecuteUpdate to load entity as per data source settings"
02/21/2008
- [ENH] Added "Not Range" and "Not Contains" functionality to SqlStringBuilder and SqlUtil (contrib CitizenBane)
02/20/2008
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2008-02-21 08:25:45
|
Revision: 705
http://nettiers.svn.sourceforge.net/nettiers/?rev=705&view=rev
Author: swin66
Date: 2008-02-21 00:25:42 -0800 (Thu, 21 Feb 2008)
Log Message:
-----------
[ENH] Added "Not Range" and "Not Contains" functionality to SqlStringBuilder and SqlUtil (contrib CitizenBane)
Modified Paths:
--------------
source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst
source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst 2008-02-20 08:01:41 UTC (rev 704)
+++ source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst 2008-02-21 08:25:42 UTC (rev 705)
@@ -55,11 +55,15 @@
/// </summary>
AppendRange,
/// <summary>
+ /// AppendNotRange
+ /// </summary>
+ AppendNotRange,
+ /// <summary>
/// AppendIsNull
/// </summary>
AppendIsNull,
/// <summary>
- ///
+ /// AppendIsNotNull
/// </summary>
AppendIsNotNull,
/// <summary>
@@ -91,6 +95,10 @@
/// </summary>
AppendContains,
/// <summary>
+ /// AppendNotContains
+ /// </summary>
+ AppendNotContains,
+ /// <summary>
/// AppendLike
/// </summary>
AppendLike,
@@ -501,7 +509,58 @@
}
#endregion AppendRange
+
+ #region AppendNotRange
+ /// <summary>
+ /// Appends the specified column and value not in range to the current filter.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="from"></param>
+ /// <param name="to"></param>
+ /// <returns></returns>
+ public virtual SqlStringBuilder AppendNotRange(String column, String from, String to)
+ {
+ return AppendNotRange(this.junction, column, from, to);
+ }
+
+ /// <summary>
+ /// Appends the specified column and value not in range to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="from"></param>
+ /// <param name="to"></param>
+ /// <returns></returns>
+ public virtual SqlStringBuilder AppendNotRange(String junction, String column, String from, String to)
+ {
+ if (!String.IsNullOrEmpty(from) || !String.IsNullOrEmpty(to))
+ {
+ StringBuilder sb = new StringBuilder();
+
+ sb.Append("NOT (");
+ if (!String.IsNullOrEmpty(from))
+ {
+ sb.AppendFormat("{0} >= {1}", column, SqlUtil.Encode(from, true));
+ }
+ if (!String.IsNullOrEmpty(from) && !String.IsNullOrEmpty(to))
+ {
+ sb.AppendFormat(" {0} ", SqlUtil.AND);
+ }
+ if (!String.IsNullOrEmpty(to))
+ {
+ sb.AppendFormat("{0} <= {1}", column, SqlUtil.Encode(to, true));
+ }
+ sb.Append(")");
+
+ AppendInternal(junction, sb.ToString());
+ }
+
+ return this;
+ }
+
+ #endregion AppendNotRange
+
#region AppendIsNull
/// <summary>
@@ -714,7 +773,7 @@
#endregion AppendStartsWith
- #region AppendEndsWith
+ #region AppendEndsWith
/// <summary>
/// Appends the specified column and value to the current filter.
@@ -746,40 +805,71 @@
#endregion AppendEndsWith
- #region AppendContains
+ #region AppendContains
- /// <summary>
- /// Appends the specified column and value to the current filter.
- /// </summary>
- /// <param name="column"></param>
- /// <param name="value"></param>
- /// <returns></returns>
- public virtual SqlStringBuilder AppendContains(String column, String value)
- {
- return AppendContains(this.junction, column, value);
- }
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlStringBuilder AppendContains(String column, String value)
+ {
+ return AppendContains(this.junction, column, value);
+ }
- /// <summary>
- /// Appends the specified column and value to the current filter.
- /// </summary>
- /// <param name="junction"></param>
- /// <param name="column"></param>
- /// <param name="value"></param>
- /// <returns></returns>
- public virtual SqlStringBuilder AppendContains(String junction, String column, String value)
- {
- if (!String.IsNullOrEmpty(value))
- {
- AppendInternal(junction, SqlUtil.Contains(column, value));
- }
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlStringBuilder AppendContains(String junction, String column, String value)
+ {
+ if (!String.IsNullOrEmpty(value))
+ {
+ AppendInternal(junction, SqlUtil.Contains(column, value));
+ }
+
+ return this;
+ }
- return this;
- }
+ #endregion AppendContains
+
+ #region AppendNotContains
- #endregion AppendContains
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlStringBuilder AppendNotContains(String column, String value)
+ {
+ return AppendNotContains(this.junction, column, value);
+ }
- #region AppendLike
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlStringBuilder AppendNotContains(String junction, String column, String value)
+ {
+ if (!String.IsNullOrEmpty(value))
+ {
+ AppendInternal(junction, SqlUtil.Contains(column, value));
+ }
+ return this;
+ }
+ #endregion AppendNotContains
+
+ #region AppendLike
+
/// <summary>
/// Appends the specified column and value to the current filter.
/// </summary>
@@ -1409,7 +1499,37 @@
}
#endregion AppendRange
+
+ #region AppendNotRange
+ /// <summary>
+ /// Appends the specified column and value not in range to the current filter.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="from"></param>
+ /// <param name="to"></param>
+ /// <returns></returns>
+ public virtual SqlFilterBuilder<EntityColumn> AppendNotRange(EntityColumn column, String from, String to)
+ {
+ return AppendNotRange(this.Junction, column, from, to);
+ }
+
+ /// <summary>
+ /// Appends the specified column and value not in range to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="from"></param>
+ /// <param name="to"></param>
+ /// <returns></returns>
+ public virtual SqlFilterBuilder<EntityColumn> AppendNotRange(String junction, EntityColumn column, String from, String to)
+ {
+ AppendNotRange(junction, GetColumnName(column), from, to);
+ return this;
+ }
+
+ #endregion AppendNotRange
+
#region AppendGreaterThan
/// <summary>
@@ -1550,7 +1670,7 @@
#endregion AppendStartsWith
- #region AppendEndsWith
+ #region AppendEndsWith
/// <summary>
/// Appends the specified column and value to the current filter.
@@ -1578,36 +1698,64 @@
#endregion AppendEndsWith
- #region AppendContains
+ #region AppendContains
- /// <summary>
- /// Appends the specified column and value to the current filter.
- /// </summary>
- /// <param name="column"></param>
- /// <param name="value"></param>
- /// <returns></returns>
- public virtual SqlFilterBuilder<EntityColumn> AppendContains(EntityColumn column, String value)
- {
- return AppendContains(this.Junction, column, value);
- }
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlFilterBuilder<EntityColumn> AppendContains(EntityColumn column, String value)
+ {
+ return AppendContains(this.Junction, column, value);
+ }
- /// <summary>
- /// Appends the specified column and value to the current filter.
- /// </summary>
- /// <param name="junction"></param>
- /// <param name="column"></param>
- /// <param name="value"></param>
- /// <returns></returns>
- public virtual SqlFilterBuilder<EntityColumn> AppendContains(String junction, EntityColumn column, String value)
- {
- AppendContains(junction, GetColumnName(column), value);
- return this;
- }
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlFilterBuilder<EntityColumn> AppendContains(String junction, EntityColumn column, String value)
+ {
+ AppendContains(junction, GetColumnName(column), value);
+ return this;
+ }
- #endregion AppendContains
+ #endregion AppendContains
+
+ #region AppendNotContains
- #region AppendLike
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlFilterBuilder<EntityColumn> AppendNotContains(EntityColumn column, String value)
+ {
+ return AppendNotContains(this.Junction, column, value);
+ }
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlFilterBuilder<EntityColumn> AppendNotContains(String junction, EntityColumn column, String value)
+ {
+ AppendNotContains(junction, GetColumnName(column), value);
+ return this;
+ }
+
+ #endregion AppendNotContains
+
+ #region AppendLike
+
/// <summary>
/// Appends the specified column and value to the current filter.
/// </summary>
@@ -1989,7 +2137,62 @@
}
#endregion AppendRange
+
+ #region AppendNotRange
+ /// <summary>
+ /// Appends the specified column and value not in range to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="from"></param>
+ /// <param name="to"></param>
+ /// <returns></returns>
+ public override SqlFilterBuilder<EntityColumn> AppendNotRange(String junction, EntityColumn column, String from, String to)
+ {
+ _isDirty = true;
+ Parameters.SetCurrentColumn(column);
+ return base.AppendNotRange(junction, column, from, to);
+ }
+
+ /// <summary>
+ /// Appends the specified column and value not in range to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="from"></param>
+ /// <param name="to"></param>
+ /// <returns></returns>
+ public override SqlStringBuilder AppendNotRange(String junction, String column, String from, String to)
+ {
+ if (!String.IsNullOrEmpty(from) || !String.IsNullOrEmpty(to))
+ {
+ StringBuilder sb = new StringBuilder();
+
+ sb.Append("NOT (");
+ if (!String.IsNullOrEmpty(from))
+ {
+ sb.AppendFormat("{0} >= {1}", column, Parameters.GetParameter(from));
+ }
+ if (!String.IsNullOrEmpty(from) && !String.IsNullOrEmpty(to))
+ {
+ sb.AppendFormat(" {0} ", SqlUtil.AND);
+ }
+ if (!String.IsNullOrEmpty(to))
+ {
+ sb.AppendFormat("{0} <= {1}", column, Parameters.GetParameter(to));
+ }
+ sb.Append(")");
+
+ _isDirty = true;
+ AppendInternal(junction, sb.ToString());
+ }
+
+ return this;
+ }
+
+ #endregion AppendNotRange
+
#region AppendGreaterThan
/// <summary>
@@ -2175,7 +2378,7 @@
#endregion AppendStartsWith
- #region AppendEndsWith
+ #region AppendEndsWith
/// <summary>
/// Appends the specified column and value to the current filter.
@@ -2212,44 +2415,81 @@
#endregion AppendEndsWith
- #region AppendContains
+ #region AppendContains
- /// <summary>
- /// Appends the specified column and value to the current filter.
- /// </summary>
- /// <param name="junction"></param>
- /// <param name="column"></param>
- /// <param name="value"></param>
- /// <returns></returns>
- public override SqlFilterBuilder<EntityColumn> AppendContains(String junction, EntityColumn column, String value)
- {
- _isDirty = true;
- Parameters.SetCurrentColumn(column);
- return base.AppendContains(junction, column, value);
- }
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public override SqlFilterBuilder<EntityColumn> AppendContains(String junction, EntityColumn column, String value)
+ {
+ _isDirty = true;
+ Parameters.SetCurrentColumn(column);
+ return base.AppendContains(junction, column, value);
+ }
- /// <summary>
- /// Appends the specified column and value to the current filter.
- /// </summary>
- /// <param name="junction"></param>
- /// <param name="column"></param>
- /// <param name="value"></param>
- /// <returns></returns>
- public override SqlStringBuilder AppendContains(String junction, String column, String value)
- {
- if (!String.IsNullOrEmpty(value))
- {
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public override SqlStringBuilder AppendContains(String junction, String column, String value)
+ {
+ if (!String.IsNullOrEmpty(value))
+ {
+ _isDirty = true;
+ value = SqlUtil.Contains(value);
+ AppendInternal(junction, column, "LIKE", Parameters.GetParameter(value));
+ }
+
+ return this;
+ }
+
+ #endregion AppendContains
+
+ #region AppendNotContains
+
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public override SqlFilterBuilder<EntityColumn> AppendNotContains(String junction, EntityColumn column, String value)
+ {
_isDirty = true;
- value = SqlUtil.Contains(value);
- AppendInternal(junction, column, "LIKE", Parameters.GetParameter(value));
- }
+ Parameters.SetCurrentColumn(column);
+ return base.AppendNotContains(junction, column, value);
+ }
- return this;
- }
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public override SqlStringBuilder AppendNotContains(String junction, String column, String value)
+ {
+ if (!String.IsNullOrEmpty(value))
+ {
+ _isDirty = true;
+ value = SqlUtil.NotContains(value);
+ AppendInternal(junction, column, "NOT LIKE", Parameters.GetParameter(value));
+ }
- #endregion AppendContains
+ return this;
+ }
- #region AppendLike
+ #endregion AppendNotContains
+
+ #region AppendLike
/// <summary>
/// Appends the specified column and value to the current filter.
Modified: source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst 2008-02-20 08:01:41 UTC (rev 704)
+++ source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst 2008-02-21 08:25:42 UTC (rev 705)
@@ -178,7 +178,58 @@
}
#endregion Contains
+
+ #region NotContains
+ /// <summary>
+ /// Creates a <see cref="SqlComparisonType.NotContains"/> expression.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public static String NotContains(String column, String value)
+ {
+ return NotContains(column, value, false);
+ }
+
+ /// <summary>
+ /// Creates a <see cref="SqlComparisonType.NotContains"/> expression.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <param name="ignoreCase"></param>
+ /// <returns></returns>
+ public static String NotContains(String column, String value, bool ignoreCase)
+ {
+ return NotContains(column, value, ignoreCase, true);
+ }
+
+ /// <summary>
+ /// Creates a <see cref="SqlComparisonType.NotContains"/> expression.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <param name="ignoreCase"></param>
+ /// <param name="surround"></param>
+ /// <returns></returns>
+ public static String NotContains(String column, String value, bool ignoreCase, bool surround)
+ {
+ if (String.IsNullOrEmpty(value)) return IsNull(column);
+ return String.Format(GetNotLikeFormat(ignoreCase, surround), column, NotContains(value));
+ }
+
+ /// <summary>
+ /// Encodes the value for a <see cref="SqlComparisonType.NotContains"/> expression.
+ /// </summary>
+ /// <param name="value">The value.</param>
+ /// <returns></returns>
+ public static String NotContains(String value)
+ {
+ return String.Format("%{0}%", Encode(value));
+ }
+
+ #endregion Contains
+
#region StartsWith
/// <summary>
@@ -580,6 +631,10 @@
/// Represents LIKE %value%.
/// </summary>
Contains,
+ /// <summary>
+ /// Represents NOT LIKE %value%.
+ /// </summary>
+ NotContains,
/// <summary>
/// Represents LIKE value.
/// </summary>
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-02-20 08:01:41 UTC (rev 704)
+++ source/trunk/Source/changes.log 2008-02-21 08:25:42 UTC (rev 705)
@@ -1,4 +1,6 @@
-.netTiers v2.2.0.704
+.netTiers v2.2.0.705
+02/21/2008
+ - [ENH] Added "Not Range" and "Not Contains" functionality to SqlStringBuilder and SqlUtil (contrib CitizenBane)
02/20/2008
- [ENH] Added "Not Like" functionality to SqlStringBuilder and SqlUtil (contrib CitizenBane)
- [ENH] Added "RedirectAfterDelete" methods to FormUtilBase (contrib Vinny Davi)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2008-02-20 08:01:42
|
Revision: 704
http://nettiers.svn.sourceforge.net/nettiers/?rev=704&view=rev
Author: swin66
Date: 2008-02-20 00:01:41 -0800 (Wed, 20 Feb 2008)
Log Message:
-----------
[ENH] Added "RedirectAfterDelete" methods to FormUtilBase (contrib Vinny Davi)
Modified Paths:
--------------
source/trunk/Source/WebLibrary/UI/FormUtilBase.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/WebLibrary/UI/FormUtilBase.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/FormUtilBase.cst 2008-02-20 07:53:38 UTC (rev 703)
+++ source/trunk/Source/WebLibrary/UI/FormUtilBase.cst 2008-02-20 08:01:41 UTC (rev 704)
@@ -263,6 +263,47 @@
}
/// <summary>
+ /// Redirects the client to a new URL after the ItemDeleted event of
+ /// the <see cref="FormView"/> object has been raised.
+ /// </summary>
+ /// <param name="formView">A <see cref="FormView"/> object.</param>
+ /// <param name="url">The target location.</param>
+ public static void RedirectAfterDelete(FormView formView, String url)
+ {
+ RedirectAfterDelete(formView, url, null);
+ }
+
+ /// <summary>
+ /// Redirects the client to a new URL after the ItemDeleted event of
+ /// the <see cref="FormView"/> object has been raised.
+ /// </summary>
+ /// <param name="formView">A <see cref="FormView"/> object.</param>
+ /// <param name="url">The target location.</param>
+ /// <param name="dataSource">The associated <see cref="ILinkedDataSource"/> object.</param>
+ public static void RedirectAfterDelete(FormView formView, String url, ILinkedDataSource dataSource)
+ {
+ formView.ItemDeleted += new FormViewDeletedEventHandler(
+ delegate(object sender, FormViewDeletedEventArgs e)
+ {
+ Redirect(url, dataSource, e.Exception);
+ }
+ );
+ }
+
+ /// <summary>
+ /// Redirects the client to a new URL after the ItemDeleted event of
+ /// the <see cref="FormView"/> object has been raised.
+ /// </summary>
+ /// <param name="formView">A <see cref="FormView"/> object.</param>
+ /// <param name="gridView">A <see cref="GridView"/> object.</param>
+ /// <param name="url">The target location.</param>
+ public static void RedirectAfterDelete(FormView formView, GridView gridView, String url)
+ {
+ url = GetRedirectUrl(gridView, url);
+ RedirectAfterDelete(formView, url);
+ }
+
+ /// <summary>
/// Redirects the client to a new URL after the ItemCommand event of
/// the <see cref="FormView"/> object has been raised with a CommandName
/// of "Cancel".
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-02-20 07:53:38 UTC (rev 703)
+++ source/trunk/Source/changes.log 2008-02-20 08:01:41 UTC (rev 704)
@@ -1,6 +1,7 @@
-.netTiers v2.2.0.703
+.netTiers v2.2.0.704
02/20/2008
- [ENH] Added "Not Like" functionality to SqlStringBuilder and SqlUtil (contrib CitizenBane)
+ - [ENH] Added "RedirectAfterDelete" methods to FormUtilBase (contrib Vinny Davi)
02/15/2008
- [FIX] Fixed grouping issue in SqlStringBuilder. Developer must be sure to pair calls to BeginGroup and EndGroup (NT-195)
01/28/2008
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2008-02-20 07:53:33
|
Revision: 703
http://nettiers.svn.sourceforge.net/nettiers/?rev=703&view=rev
Author: swin66
Date: 2008-02-19 23:53:38 -0800 (Tue, 19 Feb 2008)
Log Message:
-----------
[ENH] Added "Not Like" functionality to SqlStringBuilder and SqlUtil (contrib CitizenBane)
Modified Paths:
--------------
source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst
source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst 2008-02-15 16:05:33 UTC (rev 702)
+++ source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst 2008-02-20 07:53:38 UTC (rev 703)
@@ -93,7 +93,12 @@
/// <summary>
/// AppendLike
/// </summary>
- AppendLike
+ AppendLike,
+ /// <summary>
+ /// AppendLike
+ /// </summary>
+ AppendNotLike
+
}
/// <summary>
@@ -804,7 +809,38 @@
}
#endregion AppendLike
+
+ #region AppendNotLike
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlStringBuilder AppendNotLike(String column, String value)
+ {
+ return AppendNotLike(this.junction, column, value);
+ }
+
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlStringBuilder AppendNotLike(String junction, String column, String value)
+ {
+ if (!String.IsNullOrEmpty(value))
+ {
+ AppendInternal(junction, SqlUtil.NotLike(column, value));
+ }
+
+ return this;
+ }
+ #endregion
+
#region AppendInternal
/// <summary>
@@ -1597,6 +1633,35 @@
}
#endregion AppendLike
+
+ #region AppendNotLike
+
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlFilterBuilder<EntityColumn> AppendNotLike(EntityColumn column, String value)
+ {
+ return AppendNotLike(this.Junction, column, value);
+ }
+
+ /// <summary>
+ /// Appends the specified column and value to the current filter.
+ /// </summary>
+ /// <param name="junction"></param>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public virtual SqlFilterBuilder<EntityColumn> AppendNotLike(String junction, EntityColumn column, String value)
+ {
+ AppendNotLike(junction, GetColumnName(column), value);
+ return this;
+ }
+
+
+ #endregion
#region Methods
Modified: source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst 2008-02-15 16:05:33 UTC (rev 702)
+++ source/trunk/Source/DataAccessLayer/Query/SqlUtil.cst 2008-02-20 07:53:38 UTC (rev 703)
@@ -331,7 +331,58 @@
}
#endregion Like
+
+ #region NotLike
+ /// <summary>
+ /// Creates a <see cref="SqlComparisonType.NotLike"/> expression.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <returns></returns>
+ public static String NotLike(String column, String value)
+ {
+ return NotLike(column, value, false);
+ }
+
+ /// <summary>
+ /// Creates a <see cref="SqlComparisonType.NotLike"/> expression.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <param name="ignoreCase"></param>
+ /// <returns></returns>
+ public static String NotLike(String column, String value, bool ignoreCase)
+ {
+ return NotLike(column, value, ignoreCase, true);
+ }
+
+ /// <summary>
+ /// Creates a <see cref="SqlComparisonType.NotLike"/> expression.
+ /// </summary>
+ /// <param name="column"></param>
+ /// <param name="value"></param>
+ /// <param name="ignoreCase"></param>
+ /// <param name="surround"></param>
+ /// <returns></returns>
+ public static String NotLike(String column, String value, bool ignoreCase, bool surround)
+ {
+ if ( String.IsNullOrEmpty(value) ) return IsNull(column);
+ return String.Format(GetNotLikeFormat(ignoreCase, surround), column, Like(value));
+ }
+
+ /// <summary>
+ /// Encodes the value for a <see cref="SqlComparisonType.NotLike"/> expression.
+ /// </summary>
+ /// <param name="value">The value.</param>
+ /// <returns></returns>
+ public static String NotLike(String value)
+ {
+ return String.Format("{0}", Encode(value));
+ }
+
+ #endregion Like
+
#region Null/Not Null
/// <summary>
@@ -448,8 +499,36 @@
return ignoreCase ? "UPPER({0}) LIKE UPPER({1})" : "{0} LIKE {1}";
}
+
+ /// <summary>
+ /// Gets the not like format string.
+ /// </summary>
+ /// <param name="ignoreCase">if set to <c>true</c> [ignore case].</param>
+ /// <returns></returns>
+ public static String GetNotLikeFormat(bool ignoreCase)
+ {
+ return GetNotLikeFormat(ignoreCase, true);
+ }
/// <summary>
+ /// Gets the not like format string.
+ /// </summary>
+ /// <param name="ignoreCase">if set to <c>true</c> [ignore case].</param>
+ /// <param name="surround"></param>
+ /// <returns></returns>
+ public static String GetNotLikeFormat(bool ignoreCase, bool surround)
+ {
+ if ( surround )
+ {
+ return ignoreCase ? "UPPER({0}) NOT LIKE UPPER('{1}')" : "{0} NOT LIKE '{1}'";
+ }
+
+ return ignoreCase ? "UPPER({0}) NOT LIKE UPPER({1})" : "{0} NOT LIKE {1}";
+ }
+
+
+
+ /// <summary>
/// Gets the equal format string.
/// </summary>
/// <param name="ignoreCase">if set to <c>true</c> [ignore case].</param>
@@ -504,7 +583,12 @@
/// <summary>
/// Represents LIKE value.
/// </summary>
- Like
+ Like,
+ /// <summary>
+ /// Represents NOT LIKE value.
+ /// </summary>
+ NotLike
+
}
#endregion SqlComparisonType Enum
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-02-15 16:05:33 UTC (rev 702)
+++ source/trunk/Source/changes.log 2008-02-20 07:53:38 UTC (rev 703)
@@ -1,4 +1,6 @@
-.netTiers v2.2.0.702
+.netTiers v2.2.0.703
+02/20/2008
+ - [ENH] Added "Not Like" functionality to SqlStringBuilder and SqlUtil (contrib CitizenBane)
02/15/2008
- [FIX] Fixed grouping issue in SqlStringBuilder. Developer must be sure to pair calls to BeginGroup and EndGroup (NT-195)
01/28/2008
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bgj...@us...> - 2008-02-15 16:05:30
|
Revision: 702
http://nettiers.svn.sourceforge.net/nettiers/?rev=702&view=rev
Author: bgjohnso
Date: 2008-02-15 08:05:33 -0800 (Fri, 15 Feb 2008)
Log Message:
-----------
[FIX] Fixed grouping issue in SqlStringBuilder. Developer must be sure to pair calls to BeginGroup and EndGroup (NT-195)
195
Modified Paths:
--------------
source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst 2008-02-04 17:39:35 UTC (rev 701)
+++ source/trunk/Source/DataAccessLayer/Query/SqlStringBuilder.cst 2008-02-15 16:05:33 UTC (rev 702)
@@ -944,10 +944,10 @@
/// </summary>
internal virtual void EnsureGroups()
{
- while (_groupCount > 0)
+ /*while (_groupCount > 0)
{
EndGroup();
- }
+ }*/
}
#endregion Methods
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-02-04 17:39:35 UTC (rev 701)
+++ source/trunk/Source/changes.log 2008-02-15 16:05:33 UTC (rev 702)
@@ -1,4 +1,6 @@
-.netTiers v2.2.0.699
+.netTiers v2.2.0.702
+02/15/2008
+ - [FIX] Fixed grouping issue in SqlStringBuilder. Developer must be sure to pair calls to BeginGroup and EndGroup (NT-195)
01/28/2008
- [ENH] Fully qualify Type.EmptyTypes in ComponentDataAccess so entity name of Type does not cause problems (contrib JimPotts)
- [ENH] Exclude svn files from projects (contrib JimPotts)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sa...@us...> - 2008-02-04 17:39:30
|
Revision: 701
http://nettiers.svn.sourceforge.net/nettiers/?rev=701&view=rev
Author: sapeavy
Date: 2008-02-04 09:39:35 -0800 (Mon, 04 Feb 2008)
Log Message:
-----------
Fixes an issue with multiple controls having the same name in the ASP.NET admin pages.
Modified Paths:
--------------
source/trunk/Source/ASP.NET/Common/Admin/EntityEdit.aspx.cs.cst
source/trunk/Source/ASP.NET/Common/Admin/EntityEdit.aspx.cst
Modified: source/trunk/Source/ASP.NET/Common/Admin/EntityEdit.aspx.cs.cst
===================================================================
--- source/trunk/Source/ASP.NET/Common/Admin/EntityEdit.aspx.cs.cst 2008-02-04 17:37:48 UTC (rev 700)
+++ source/trunk/Source/ASP.NET/Common/Admin/EntityEdit.aspx.cs.cst 2008-02-04 17:39:35 UTC (rev 701)
@@ -120,10 +120,11 @@
ColumnSchemaCollection keysRelatedCol = relatedTable.PrimaryKey.MemberColumns;
string keysRelated = GetKeysName(keysRelatedCol);
iRelatedCounter++;
+ string gridViewId = string.Format("GridView{0}{1}",entityRelated,iRelatedCounter);
%>
- protected void GridView<%=entityRelated%>_SelectedIndexChanged(object sender, EventArgs e)
+ protected void <%=gridViewId%>_SelectedIndexChanged(object sender, EventArgs e)
{
- string urlParams = string.Format(<%=getUrlFk(keysRelatedCol, entityRelated)%>);
+ string urlParams = string.Format(<%=getUrlFk(keysRelatedCol, (entityRelated+iRelatedCounter))%>);
Response.Redirect("<%=entityRelated%>Edit.aspx?" + urlParams, true);
}
<%
Modified: source/trunk/Source/ASP.NET/Common/Admin/EntityEdit.aspx.cst
===================================================================
--- source/trunk/Source/ASP.NET/Common/Admin/EntityEdit.aspx.cst 2008-02-04 17:37:48 UTC (rev 700)
+++ source/trunk/Source/ASP.NET/Common/Admin/EntityEdit.aspx.cst 2008-02-04 17:39:35 UTC (rev 701)
@@ -138,7 +138,8 @@
string keysRelated = GetKeysName(keysRelatedCol);
string dataSourceId = string.Format("{0}DataSource{1}",entityRelated,index);
-
+ string gridViewId = string.Format("GridView{0}{1}",entityRelated,index);
+
if (IncludeAtlasToolkit && IncludeAtlasLibrary)
{
%>
@@ -153,9 +154,9 @@
<%
}
%>
- <data:EntityGridView ID="GridView<%=entityRelated%>" runat="server"
- AutoGenerateColumns="False"
- OnSelectedIndexChanged="GridView<%=entityRelated%>_SelectedIndexChanged"
+ <data:EntityGridView ID="<%=gridViewId%>" runat="server"
+ AutoGenerateColumns="False"
+ OnSelectedIndexChanged="<%=gridViewId%>_SelectedIndexChanged"
DataSourceID="<%=dataSourceId%>"
DataKeyNames="<%=GetDataKeyNames(keysRelatedCol)%>"
AllowMultiColumnSorting="false"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sa...@us...> - 2008-02-04 17:37:46
|
Revision: 700
http://nettiers.svn.sourceforge.net/nettiers/?rev=700&view=rev
Author: sapeavy
Date: 2008-02-04 09:37:48 -0800 (Mon, 04 Feb 2008)
Log Message:
-----------
When creating unit tests there were certain methods created in the orderedtest and *.generated.cs files, but not in the TestClass files. This was due to an additional check in the if logic.
Modified Paths:
--------------
source/trunk/Source/UnitTests/EntityRepositoryTest.generated.cst
source/trunk/Source/UnitTests/OrderedEntityRepositoryTestList.cst
Modified: source/trunk/Source/UnitTests/EntityRepositoryTest.generated.cst
===================================================================
--- source/trunk/Source/UnitTests/EntityRepositoryTest.generated.cst 2008-01-28 09:15:33 UTC (rev 699)
+++ source/trunk/Source/UnitTests/EntityRepositoryTest.generated.cst 2008-02-04 17:37:48 UTC (rev 700)
@@ -132,7 +132,7 @@
}
- <% if (IncludeInsert) { %>
+ <% if (IncludeInsert && !isJunctionTable) { %>
/// <summary>
/// Inserts a mock <%=className%> entity into the database.
/// </summary>
@@ -225,7 +225,7 @@
}
<% } %>
- <% if (IncludeUpdate) { %>
+ <% if (IncludeUpdate && !isJunctionTable) { %>
/// <summary>
/// Updates a mock <%=className%> entity into the database.
/// </summary>
@@ -250,7 +250,7 @@
<% } %>
- <% if (IncludeDelete) { %>
+ <% if (IncludeDelete && !isJunctionTable) { %>
/// <summary>
/// Delete the mock <%=className%> entity into the database.
/// </summary>
@@ -351,7 +351,7 @@
#endregion
- <% if (IncludeGetListByFK) { %>
+ <% if (IncludeGetListByFK && !isJunctionTable) { %>
/// <summary>
/// Check the foreign key dal methods.
@@ -378,7 +378,7 @@
}
<% } %>
- <% if (IncludeGetListByIX) { %>
+ <% if (IncludeGetListByIX && !isJunctionTable) { %>
/// <summary>
/// Check the indexes dal methods.
Modified: source/trunk/Source/UnitTests/OrderedEntityRepositoryTestList.cst
===================================================================
--- source/trunk/Source/UnitTests/OrderedEntityRepositoryTestList.cst 2008-01-28 09:15:33 UTC (rev 699)
+++ source/trunk/Source/UnitTests/OrderedEntityRepositoryTestList.cst 2008-02-04 17:37:48 UTC (rev 700)
@@ -31,6 +31,8 @@
string unitTestClassName = GetClassName(SourceTable, ClassNameFormat.UnitTest);
%>
<%
+ bool isJunctionTable = IsJunctionTable(SourceTable);
+
// Collection of all columns in the table.
ColumnSchemaCollection cols = SourceTable.Columns;
@@ -97,7 +99,7 @@
<AutoSuite type="Microsoft.VisualStudio.TestTools.TestTypes.Ordered.AutoSuite, Microsoft.VisualStudio.QualityTools.Tips.OrderedTest.ObjectModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<m_continueAfterFailure type="System.Boolean">True</m_continueAfterFailure>
<links type="System.Collections.ArrayList">
- <% if (IncludeInsert) { %>
+ <% if (IncludeInsert && !isJunctionTable) { %>
<element type="Microsoft.VisualStudio.TestTools.Common.Link">
<id type="System.Guid"><%=guidStep_01%></id>
<name type="System.String">Step_01_Insert</name>
@@ -124,7 +126,7 @@
<enabled type="System.Boolean">True</enabled>
</element>
<% } %>
- <% if (IncludeUpdate) { %>
+ <% if (IncludeUpdate && !isJunctionTable) { %>
<element type="Microsoft.VisualStudio.TestTools.Common.Link">
<id type="System.Guid"><%=guidStep_04%></id>
<name type="System.String">Step_04_Update</name>
@@ -133,7 +135,7 @@
<enabled type="System.Boolean">True</enabled>
</element>
<% } %>
- <% if (IncludeDelete) { %>
+ <% if (IncludeDelete && !isJunctionTable) { %>
<element type="Microsoft.VisualStudio.TestTools.Common.Link">
<id type="System.Guid"><%=guidStep_05%></id>
<name type="System.String">Step_05_Delete</name>
@@ -170,7 +172,7 @@
<type type="System.Type, mscorlib">Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</type>
<enabled type="System.Boolean">True</enabled>
</element>
- <% if (IncludeGetListByFK) { %>
+ <% if (IncludeGetListByFK && !isJunctionTable) { %>
<element type="Microsoft.VisualStudio.TestTools.Common.Link">
<id type="System.Guid"><%=guidStep_10%></id>
<name type="System.String">Step_10_FK</name>
@@ -179,7 +181,7 @@
<enabled type="System.Boolean">True</enabled>
</element>
<% } %>
- <% if (IncludeGetListByIX) { %>
+ <% if (IncludeGetListByIX && !isJunctionTable) { %>
<element type="Microsoft.VisualStudio.TestTools.Common.Link">
<id type="System.Guid"><%=guidStep_11%></id>
<name type="System.String">Step_11_IX</name>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2008-01-28 09:15:38
|
Revision: 699
http://nettiers.svn.sourceforge.net/nettiers/?rev=699&view=rev
Author: swin66
Date: 2008-01-28 01:15:33 -0800 (Mon, 28 Jan 2008)
Log Message:
-----------
[ENH] Fully qualify Type.EmptyTypes in ComponentDataAccess so entity name of Type does not cause problems (contrib JimPotts)
[ENH] Exclude svn files from projects (contrib JimPotts)
Modified Paths:
--------------
source/trunk/Source/Components/ComponentDataAccess.cst
source/trunk/Source/VisualStudio/vsnet2005.project.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/Components/ComponentDataAccess.cst
===================================================================
--- source/trunk/Source/Components/ComponentDataAccess.cst 2008-01-18 19:30:26 UTC (rev 698)
+++ source/trunk/Source/Components/ComponentDataAccess.cst 2008-01-28 09:15:33 UTC (rev 699)
@@ -1143,7 +1143,7 @@
[DataObjectMethod(DataObjectMethodType.Select)]
<%= constructorAccessModifier %> void <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(<%= className %> entity)
{
- <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(entity, false, DeepLoadType.ExcludeChildren, Type.EmptyTypes);
+ <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(entity, false, DeepLoadType.ExcludeChildren, System.Type.EmptyTypes);
}
/// <summary>
@@ -1158,7 +1158,7 @@
[DataObjectMethod(DataObjectMethodType.Select)]
<%= constructorAccessModifier %> void <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(<%= className %> entity, bool deep)
{
- <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(entity, deep, DeepLoadType.ExcludeChildren, Type.EmptyTypes);
+ <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(entity, deep, DeepLoadType.ExcludeChildren, System.Type.EmptyTypes);
}
/// <summary>
@@ -1217,7 +1217,7 @@
[DataObjectMethod(DataObjectMethodType.Select)]
<%= constructorAccessModifier %> void <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(<%= collectionClassName %> entityCollection)
{
- <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(entityCollection, false, DeepLoadType.ExcludeChildren, Type.EmptyTypes);
+ <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(entityCollection, false, DeepLoadType.ExcludeChildren, System.Type.EmptyTypes);
}
/// <summary>
@@ -1231,7 +1231,7 @@
[DataObjectMethod(DataObjectMethodType.Select)]
<%= constructorAccessModifier %> void <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(<%= collectionClassName %> entityCollection, bool deep)
{
- <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(entityCollection, deep, DeepLoadType.ExcludeChildren, Type.EmptyTypes);
+ <%=partialClassInternalPrefix%><%= MethodNames.DeepLoad %>(entityCollection, deep, DeepLoadType.ExcludeChildren, System.Type.EmptyTypes);
}
/// <summary>
@@ -1294,7 +1294,7 @@
[DataObjectMethod(DataObjectMethodType.Update)]
<%= IsServiceLayer ? interfaceImplModifier : constructorAccessModifier %> bool <%=partialClassInternalPrefix%><%= MethodNames.DeepSave %>(<%= className %> entity)
{
- return <%=partialClassInternalPrefix%><%= MethodNames.DeepSave %>(entity, DeepSaveType.ExcludeChildren, Type.EmptyTypes);
+ return <%=partialClassInternalPrefix%><%= MethodNames.DeepSave %>(entity, DeepSaveType.ExcludeChildren, System.Type.EmptyTypes);
}
/// <summary>
@@ -1353,7 +1353,7 @@
[DataObjectMethod(DataObjectMethodType.Update)]
<%= constructorAccessModifier %> bool <%=partialClassInternalPrefix%><%= MethodNames.DeepSave %>(<%= collectionClassName %> entityCollection)
{
- return <%=partialClassInternalPrefix%><%= MethodNames.DeepSave %>(entityCollection, DeepSaveType.ExcludeChildren, Type.EmptyTypes);
+ return <%=partialClassInternalPrefix%><%= MethodNames.DeepSave %>(entityCollection, DeepSaveType.ExcludeChildren, System.Type.EmptyTypes);
}
/// <summary>
Modified: source/trunk/Source/VisualStudio/vsnet2005.project.cst
===================================================================
--- source/trunk/Source/VisualStudio/vsnet2005.project.cst 2008-01-18 19:30:26 UTC (rev 698)
+++ source/trunk/Source/VisualStudio/vsnet2005.project.cst 2008-01-28 09:15:33 UTC (rev 699)
@@ -1,4 +1,4 @@
-<%@ CodeTemplate Src="../TemplateLib/CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Language="C#" TargetLanguage="Xml" Description="Template description here." Debug="True" ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002" %>
+<%@ CodeTemplate Src="../TemplateLib/CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Language="C#" TargetLanguage="Xml" Description="Template description here." Debug="True" ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002" %>
<%@ Property Name="SourceDatabase" Type="SchemaExplorer.DatabaseSchema" Optional="True" Category="Context" Description="Database that the stored procedures should be based on." %>
<%@ Property Name="SourceTables" Type="SchemaExplorer.TableSchemaCollection" Category="Context" Description="Tables that the stored procedures should be based on." %>
@@ -473,7 +473,7 @@
<!-- Include any user files -->
<ItemGroup>
- <Compile Include="**\*.user.*" Exclude="**\*.csproj.user" >
+ <Compile Include="**\*.user.*" Exclude="**\*.csproj.user;**\.svn\**" >
<SubType>Code</SubType>
</Compile>
</ItemGroup>
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-01-18 19:30:26 UTC (rev 698)
+++ source/trunk/Source/changes.log 2008-01-28 09:15:33 UTC (rev 699)
@@ -1,4 +1,7 @@
-.netTiers v2.2.0.698
+.netTiers v2.2.0.699
+01/28/2008
+ - [ENH] Fully qualify Type.EmptyTypes in ComponentDataAccess so entity name of Type does not cause problems (contrib JimPotts)
+ - [ENH] Exclude svn files from projects (contrib JimPotts)
01/18/2008
- [ROL] Rollback of the 01/16/2008 changes made to the EntityDropDownList.cs. Needs more testing.
01/17/2008
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-01-18 19:30:24
|
Revision: 698
http://nettiers.svn.sourceforge.net/nettiers/?rev=698&view=rev
Author: mshatny
Date: 2008-01-18 11:30:26 -0800 (Fri, 18 Jan 2008)
Log Message:
-----------
[ROL] Rollback of the 01/16/2008 changes made to the EntityDropDownList.cs. Needs more testing.
Modified Paths:
--------------
source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst 2008-01-18 03:54:52 UTC (rev 697)
+++ source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst 2008-01-18 19:30:26 UTC (rev 698)
@@ -9,7 +9,6 @@
using System.Web.UI.WebControls;
using System.Text;
using System.ComponentModel;
-using System.Collections;
using <%=RootNameSpace%>;
#endregion
@@ -18,7 +17,7 @@
/// <summary>
/// A specialised Drop Down List that adds extra functionality to the base class.
/// Features include the ability to add a null item, make the control readonly,
- /// make the control required, multiple datatext fields and it supports type ahead
+ /// make the control required and it supports type ahead
/// </summary>
public class EntityDropDownList : DropDownList
{
@@ -73,25 +72,6 @@
}
/// <summary>
- /// Gets or sets a value to the formatting string
- /// </summary>
- [Bindable(true),
- Category("Appearance"),
- DefaultValue(""), Description("Gets or sets a value to the formatting string")]
- public string DataTextFieldFormatString
- {
- get
- {
- if (ViewState["DataTextFieldFormatString"] == null)
- {
- ViewState.Add("DataTextFieldFormatString", String.Empty);
- }
- return (string)ViewState["DataTextFieldFormatString"];
- }
- set { ViewState["DataTextFieldFormatString"] = value; }
- }
-
- /// <summary>
/// Gets or sets a value indicating whether this control is read only.
/// </summary>
/// <value><c>true</c> if [read only]; otherwise, <c>false</c>.</value>
@@ -288,136 +268,24 @@
}
}
- /// <summary>
+ /// <summary>
/// Raises the <see cref="E:System.Web.UI.Control.DataBinding"></see> event.
/// </summary>
/// <param name="e">An <see cref="T:System.EventArgs"></see> object that contains the event data.</param>
protected override void OnDataBinding( EventArgs e )
{
- base.Items.Clear();
-
if ( AppendNullItem )
{
nullItem.Text = NullItemText;
nullItem.Value = string.Empty;
base.Items.Add( nullItem );
}
+
+ base.OnDataBinding( e );
- Object source;
- if (this.DataSource == null)
- source = (Object)NamingContainer.FindControl(DataSourceID);
- else
- source = this.DataSource;
-
- IEnumerable resolvedDataSource = GetResolvedDataSource(source, this.DataMember);
- if (resolvedDataSource != null)
- {
- string dataTextField = DataTextField;
- string dataValueField = DataValueField;
-
- ICollection rdsCollection = (ICollection)resolvedDataSource;
- if (rdsCollection != null)
- {
- Items.Capacity = this.Items.Count + rdsCollection.Count;
- }
- bool valid = ((dataTextField.Length >= 0) && (dataValueField.Length >= 0));
-
- foreach (Object current in resolvedDataSource)
- {
-
- ListItem li = new ListItem();
- if (valid)
- {
- if (dataTextField.Length >= 0)
- {
- string[] fields = dataTextField.Split(',');
- string temp = string.Empty;
- if (!String.IsNullOrEmpty(this.DataTextFieldFormatString))
- {
- int j = 0;
- foreach (String s in fields)
- {
- temp += DataBinder.GetPropertyValue(current, s.Trim(), null);
-
- if (j < fields.Length-1)
- temp += "~~~";
- j++;
- }
- fields = System.Text.RegularExpressions.Regex.Split(temp, "~~~");
- li.Text = string.Format(this.DataTextFieldFormatString, fields);
- }
- else
- {
- li.Text = DataBinder.GetPropertyValue(current, dataTextField, null);
- }
- }
- if (dataValueField.Length >= 0)
- {
- li.Value = DataBinder.GetPropertyValue(current, dataValueField, null);
- }
- }
- else
- {
- li.Text = dataTextField.ToString();
- li.Value = dataValueField.ToString();
- }
- Items.Add(li);
- }
- }
}
/// <summary>
- /// Helper method to cast datasource object
- /// to IEnumerable
- /// </summary>
- private System.Collections.IEnumerable GetResolvedDataSource(object source, string member)
- {
- if (source != null && (source is IListSource || source is Web.Data.IListDataSource))
- {
- if (source is Web.Data.IListDataSource)
- {
- Web.Data.IListDataSource listT = (Web.Data.IListDataSource)source;
- return listT.GetEntityList();
- }
- IListSource src = (IListSource)source;
- IList list = src.GetList();
- if (!src.ContainsListCollection)
- {
- return list;
- }
- if (list != null && list is ITypedList)
- {
- ITypedList tlist = (ITypedList)list;
- PropertyDescriptorCollection pdc = tlist.GetItemProperties(new PropertyDescriptor[0]);
- if (pdc != null && pdc.Count > 0)
- {
- PropertyDescriptor pd = null;
- if (member != null && member.Length > 0)
- {
- pd = pdc.Find(member, true);
- }
- else
- {
- pd = pdc[0];
- }
- if (pd != null)
- {
- object rv = pd.GetValue(list[0]);
- if (rv != null && rv is IEnumerable)
- {
- return (IEnumerable)rv;
- }
- }
- }
- }
- }
- if (source is IEnumerable)
- {
- return (IEnumerable)source;
- }
- return null;
- }
- /// <summary>
/// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
/// </summary>
protected override void CreateChildControls()
@@ -538,15 +406,15 @@
}
}
- /// <summary>
- /// Calls the validate method on the embedded required validator if permitted
- /// </summary>
- public void Validate()
- {
- if ( Required && requiredValidator != null )
+ /// <summary>
+ /// Calls the validate method on the embedded required validator if permitted
+ /// </summary>
+ public void Validate()
{
- requiredValidator.Validate();
+ if ( Required && requiredValidator != null )
+ {
+ requiredValidator.Validate();
+ }
}
- }
- }
+ }
}
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-01-18 03:54:52 UTC (rev 697)
+++ source/trunk/Source/changes.log 2008-01-18 19:30:26 UTC (rev 698)
@@ -1,4 +1,6 @@
-.netTiers v2.2.0.697
+.netTiers v2.2.0.698
+01/18/2008
+ - [ROL] Rollback of the 01/16/2008 changes made to the EntityDropDownList.cs. Needs more testing.
01/17/2008
- [FIX] Bug fix 'capacity was less than the current size' in the EntityDropDownList.cs
01/16/2008
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-01-18 03:54:48
|
Revision: 697
http://nettiers.svn.sourceforge.net/nettiers/?rev=697&view=rev
Author: mshatny
Date: 2008-01-17 19:54:52 -0800 (Thu, 17 Jan 2008)
Log Message:
-----------
[FIX] Bug fix 'capacity was less than the current size' in the EntityDropDownList.cs
Modified Paths:
--------------
source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst 2008-01-16 20:27:27 UTC (rev 696)
+++ source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst 2008-01-18 03:54:52 UTC (rev 697)
@@ -294,6 +294,8 @@
/// <param name="e">An <see cref="T:System.EventArgs"></see> object that contains the event data.</param>
protected override void OnDataBinding( EventArgs e )
{
+ base.Items.Clear();
+
if ( AppendNullItem )
{
nullItem.Text = NullItemText;
@@ -312,22 +314,11 @@
{
string dataTextField = DataTextField;
string dataValueField = DataValueField;
- if (AppendNullItem)
- {
- for (int i = this.Items.Count - 1; i > 0; i--)
- {
- ListItem li = this.Items[i];
- this.Items.Remove(li);
- }
- }
- else
- {
- Items.Clear();
- }
+
ICollection rdsCollection = (ICollection)resolvedDataSource;
if (rdsCollection != null)
{
- Items.Capacity = rdsCollection.Count;
+ Items.Capacity = this.Items.Count + rdsCollection.Count;
}
bool valid = ((dataTextField.Length >= 0) && (dataValueField.Length >= 0));
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-01-16 20:27:27 UTC (rev 696)
+++ source/trunk/Source/changes.log 2008-01-18 03:54:52 UTC (rev 697)
@@ -1,5 +1,6 @@
-.netTiers v2.2.0.696
-
+.netTiers v2.2.0.697
+01/17/2008
+ - [FIX] Bug fix 'capacity was less than the current size' in the EntityDropDownList.cs
01/16/2008
- [ENH] Multiple DataTextField support added to the EntityDropDownList control
- [ENH] Hyperlink control is enhanced to allow display of more fields when configured to use complex objects
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-01-16 20:27:23
|
Revision: 696
http://nettiers.svn.sourceforge.net/nettiers/?rev=696&view=rev
Author: mshatny
Date: 2008-01-16 12:27:27 -0800 (Wed, 16 Jan 2008)
Log Message:
-----------
[ENH] Multiple DataTextField support added to the EntityDropDownList control
[ENH] Hyperlink control is enhanced to allow display of more fields when configured to use complex objects
Modified Paths:
--------------
source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst
source/trunk/Source/WebLibrary/UI/HyperlinkField.cs.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst 2008-01-16 00:55:56 UTC (rev 695)
+++ source/trunk/Source/WebLibrary/UI/EntityDropDownList.cs.cst 2008-01-16 20:27:27 UTC (rev 696)
@@ -9,6 +9,7 @@
using System.Web.UI.WebControls;
using System.Text;
using System.ComponentModel;
+using System.Collections;
using <%=RootNameSpace%>;
#endregion
@@ -17,7 +18,7 @@
/// <summary>
/// A specialised Drop Down List that adds extra functionality to the base class.
/// Features include the ability to add a null item, make the control readonly,
- /// make the control required and it supports type ahead
+ /// make the control required, multiple datatext fields and it supports type ahead
/// </summary>
public class EntityDropDownList : DropDownList
{
@@ -72,6 +73,25 @@
}
/// <summary>
+ /// Gets or sets a value to the formatting string
+ /// </summary>
+ [Bindable(true),
+ Category("Appearance"),
+ DefaultValue(""), Description("Gets or sets a value to the formatting string")]
+ public string DataTextFieldFormatString
+ {
+ get
+ {
+ if (ViewState["DataTextFieldFormatString"] == null)
+ {
+ ViewState.Add("DataTextFieldFormatString", String.Empty);
+ }
+ return (string)ViewState["DataTextFieldFormatString"];
+ }
+ set { ViewState["DataTextFieldFormatString"] = value; }
+ }
+
+ /// <summary>
/// Gets or sets a value indicating whether this control is read only.
/// </summary>
/// <value><c>true</c> if [read only]; otherwise, <c>false</c>.</value>
@@ -268,7 +288,7 @@
}
}
- /// <summary>
+ /// <summary>
/// Raises the <see cref="E:System.Web.UI.Control.DataBinding"></see> event.
/// </summary>
/// <param name="e">An <see cref="T:System.EventArgs"></see> object that contains the event data.</param>
@@ -280,12 +300,133 @@
nullItem.Value = string.Empty;
base.Items.Add( nullItem );
}
-
- base.OnDataBinding( e );
+ Object source;
+ if (this.DataSource == null)
+ source = (Object)NamingContainer.FindControl(DataSourceID);
+ else
+ source = this.DataSource;
+
+ IEnumerable resolvedDataSource = GetResolvedDataSource(source, this.DataMember);
+ if (resolvedDataSource != null)
+ {
+ string dataTextField = DataTextField;
+ string dataValueField = DataValueField;
+ if (AppendNullItem)
+ {
+ for (int i = this.Items.Count - 1; i > 0; i--)
+ {
+ ListItem li = this.Items[i];
+ this.Items.Remove(li);
+ }
+ }
+ else
+ {
+ Items.Clear();
+ }
+ ICollection rdsCollection = (ICollection)resolvedDataSource;
+ if (rdsCollection != null)
+ {
+ Items.Capacity = rdsCollection.Count;
+ }
+ bool valid = ((dataTextField.Length >= 0) && (dataValueField.Length >= 0));
+
+ foreach (Object current in resolvedDataSource)
+ {
+
+ ListItem li = new ListItem();
+ if (valid)
+ {
+ if (dataTextField.Length >= 0)
+ {
+ string[] fields = dataTextField.Split(',');
+ string temp = string.Empty;
+ if (!String.IsNullOrEmpty(this.DataTextFieldFormatString))
+ {
+ int j = 0;
+ foreach (String s in fields)
+ {
+ temp += DataBinder.GetPropertyValue(current, s.Trim(), null);
+
+ if (j < fields.Length-1)
+ temp += "~~~";
+ j++;
+ }
+ fields = System.Text.RegularExpressions.Regex.Split(temp, "~~~");
+ li.Text = string.Format(this.DataTextFieldFormatString, fields);
+ }
+ else
+ {
+ li.Text = DataBinder.GetPropertyValue(current, dataTextField, null);
+ }
+ }
+ if (dataValueField.Length >= 0)
+ {
+ li.Value = DataBinder.GetPropertyValue(current, dataValueField, null);
+ }
+ }
+ else
+ {
+ li.Text = dataTextField.ToString();
+ li.Value = dataValueField.ToString();
+ }
+ Items.Add(li);
+ }
+ }
}
/// <summary>
+ /// Helper method to cast datasource object
+ /// to IEnumerable
+ /// </summary>
+ private System.Collections.IEnumerable GetResolvedDataSource(object source, string member)
+ {
+ if (source != null && (source is IListSource || source is Web.Data.IListDataSource))
+ {
+ if (source is Web.Data.IListDataSource)
+ {
+ Web.Data.IListDataSource listT = (Web.Data.IListDataSource)source;
+ return listT.GetEntityList();
+ }
+ IListSource src = (IListSource)source;
+ IList list = src.GetList();
+ if (!src.ContainsListCollection)
+ {
+ return list;
+ }
+ if (list != null && list is ITypedList)
+ {
+ ITypedList tlist = (ITypedList)list;
+ PropertyDescriptorCollection pdc = tlist.GetItemProperties(new PropertyDescriptor[0]);
+ if (pdc != null && pdc.Count > 0)
+ {
+ PropertyDescriptor pd = null;
+ if (member != null && member.Length > 0)
+ {
+ pd = pdc.Find(member, true);
+ }
+ else
+ {
+ pd = pdc[0];
+ }
+ if (pd != null)
+ {
+ object rv = pd.GetValue(list[0]);
+ if (rv != null && rv is IEnumerable)
+ {
+ return (IEnumerable)rv;
+ }
+ }
+ }
+ }
+ }
+ if (source is IEnumerable)
+ {
+ return (IEnumerable)source;
+ }
+ return null;
+ }
+ /// <summary>
/// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
/// </summary>
protected override void CreateChildControls()
@@ -406,15 +547,15 @@
}
}
- /// <summary>
- /// Calls the validate method on the embedded required validator if permitted
- /// </summary>
- public void Validate()
+ /// <summary>
+ /// Calls the validate method on the embedded required validator if permitted
+ /// </summary>
+ public void Validate()
+ {
+ if ( Required && requiredValidator != null )
{
- if ( Required && requiredValidator != null )
- {
- requiredValidator.Validate();
- }
+ requiredValidator.Validate();
}
- }
+ }
+ }
}
Modified: source/trunk/Source/WebLibrary/UI/HyperlinkField.cs.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/HyperlinkField.cs.cst 2008-01-16 00:55:56 UTC (rev 695)
+++ source/trunk/Source/WebLibrary/UI/HyperlinkField.cs.cst 2008-01-16 20:27:27 UTC (rev 696)
@@ -14,14 +14,15 @@
namespace <%=RootNameSpace%>.Web.UI
{
- /// <summary>
- /// Represents a field that is displayed as a hyperlink in a data-bound control. Supports complex objects via DataContainer property.
+/// <summary>
+ /// Represents a field that is displayed as a hyperlink in a data-bound control.
+ /// Supports complex objects via DataContainer property.
/// </summary>
public class HyperLinkField : DataControlField
{
#region class members
- PropertyDescriptor textProperty;
PropertyDescriptor[] urlProperties;
+ PropertyDescriptor[] dataTextFieldProperties;
static string[] emptyFields;
#endregion /* class members */
@@ -216,18 +217,18 @@
}
/// <summary>
- /// Virtual. Formats Url based using DataTextFormatString
+ /// Virtual. Formats Text using FormatDataTextValue
/// </summary>
- /// <param name="dataTextValue"></param>
+ /// <param name="dataTextValues"></param>
/// <returns></returns>
- protected virtual string FormatDataTextValue(object dataTextValue)
+ protected virtual string FormatDataTextValue(object[] dataTextValues)
{
- if (DataTextFormatString.Length > 0)
- return string.Format(DataTextFormatString, dataTextValue);
- else if (dataTextValue == null)
+ if (dataTextValues == null || dataTextValues.Length == 0)
return string.Empty;
+ else if (DataTextFormatString.Length > 0)
+ return string.Format(DataTextFormatString, dataTextValues);
else
- return dataTextValue.ToString();
+ return dataTextValues[0].ToString();
}
/// <summary>
@@ -247,16 +248,20 @@
{
//string[] values = DataTextField.Split(new char[] { '.' });
item = DataBinder.Eval(item, this.DataContainer);
- if (item == null) return;
+ if (item == null) return;
}
if (DataTextField.Length > 0)
{
- if (textProperty == null)
+ if (dataTextFieldProperties == null)
{
SetupProperties(item);
}
- link.Text = FormatDataTextValue(textProperty.GetValue(item));
+ object[] dataTextValues = new object[DataTextField.Split(',').Length];
+
+ for (int n = 0; n < dataTextValues.Length; n++)
+ dataTextValues[n] = dataTextFieldProperties[n].GetValue(item);
+ link.Text = FormatDataTextValue(dataTextValues);
}
string[] urlFields = DataNavigateUrlFields;
@@ -283,10 +288,19 @@
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(controlContainer);
if (DataTextField.Length > 0)
- {
- textProperty = props[DataTextField];
- if (textProperty == null)
- throw new InvalidOperationException(string.Format("Property '{0}' not found in object of type {1}", DataTextField, controlContainer.GetType()));
+ {
+ string[] dataFields = DataTextField.Split(',');
+ if (dataFields.Length > 0)
+ {
+ dataTextFieldProperties = new PropertyDescriptor[dataFields.Length];
+ for (int n = 0; n < dataFields.Length; n++)
+ {
+ PropertyDescriptor prop = props[dataFields[n]];
+ if (prop == null)
+ throw new InvalidOperationException(string.Format("Property '{0}' not found in object of type {1}", dataFields[n], controlContainer.GetType()));
+ dataTextFieldProperties[n] = prop;
+ }
+ }
}
string[] urlFields = DataNavigateUrlFields;
@@ -367,6 +381,6 @@
{
}
#endregion /* overrides */
- }
+ }
}
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-01-16 00:55:56 UTC (rev 695)
+++ source/trunk/Source/changes.log 2008-01-16 20:27:27 UTC (rev 696)
@@ -1,6 +1,8 @@
-.netTiers v2.2.0.695
+.netTiers v2.2.0.696
-
+01/16/2008
+ - [ENH] Multiple DataTextField support added to the EntityDropDownList control
+ - [ENH] Hyperlink control is enhanced to allow display of more fields when configured to use complex objects
01/15/2008
- [ENH] postHandlingAction is set to "NotifyRethrow" in the entlib.config file
- [ENH] SecurityContext.cs is now partial class
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-01-16 00:55:51
|
Revision: 695
http://nettiers.svn.sourceforge.net/nettiers/?rev=695&view=rev
Author: mshatny
Date: 2008-01-15 16:55:56 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
[ENH] postHandlingAction is set to "NotifyRethrow" in the entlib.config file
Modified Paths:
--------------
source/trunk/Source/VisualStudio/entlib.v2.config.cst
source/trunk/Source/VisualStudio/entlib.v3.config.cst
source/trunk/Source/VisualStudio/entlib.v3_1.config.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/VisualStudio/entlib.v2.config.cst
===================================================================
--- source/trunk/Source/VisualStudio/entlib.v2.config.cst 2008-01-15 22:16:01 UTC (rev 694)
+++ source/trunk/Source/VisualStudio/entlib.v2.config.cst 2008-01-16 00:55:56 UTC (rev 695)
@@ -67,7 +67,7 @@
<add name="NoneExceptionPolicy">
<exceptionTypes>
<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
- postHandlingAction="None" name="Exception">
+ postHandlingAction="NotifyRethrow" name="Exception">
<exceptionHandlers>
<add logCategory="Exceptions" eventId="100" severity="Error"
title="<%= NameSpace %> Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.XmlExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"
Modified: source/trunk/Source/VisualStudio/entlib.v3.config.cst
===================================================================
--- source/trunk/Source/VisualStudio/entlib.v3.config.cst 2008-01-15 22:16:01 UTC (rev 694)
+++ source/trunk/Source/VisualStudio/entlib.v3.config.cst 2008-01-16 00:55:56 UTC (rev 695)
@@ -64,7 +64,7 @@
<add name="NoneExceptionPolicy">
<exceptionTypes>
<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
- postHandlingAction="None" name="Exception">
+ postHandlingAction="NotifyRethrow" name="Exception">
<exceptionHandlers>
<add logCategory="Exceptions" eventId="100" severity="Error"
title="<%= NameSpace %> Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.XmlExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Modified: source/trunk/Source/VisualStudio/entlib.v3_1.config.cst
===================================================================
--- source/trunk/Source/VisualStudio/entlib.v3_1.config.cst 2008-01-15 22:16:01 UTC (rev 694)
+++ source/trunk/Source/VisualStudio/entlib.v3_1.config.cst 2008-01-16 00:55:56 UTC (rev 695)
@@ -64,7 +64,7 @@
<add name="NoneExceptionPolicy">
<exceptionTypes>
<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
- postHandlingAction="None" name="Exception">
+ postHandlingAction="NotifyRethrow" name="Exception">
<exceptionHandlers>
<add logCategory="Exceptions" eventId="100" severity="Error"
title="<%= NameSpace %> Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.XmlExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-01-15 22:16:01 UTC (rev 694)
+++ source/trunk/Source/changes.log 2008-01-16 00:55:56 UTC (rev 695)
@@ -1,7 +1,8 @@
-.netTiers v2.2.0.694
+.netTiers v2.2.0.695
01/15/2008
+ - [ENH] postHandlingAction is set to "NotifyRethrow" in the entlib.config file
- [ENH] SecurityContext.cs is now partial class
01/03/2008
- [ENH] Added support to VList to find distinct values using FindAllDistinct method (contrib Polar)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-01-15 22:15:58
|
Revision: 694
http://nettiers.svn.sourceforge.net/nettiers/?rev=694&view=rev
Author: mshatny
Date: 2008-01-15 14:16:01 -0800 (Tue, 15 Jan 2008)
Log Message:
-----------
[ENH] SecurityContext.cs is now partial class
Modified Paths:
--------------
source/trunk/Source/Components/SecurityContext.cst
source/trunk/Source/NetTiers.cst
source/trunk/Source/TemplateLib/CreateTemplates.cs
source/trunk/Source/TemplateLib/FrameworkTemplates.cst
source/trunk/Source/VisualStudio/vsnet2005.project.cst
source/trunk/Source/changes.log
Added Paths:
-----------
source/trunk/Source/Components/SecurityContextBase.cst
Modified: source/trunk/Source/Components/SecurityContext.cst
===================================================================
--- source/trunk/Source/Components/SecurityContext.cst 2008-01-03 17:46:30 UTC (rev 693)
+++ source/trunk/Source/Components/SecurityContext.cst 2008-01-15 22:16:01 UTC (rev 694)
@@ -26,103 +26,16 @@
/// The class that is available in case role based security is required at runtime.
/// It will be made availabe through the entities themselves.
/// </summary>
- public class SecurityContext<Entity> where Entity : IEntity, new()
- {
- #region Fields
- private object profile = null;
- private IIdentity identity = null;
- private IPrincipal principal = null;
- private IAuthorizationProvider ruleProvider = null;
- //private ISecurityCacheProvider securityCacheProvider = null;
- private static readonly string ruleProviderKey = "NetTiers.RuleProvider";
- private static object syncObject = new object();
- #endregion Fields
-
- #region Properties
- /// <summary>
- /// The Current IIdentity.
- /// </summary>
- public IIdentity Identity
- {
- get { return identity; }
- set { identity = value; }
- }
+ public partial class SecurityContext<Entity> : SecurityContextBase<Entity> where Entity : IEntity, new()
+ {
+ #region Constructors
- /// <summary>
- /// The Current Profile .
- /// </summary>
- public object Profile
- {
- get { return profile; }
- set { profile = value; }
- }
-
- /// <summary>
- /// The Current IPrincipal .
- /// </summary>
- public IPrincipal Principal
- {
- get { return principal; }
- set { principal = value; }
- }
+ ///<summary>
+ /// Creates a new <see cref="SecurityContext"/> instance.
+ ///</summary>
+ public SecurityContext() : base() { }
- /// <summary>
- /// The Current Authorization Rule Provider
- /// </summary>
- public IAuthorizationProvider RuleProvider
- {
- get{
- if (ruleProvider == null)
- {
- lock(syncObject)
- {
- ruleProvider = AuthorizationFactory.GetAuthorizationProvider(ruleProviderKey);
- }
- }
- return ruleProvider;
- }
- set
- {
- lock(syncObject)
- {
- ruleProvider = value;
- }
- }
- }
- #endregion Properties
-
- #region Constructors
- /// <summary>
- /// Initializes a new instance of the SecurityContext class.
- /// </summary>
- public SecurityContext()
- {
- this.Identity = System.Threading.Thread.CurrentPrincipal.Identity;
- this.Principal = System.Threading.Thread.CurrentPrincipal;
- }
- #endregion Constructors
-
- #region Public methods
- /// <summary>
- /// Determine whether user is authorized for the rule based on the rule provider
- /// </summary>
- public bool IsAuthorized(string ruleToCheck)
- {
- try
- {
- if (ConnectionScope.Current.DataProvider.EnableMethodAuthorization)
- {
- return RuleProvider.Authorize(Principal, string.Format("{0}.{1}", typeof(Entity).FullName , ruleToCheck));
- }
- }
- catch ( Exception )
- {
- //Method has yet to be configured in config file
- //throw;
- }
-
- return true;
- }
- #endregion Public methods
- }
+ #endregion
+
+ }
}
Added: source/trunk/Source/Components/SecurityContextBase.cst
===================================================================
--- source/trunk/Source/Components/SecurityContextBase.cst (rev 0)
+++ source/trunk/Source/Components/SecurityContextBase.cst 2008-01-15 22:16:01 UTC (rev 694)
@@ -0,0 +1,128 @@
+<%@ CodeTemplate Src="..\TemplateLib\CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Language="C#" TargetLanguage="C#" Description="The interface that each business object of the domain implements." ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
+<%@ Assembly Name="SchemaExplorer" %>
+<%@ Import Namespace="SchemaExplorer" %>
+<%@ Assembly Name="System.Design" %>
+
+<%@ Property Name="NameSpace" Optional="False" Type="System.String" Category="Style" Description="Object Namespace." %>
+<%@ Property Name="BLLNameSpace" Optional="False" Type="System.String" Category="Style" Description="Object Namespace." %>
+<%@ Property Name="DALNameSpace" Optional="False" Type="System.String" Category="Style" Description="Object Namespace." %>
+<%@ Assembly Name="SchemaExplorer" %>
+#region Using directives
+using System;
+using System.ComponentModel;
+using System.Security;
+using System.Web.Security;
+using System.Security.Principal;
+using System.Web.Profile;
+using <%= BLLNameSpace %>;
+using <%= DALNameSpace %>;
+
+using Microsoft.Practices.EnterpriseLibrary.Security;
+#endregion Using directives
+
+namespace <%=NameSpace%>
+{
+ /// <summary>
+ /// The class that is available in case role based security is required at runtime.
+ /// It will be made availabe through the entities themselves.
+ /// </summary>
+ public partial class SecurityContextBase<Entity> where Entity : IEntity, new()
+ {
+ #region Fields
+ private object profile = null;
+ private IIdentity identity = null;
+ private IPrincipal principal = null;
+ private IAuthorizationProvider ruleProvider = null;
+ //private ISecurityCacheProvider securityCacheProvider = null;
+ private static readonly string ruleProviderKey = "NetTiers.RuleProvider";
+ private static object syncObject = new object();
+ #endregion Fields
+
+ #region Properties
+ /// <summary>
+ /// The Current IIdentity.
+ /// </summary>
+ public virtual IIdentity Identity
+ {
+ get { return identity; }
+ set { identity = value; }
+ }
+
+ /// <summary>
+ /// The Current Profile .
+ /// </summary>
+ public virtual object Profile
+ {
+ get { return profile; }
+ set { profile = value; }
+ }
+
+ /// <summary>
+ /// The Current IPrincipal .
+ /// </summary>
+ public virtual IPrincipal Principal
+ {
+ get { return principal; }
+ set { principal = value; }
+ }
+
+ /// <summary>
+ /// The Current Authorization Rule Provider
+ /// </summary>
+ public IAuthorizationProvider RuleProvider
+ {
+ get{
+ if (ruleProvider == null)
+ {
+ lock(syncObject)
+ {
+ ruleProvider = AuthorizationFactory.GetAuthorizationProvider(ruleProviderKey);
+ }
+ }
+ return ruleProvider;
+ }
+ set
+ {
+ lock(syncObject)
+ {
+ ruleProvider = value;
+ }
+ }
+ }
+ #endregion Properties
+
+ #region Constructors
+ /// <summary>
+ /// Initializes a new instance of the SecurityContext class.
+ /// </summary>
+ public SecurityContextBase()
+ {
+ this.Identity = System.Threading.Thread.CurrentPrincipal.Identity;
+ this.Principal = System.Threading.Thread.CurrentPrincipal;
+ }
+ #endregion Constructors
+
+ #region Public methods
+ /// <summary>
+ /// Determine whether user is authorized for the rule based on the rule provider
+ /// </summary>
+ public virtual bool IsAuthorized(string ruleToCheck)
+ {
+ try
+ {
+ if (ConnectionScope.Current.DataProvider.EnableMethodAuthorization)
+ {
+ return RuleProvider.Authorize(Principal, string.Format("{0}.{1}", typeof(Entity).FullName , ruleToCheck));
+ }
+ }
+ catch ( Exception )
+ {
+ //Method has yet to be configured in config file
+ //throw;
+ }
+
+ return true;
+ }
+ #endregion Public methods
+ }
+}
Modified: source/trunk/Source/NetTiers.cst
===================================================================
--- source/trunk/Source/NetTiers.cst 2008-01-03 17:46:30 UTC (rev 693)
+++ source/trunk/Source/NetTiers.cst 2008-01-15 22:16:01 UTC (rev 694)
@@ -1365,11 +1365,23 @@
#region Components - Singe File Copy Overs
if (ComponentPattern != MoM.Templates.ComponentPatternType.None)
{
- XmlElement iSecurityContextNode = AddFileNode(commonNode, "SecurityContext.cs");
- this.GetTemplate("SecurityContext.cst").SetProperty("NameSpace", ComponentsNameSpace);
- this.GetTemplate("SecurityContext.cst").SetProperty("BLLNameSpace", BLLNameSpace);
- this.GetTemplate("SecurityContext.cst").SetProperty("DALNameSpace", DALNameSpace);
- this.RenderToFile("SecurityContext.cst", rootPathComponents + "\\SecurityContext.cs", true);
+ //----------------------------------------------------------------------------------------------------------------------------------------------
+ //-- SecurityContext file - generated only once
+ //----------------------------------------------------------------------------------------------------------------------------------------------
+ if (!File.Exists(rootPathComponents + "\\SecurityContext.cs"))
+ {
+ XmlElement iSecurityContextNode = AddFileNode(commonNode, "SecurityContext.cs");
+ this.GetTemplate("SecurityContext.cst").SetProperty("NameSpace", ComponentsNameSpace);
+ this.GetTemplate("SecurityContext.cst").SetProperty("BLLNameSpace", BLLNameSpace);
+ this.GetTemplate("SecurityContext.cst").SetProperty("DALNameSpace", DALNameSpace);
+ this.RenderToFile("SecurityContext.cst", rootPathComponents + "\\SecurityContext.cs", true);
+ }
+
+ XmlElement iSecurityContextBaseNode = AddFileNode(commonNode, "SecurityContextBase.generated.cs");
+ this.GetTemplate("SecurityContextBase.cst").SetProperty("NameSpace", ComponentsNameSpace);
+ this.GetTemplate("SecurityContextBase.cst").SetProperty("BLLNameSpace", BLLNameSpace);
+ this.GetTemplate("SecurityContextBase.cst").SetProperty("DALNameSpace", DALNameSpace);
+ this.RenderToFile("SecurityContextBase.cst", rootPathComponents + "\\SecurityContextBase.generated.cs", true);
XmlElement contextViewNode = AddFileNode(commonNode, "ContextView.cs");
this.GetTemplate("ContextView.cst").SetProperty("NameSpace", ComponentsNameSpace);
Modified: source/trunk/Source/TemplateLib/CreateTemplates.cs
===================================================================
--- source/trunk/Source/TemplateLib/CreateTemplates.cs 2008-01-03 17:46:30 UTC (rev 693)
+++ source/trunk/Source/TemplateLib/CreateTemplates.cs 2008-01-15 22:16:01 UTC (rev 694)
@@ -89,6 +89,7 @@
CodeTemplates.Add("ProcessorBase.cst", base.CreateTemplate<ProcessorBase>()); this.PerformStep();
CodeTemplates.Add("GenericProcessorResult.cst", base.CreateTemplate<GenericProcessorResult>()); this.PerformStep();
CodeTemplates.Add("SecurityContext.cst", base.CreateTemplate<SecurityContext>()); this.PerformStep();
+ CodeTemplates.Add("SecurityContextBase.cst", base.CreateTemplate<SecurityContextBase>()); this.PerformStep();
CodeTemplates.Add("ContextView.cst", base.CreateTemplate<ContextView>()); this.PerformStep();
CodeTemplates.Add("DataRepository.cst", base.CreateTemplate<DataRepository>()); this.PerformStep();
Modified: source/trunk/Source/TemplateLib/FrameworkTemplates.cst
===================================================================
--- source/trunk/Source/TemplateLib/FrameworkTemplates.cst 2008-01-03 17:46:30 UTC (rev 693)
+++ source/trunk/Source/TemplateLib/FrameworkTemplates.cst 2008-01-15 22:16:01 UTC (rev 694)
@@ -87,6 +87,7 @@
<%@ Register Name="ProcessorBase" Template="../Components/Processors/ProcessorBase.cst" MergeProperties="False" ExcludeProperties="" %>
<%@ Register Name="GenericProcessorResult" Template="../Components/Processors/GenericProcessorResult.cst" MergeProperties="False" ExcludeProperties="" %>
<%@ Register Name="SecurityContext" Template="../Components/SecurityContext.cst" MergeProperties="False" ExcludeProperties="" %>
+<%@ Register Name="SecurityContextBase" Template="../Components/SecurityContextBase.cst" MergeProperties="False" ExcludeProperties="" %>
<%@ Register Name="ContextView" Template="../Components/ContextView.cst" MergeProperties="False" ExcludeProperties="" %>
<%@ Register Name="DataRepository" Template="../DataAccessLayer/DataRepository.cst" MergeProperties="False" ExcludeProperties="" %>
Modified: source/trunk/Source/VisualStudio/vsnet2005.project.cst
===================================================================
--- source/trunk/Source/VisualStudio/vsnet2005.project.cst 2008-01-03 17:46:30 UTC (rev 693)
+++ source/trunk/Source/VisualStudio/vsnet2005.project.cst 2008-01-15 22:16:01 UTC (rev 694)
@@ -828,7 +828,11 @@
<Compile Include="<%=ComponentsSubFolder%>SecurityContext.cs">
<SubType>Code</SubType>
- </Compile>
+ </Compile>
+ <Compile Include="<%=ComponentsSubFolder%>SecurityContextBase.generated.cs">
+ <DependentUpon>SecurityContext.cs</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
<Compile Include="<%=ComponentsSubFolder%>ContextView.cs">
<SubType>Code</SubType>
</Compile>
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2008-01-03 17:46:30 UTC (rev 693)
+++ source/trunk/Source/changes.log 2008-01-15 22:16:01 UTC (rev 694)
@@ -1,5 +1,8 @@
-.netTiers v2.2.0.693
+.netTiers v2.2.0.694
+
+01/15/2008
+ - [ENH] SecurityContext.cs is now partial class
01/03/2008
- [ENH] Added support to VList to find distinct values using FindAllDistinct method (contrib Polar)
12/21/2007
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2008-01-03 17:46:27
|
Revision: 693
http://nettiers.svn.sourceforge.net/nettiers/?rev=693&view=rev
Author: mshatny
Date: 2008-01-03 09:46:30 -0800 (Thu, 03 Jan 2008)
Log Message:
-----------
[ENH] Added support to VList to find distinct values using FindAllDistinct method (contrib Polar)
Modified Paths:
--------------
source/trunk/Source/Entities/Views/VList.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/Entities/Views/VList.cst
===================================================================
--- source/trunk/Source/Entities/Views/VList.cst 2007-12-21 10:51:14 UTC (rev 692)
+++ source/trunk/Source/Entities/Views/VList.cst 2008-01-03 17:46:30 UTC (rev 693)
@@ -1,4 +1,4 @@
-<%--
+ <%--
* $Id: VList.cst,v 1.2 2006/02/27 22:09:41 bgjohnso Exp $
* Last modified by $Author: jroland $
* Last modified at $Date: 2006-03-16 16:53:08 -0600 (Thu, 16 Mar 2006) $
@@ -328,6 +328,57 @@
Contains
}
#endregion Find All By
+
+ #region Find All Distinct
+ /// <summary>
+ /// Finds all distinct elements for the specified column
+ /// </summary>
+ /// <param name="column">The column.</param>
+ /// <returns></returns>
+ public virtual VList<T> FindAllDistinct(Enum column)
+ {
+ return FindAllDistinct(column.ToString());
+ }
+ /// <summary>
+ /// Finds all distinct elements for the specified column
+ /// </summary>
+ /// <param name="columnName">Name of the column.</param>
+ /// <returns></returns>
+ public virtual VList<T> FindAllDistinct(string columnName)
+ {
+ PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(T));
+ PropertyDescriptor filterBy = props.Find(columnName, true);
+ VList<T> result = new VList<T>();
+
+ object a;
+ object b;
+ bool found;
+
+ foreach (T item in this)
+ {
+ a = filterBy.GetValue(item);
+ found = false;
+
+ foreach (T item2 in result)
+ {
+ b = filterBy.GetValue(item2);
+ if ((a == null && b == null) ||
+ (a != null && b != null && a.Equals(b)))
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ {
+ result.Add(item);
+ }
+ }
+
+ return result;
+ }
+ #endregion Find All Distinct
#endregion Find
}
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2007-12-21 10:51:14 UTC (rev 692)
+++ source/trunk/Source/changes.log 2008-01-03 17:46:30 UTC (rev 693)
@@ -1,4 +1,7 @@
-.netTiers v2.2.0.692
+.netTiers v2.2.0.693
+
+01/03/2008
+ - [ENH] Added support to VList to find distinct values using FindAllDistinct method (contrib Polar)
12/21/2007
- [ENH] Enhance MultiFormView so that it does not try to load template at design time (which can cause other design time problems)
- [ENH] Reorder actions in Save/DeepSave so that deletes are done first (see http://community.codesmithtools.com/forums/p/7227/28830.aspx#28830) (contrib dsaunders)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2007-12-21 10:51:11
|
Revision: 692
http://nettiers.svn.sourceforge.net/nettiers/?rev=692&view=rev
Author: swin66
Date: 2007-12-21 02:51:14 -0800 (Fri, 21 Dec 2007)
Log Message:
-----------
[ENH] Updated ExecuteUpdate to load entity as per data source settings (required when DeepSave is done after DeepLoad) (contrib AntonC)
Modified Paths:
--------------
source/trunk/Source/WebLibrary/Data/BaseDataSource.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/WebLibrary/Data/BaseDataSource.cst
===================================================================
--- source/trunk/Source/WebLibrary/Data/BaseDataSource.cst 2007-12-21 08:37:31 UTC (rev 691)
+++ source/trunk/Source/WebLibrary/Data/BaseDataSource.cst 2007-12-21 10:51:14 UTC (rev 692)
@@ -1,4 +1,4 @@
-<%@ CodeTemplate Language="C#" TargetLanguage="C#" Src="..\..\TemplateLib\CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Debug="False" Description="Generates the BaseDataSource type." ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002" %>
+<%@ CodeTemplate Language="C#" TargetLanguage="C#" Src="..\..\TemplateLib\CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Debug="False" Description="Generates the BaseDataSource type." ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002" %>
<%@ Property Name="BLLNameSpace" Optional="False" Type="System.String" Category="Style" Description="Object Namespace." %>
<%@ Property Name="DALNameSpace" Optional="False" Type="System.String" Category="Style" Description="DAL Namespace." %>
<%@ Property Name="WebNameSpace" Optional="False" Type="System.String" Category="Style" Description="Web Namespace." %>
@@ -1615,7 +1615,10 @@
return 0;
}
- IList<Entity> entityList = GetEntityList();
+ //IList<Entity> entityList = GetEntityList();
+ // causes the overridde ProviderDataSource.OnSelected to fire, enabling DeepLoad on updates
+ IList<Entity> entityList = Owner.Select();
+
Entity entity = GetCurrentEntity(entityList, keys);
int count = 0;
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2007-12-21 08:37:31 UTC (rev 691)
+++ source/trunk/Source/changes.log 2007-12-21 10:51:14 UTC (rev 692)
@@ -1,7 +1,8 @@
-.netTiers v2.2.0.691
+.netTiers v2.2.0.692
12/21/2007
- [ENH] Enhance MultiFormView so that it does not try to load template at design time (which can cause other design time problems)
- [ENH] Reorder actions in Save/DeepSave so that deletes are done first (see http://community.codesmithtools.com/forums/p/7227/28830.aspx#28830) (contrib dsaunders)
+ - [ENH] Updated ExecuteUpdate to load entity as per data source settings (required when DeepSave is done after DeepLoad) (contrib AntonC)
12/20/2007
- [FIX] Correct stack overflow exception and invalid cast exception in equals method (contrib brianb)
- [ENH] New property to allow EntityUtil to use DateTime.UtcNow or DateTime.Now (default) (contrib dsaunders)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2007-12-21 08:37:35
|
Revision: 691
http://nettiers.svn.sourceforge.net/nettiers/?rev=691&view=rev
Author: swin66
Date: 2007-12-21 00:37:31 -0800 (Fri, 21 Dec 2007)
Log Message:
-----------
[ENH] Enhance MultiFormView so that it does not try to load template at design time (which can cause other design time problems)
[ENH] Reorder actions in Save/DeepSave so that deletes are done first (see http://community.codesmithtools.com/forums/p/7227/28830.aspx#28830) (contrib dsaunders)
Modified Paths:
--------------
source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst
source/trunk/Source/WebLibrary/UI/MultiFormView.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst
===================================================================
--- source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst 2007-12-20 16:36:47 UTC (rev 690)
+++ source/trunk/Source/DataAccessLayer/Bases/EntityProviderBaseCoreClass.generated.cst 2007-12-21 08:37:31 UTC (rev 691)
@@ -1,4 +1,4 @@
-<%@ CodeTemplate Language="C#" TargetLanguage="C#" Src="..\..\TemplateLib\CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Debug="False" Description="Generates the EntityProviderBaseCore type." ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
+<%@ CodeTemplate Language="C#" TargetLanguage="C#" Src="..\..\TemplateLib\CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Debug="False" Description="Generates the EntityProviderBaseCore type." ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
<%@ Property Name="BLLNameSpace" Optional="False" Type="System.String" Category="Style" Description="Object Namespace." %>
<%@ Property Name="DALNameSpace" Optional="False" Type="System.String" Category="Style" Description="DAL Namespace." %>
@@ -620,16 +620,21 @@
/// <param name="entities"><%=listName%> of Entity objects to save.</param>
public virtual <%=listName%><Entity> <%= MethodNames.Save %>(TransactionManager mgr, <%=listName%><Entity> entities)
{
- foreach ( Entity entity in entities )
+ foreach ( Entity entity in entities.DeletedItems )
{
- <%= MethodNames.Save %>(mgr, entity);
+ <%= MethodNames.Delete %>(mgr, entity);
}
- foreach ( Entity entity in entities.DeletedItems )
+ foreach ( Entity entity in entities )
{
- <%= MethodNames.Delete %>(mgr, entity);
+ if (!entity.IsNew) <%= MethodNames.Save %>(mgr, entity);
}
+ foreach ( Entity entity in entities )
+ {
+ if (entity.IsNew) <%= MethodNames.Save %>(mgr, entity);
+ }
+
// Clear the items to delete list.
entities.DeletedItems.Clear();
return entities;
@@ -1211,22 +1216,37 @@
}
}
+ foreach ( Entity entity in entities.DeletedItems )
+ {
+ result = <%= MethodNames.DeepSave %>(mgr, entity, deepSaveType, childTypes, innerList);
+ if ( !result )
+ {
+ deepSaveResult = false;
+ }
+ }
+
foreach ( Entity entity in entities )
{
+ if (!entity.IsNew)
+ {
result = <%= MethodNames.DeepSave %>(mgr, entity, deepSaveType, childTypes, innerList);
if ( !result )
{
- deepSaveResult = false;
+ deepSaveResult = false;
}
+ }
}
- foreach ( Entity entity in entities.DeletedItems )
+ foreach ( Entity entity in entities )
{
+ if (entity.IsNew)
+ {
result = <%= MethodNames.DeepSave %>(mgr, entity, deepSaveType, childTypes, innerList);
if ( !result )
{
- deepSaveResult = false;
+ deepSaveResult = false;
}
+ }
}
entities.DeletedItems.Clear();
Modified: source/trunk/Source/WebLibrary/UI/MultiFormView.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/MultiFormView.cst 2007-12-20 16:36:47 UTC (rev 690)
+++ source/trunk/Source/WebLibrary/UI/MultiFormView.cst 2007-12-21 08:37:31 UTC (rev 691)
@@ -1,4 +1,4 @@
-<%--
+<%--
* $Id: MultiFormView.cst,v 1.0 2006/03/19 10:00:00 bdiaz Exp $
* Last modified by $Author: bdiaz $
* Last modified at $Date: 2006-03-19 10:00:00 -0600 (Sun, 19 Mar 2006) $
@@ -204,7 +204,11 @@
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
- InitTemplates();
+
+ if ( !this.DesignMode )
+ {
+ InitTemplates();
+ }
}
/// <summary>
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2007-12-20 16:36:47 UTC (rev 690)
+++ source/trunk/Source/changes.log 2007-12-21 08:37:31 UTC (rev 691)
@@ -1,4 +1,7 @@
-.netTiers v2.2.0.690
+.netTiers v2.2.0.691
+12/21/2007
+ - [ENH] Enhance MultiFormView so that it does not try to load template at design time (which can cause other design time problems)
+ - [ENH] Reorder actions in Save/DeepSave so that deletes are done first (see http://community.codesmithtools.com/forums/p/7227/28830.aspx#28830) (contrib dsaunders)
12/20/2007
- [FIX] Correct stack overflow exception and invalid cast exception in equals method (contrib brianb)
- [ENH] New property to allow EntityUtil to use DateTime.UtcNow or DateTime.Now (default) (contrib dsaunders)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2007-12-20 16:36:42
|
Revision: 690
http://nettiers.svn.sourceforge.net/nettiers/?rev=690&view=rev
Author: swin66
Date: 2007-12-20 08:36:47 -0800 (Thu, 20 Dec 2007)
Log Message:
-----------
[ENH] Added new method GetOriginalEntity to EntityInstanceBase to allow original data to be retrieved (contrib vbandrade)
Modified Paths:
--------------
source/trunk/Source/Entities/EntityInstanceBase.generated.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/Entities/EntityInstanceBase.generated.cst
===================================================================
--- source/trunk/Source/Entities/EntityInstanceBase.generated.cst 2007-12-20 15:44:52 UTC (rev 689)
+++ source/trunk/Source/Entities/EntityInstanceBase.generated.cst 2007-12-20 16:36:47 UTC (rev 690)
@@ -724,7 +724,7 @@
/// Determines whether the data has changed from original.
/// </summary>
/// <returns>
- /// <c>true</c> if [has data changed]; otherwise, <c>false</c>.
+ /// <c>true</c> if data has changed; otherwise, <c>false</c>.
/// </returns>
public bool HasDataChanged()
{
@@ -733,8 +733,25 @@
result = result || entityData.<%=GetPropertyName(cols[x])%> != _originalData.<%=GetPropertyName(cols[x])%>;
<% } %>
return result;
-}
+ }
+ ///<summary>
+ /// Returns a <%=className%> Entity with the original data.
+ ///</summary>
+ public <%=className%> GetOriginalEntity()
+ {
+ if (_originalData != null)
+ return Create<%=className%>(
+ <%
+ for (int i = 0;i < colsUpdatable.Count; i++)
+ {%>
+ _originalData.<%=GetPropertyName(colsUpdatable[i])%><%if (i < colsUpdatable.Count-1){%>,<%}%>
+ <%}
+ %>
+ );
+
+ return (<%=className%>)this.Clone();
+ }
#endregion
<% if(EqualitySemantics == MoM.Templates.EqualitySemantics.Value) {%>
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2007-12-20 15:44:52 UTC (rev 689)
+++ source/trunk/Source/changes.log 2007-12-20 16:36:47 UTC (rev 690)
@@ -1,7 +1,8 @@
-.netTiers v2.2.0.689
+.netTiers v2.2.0.690
12/20/2007
- [FIX] Correct stack overflow exception and invalid cast exception in equals method (contrib brianb)
- [ENH] New property to allow EntityUtil to use DateTime.UtcNow or DateTime.Now (default) (contrib dsaunders)
+ - [ENH] Added new method GetOriginalEntity to EntityInstanceBase to allow original data to be retrieved (contrib vbandrade)
12/19/2007
- [ENH] New ValidationType property to allow validation to be done by either NetTiers (default) or new EntLib validation (contrib katokay)
- [ENH] Added Support in the EntityGridView for EntityDataSource
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2007-12-20 15:44:51
|
Revision: 689
http://nettiers.svn.sourceforge.net/nettiers/?rev=689&view=rev
Author: swin66
Date: 2007-12-20 07:44:52 -0800 (Thu, 20 Dec 2007)
Log Message:
-----------
[ENH] New property to allow EntityUtil to use DateTime.UtcNow or DateTime.Now (default) (contrib dsaunders)
Modified Paths:
--------------
source/trunk/Source/Entities/EntityUtil.cst
source/trunk/Source/NetTiers.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/Entities/EntityUtil.cst
===================================================================
--- source/trunk/Source/Entities/EntityUtil.cst 2007-12-20 08:06:24 UTC (rev 688)
+++ source/trunk/Source/Entities/EntityUtil.cst 2007-12-20 15:44:52 UTC (rev 689)
@@ -1,4 +1,4 @@
-<%--
+<%--
* $Id: EntityDataSource.cst,v 1.0 2006/03/19 01:00:00 bdiaz Exp $
* Last modified by $Author: bdiaz $
* Last modified at $Date: 2006-03-19 01:00:00 -0600 (Sun, 19 Mar 2006) $
@@ -7,7 +7,9 @@
<%@ CodeTemplate Language="C#" TargetLanguage="C#" Src="" Inherits="" Debug="False" Description="Generates the EntityUtil class." ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002" %>
<%@ Property Name="NameSpace" Optional="False" Type="System.String" Category="Style" Description="BLL Namespace." %>
+<%@ Property Name="TimeStandard" Type="TimeStandardEnum" Default="UTC" Category="02. Framework Generation - Optional" Description="Standard used for generating DateTime values. If 'UTC' DateTime is generated based on UtcNow. If 'Local' DateTime is generated based on DateTime.Now" %>
+
<%@ Assembly Name="System.Data" %>
<%@ Import Namespace="System.Data" %>
#region Using Directives
@@ -457,7 +459,11 @@
if ( prop != null && prop.CanWrite && prop.PropertyType.IsAssignableFrom(typeof(DateTime)) )
{
- prop.SetValue(entity, DateTime.Now, null);
+ <% if ( TimeStandard == TimeStandardEnum.Utc ) { %>
+ prop.SetValue(entity, DateTime.UtcNow, null);
+ <% } else { %>
+ prop.SetValue(entity, DateTime.Now, null);
+ <% } // end if ( IncludeFind ) %>
}
}
}
Modified: source/trunk/Source/NetTiers.cst
===================================================================
--- source/trunk/Source/NetTiers.cst 2007-12-20 08:06:24 UTC (rev 688)
+++ source/trunk/Source/NetTiers.cst 2007-12-20 15:44:52 UTC (rev 689)
@@ -1,4 +1,4 @@
-<%@ CodeTemplate Src="TemplateLib/CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Language="C#" TargetLanguage="Text" Description="NetTiers main template." Debug="True" ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
+<%@ CodeTemplate Src="TemplateLib/CommonSqlCode.cs" Inherits="MoM.Templates.CommonSqlCode" Language="C#" TargetLanguage="Text" Description="NetTiers main template." Debug="True" ResponseEncoding="UTF-8" NoWarn="0108,0618,1572,1573,1574,0162,2002"%>
<%@ Assembly Name="SchemaExplorer" %>
<%@ Assembly Name="System.Design" %>
<%@ Assembly Name="System.DirectoryServices" %>
@@ -34,6 +34,7 @@
<%@ Property Name="IncludeXmlAttributes" Type="System.Boolean" Default="False" Category="02. Framework Generation - Optional" Description="Indicates if the Xml attributes, [XmlElement(IsNullable=true)], should be included on the entity classes." %>
<%@ Property Name="CustomCodeFolderName" Type="System.String" Category="02. Framework Generation - Optional" Description="If specified, indicates the name of a folder that can contains custom classes to dynamically add to each project." Default="App_Code" %>
<%@ Property Name="EqualitySemantics" Type="MoM.Templates.EqualitySemantics" Default="Value" Category="02. Framework Generation - Optional" Description="Equality semantics used for Entity instances. If 'Reference', default reference type semantics will be used (based on object identity). If 'Value', Equals() and GetHashCode() will be overridden to use value semantics (based on object contents)." %>
+<%@ Property Name="TimeStandard" Type="TimeStandardEnum" Default="Local" Category="02. Framework Generation - Optional" Description="Standard used for generating DateTime values. If 'UTC' DateTime is generated based on UtcNow. If 'Local' DateTime is generated based on DateTime.Now" %>
<%-- 3. Namespaces Category --%>
<%@ Property Name="BusinessLogicLayerNameSpace" Type="System.String" Category="03. Namespaces - Required" Description="The sub namespace that is added to the root namespace for the entities." Default="Entities" Optional="False" %>
@@ -571,6 +572,13 @@
Entity,
All
}
+
+ public enum TimeStandardEnum
+ {
+ Utc,
+ Local
+ }
+
#endregion Enums
</script>
@@ -2911,6 +2919,7 @@
//----------------------------------------------------------------------------------------------------------------------------------------------
XmlElement entityUtilNode = AddFileNode(commonNode, "EntityUtil.cs");
this.GetTemplate("EntityUtil.cst").SetProperty("NameSpace", BLLNameSpace);
+ this.GetTemplate("EntityUtil.cst").SetProperty("TimeStandard", TimeStandard);
this.GetTemplate("EntityUtil.cst").RenderToFile(rootPathBLL + "\\EntityUtil.cs", true);
//AddExecutionTime(entityUtilNode);
//----------------------------------------------------------------------------------------------------------------------------------------------
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2007-12-20 08:06:24 UTC (rev 688)
+++ source/trunk/Source/changes.log 2007-12-20 15:44:52 UTC (rev 689)
@@ -1,6 +1,7 @@
-.netTiers v2.2.0.688
+.netTiers v2.2.0.689
12/20/2007
- [FIX] Correct stack overflow exception and invalid cast exception in equals method (contrib brianb)
+ - [ENH] New property to allow EntityUtil to use DateTime.UtcNow or DateTime.Now (default) (contrib dsaunders)
12/19/2007
- [ENH] New ValidationType property to allow validation to be done by either NetTiers (default) or new EntLib validation (contrib katokay)
- [ENH] Added Support in the EntityGridView for EntityDataSource
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sw...@us...> - 2007-12-20 08:06:20
|
Revision: 688
http://nettiers.svn.sourceforge.net/nettiers/?rev=688&view=rev
Author: swin66
Date: 2007-12-20 00:06:24 -0800 (Thu, 20 Dec 2007)
Log Message:
-----------
[FIX] Correct stack overflow exception and invalid cast exception in equals method (contrib brianb)
Modified Paths:
--------------
source/trunk/Source/Entities/EntityData.cst
source/trunk/Source/Entities/EntityInstanceBase.generated.cst
source/trunk/Source/Entities/IEntity.cst
source/trunk/Source/Entities/ListBase.cst
source/trunk/Source/Entities/TList.cst
source/trunk/Source/TemplateLib/CommonSqlCode.cs
source/trunk/Source/changes.log
Modified: source/trunk/Source/Entities/EntityData.cst
===================================================================
--- source/trunk/Source/Entities/EntityData.cst 2007-12-20 02:54:22 UTC (rev 687)
+++ source/trunk/Source/Entities/EntityData.cst 2007-12-20 08:06:24 UTC (rev 688)
@@ -30,7 +30,7 @@
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
[Serializable]
- internal protected class <%=structName%> : ICloneable
+ internal protected class <%=structName%> : ICloneable, ICloneableEx
{
#region Variable Declarations
private EntityState currentEntityState = EntityState.Added;
@@ -191,6 +191,81 @@
return _tmp;
}
+ /// <summary>
+ /// Creates a new object that is a copy of the current instance.
+ /// </summary>
+ /// <returns>A new object that is a copy of this instance.</returns>
+ public object Clone(IDictionary existingCopies)
+ {
+ if (existingCopies == null)
+ existingCopies = new Hashtable();
+
+ <%=structName%> _tmp = new <%=structName%>();
+
+ <% for(int i=0; i<SourceTable.PrimaryKey.MemberColumns.Count; i++) { %>
+ _tmp.<%=GetPropertyName(SourceTable.PrimaryKey.MemberColumns[i])%> = this.<%=GetPropertyName(SourceTable.PrimaryKey.MemberColumns[i])%>;
+ <% if (!IsIdentityColumn(SourceTable.PrimaryKey.MemberColumns[i]) && !(IsComputed(SourceTable.PrimaryKey.MemberColumns[i]))) {%>
+ _tmp.<%=GetOriginalPropertyName(SourceTable.PrimaryKey.MemberColumns[i])%> = this.<%=GetOriginalPropertyName(SourceTable.PrimaryKey.MemberColumns[i])%>;
+ <% } %>
+ <% } %>
+
+ <% for (int x=0; x < SourceTable.NonPrimaryKeyColumns.Count; x++) { %>
+ _tmp.<%= GetPropertyName(SourceTable.NonPrimaryKeyColumns[x]) %> = this.<%= GetPropertyName(SourceTable.NonPrimaryKeyColumns[x]) %>;
+ <% } %>
+
+ #region Source Parent Composite Entities
+ <% if (IncludeGetListByFK) { %>
+ <% //Generate a Source property for each foreign key relation
+ System.Collections.ArrayList filled = new System.Collections.ArrayList();
+ foreach(TableKeySchema tableKey in SourceTable.ForeignKeys)
+ {
+ // related table must be in the selection
+ if (SourceTables.Contains(tableKey.PrimaryKeyTable)) {
+ string fkPropertyName = GetKeysName(tableKey.ForeignKeyMemberColumns);
+
+ if(filled.Contains(fkPropertyName))
+ continue;
+
+ filled.Add(fkPropertyName);
+
+ string pkClassName = GetClassName(tableKey.PrimaryKeyTable);
+
+ %>
+ if (this.<%=fkPropertyName%>Source != null && existingCopies.Contains(this.<%=fkPropertyName%>Source))
+ _tmp.<%=fkPropertyName%>Source = existingCopies[this.<%=fkPropertyName%>Source] as <%= pkClassName %>;
+ else
+ _tmp.<%=fkPropertyName%>Source = MakeCopyOf(this.<%=fkPropertyName%>Source, existingCopies) as <%= pkClassName %>;
+ <% } //end if in SourceTables
+ } //end for each FK
+ }// IncludeGetListByFK%>
+ #endregion
+
+ #region Child Collections
+ <% if (IncludeRelations){
+ int ctr = 0;
+ foreach(CollectionInfo item in GetChildrenCollections(SourceTable, SourceTables).Values) {
+ if (ctr == 0)
+ Response.Write("\t\t\t//deep copy nested objects" + Environment.NewLine);
+ ctr++;
+
+ string typeName = "";
+ if (item.CollectionRelationshipType == MoM.Templates.CommonSqlCode.RelationshipType.OneToOne)
+ typeName = item.TypeName;
+ else
+ typeName = item.CollectionTypeName;
+ %>
+ _tmp.<%= item.PropertyNameUnique %> = (<%= typeName %>) MakeCopyOf(this.<%=item.PropertyNameUnique %>, existingCopies);
+ <% }//end foreach CollectionInfo
+ }//end if IncludeRelations
+ %>
+ #endregion Child Collections
+
+ //EntityState
+ _tmp.EntityState = this.EntityState;
+
+ return _tmp;
+ }
+
#endregion Clone Method
/// <summary>
@@ -363,3 +438,11 @@
</script>
+
+
+
+
+
+
+
+
Modified: source/trunk/Source/Entities/EntityInstanceBase.generated.cst
===================================================================
--- source/trunk/Source/Entities/EntityInstanceBase.generated.cst 2007-12-20 02:54:22 UTC (rev 687)
+++ source/trunk/Source/Entities/EntityInstanceBase.generated.cst 2007-12-20 08:06:24 UTC (rev 688)
@@ -99,7 +99,7 @@
<% } %>
[Serializable, DataObject]
[CLSCompliant(true)]
- public abstract partial class <%=abstractClassName%> : EntityBase, <%=interfaceName%>, IEntityId<<%= keyClassName %>>, System.IComparable, System.ICloneable, IEditableObject, IComponent, INotifyPropertyChanged
+ public abstract partial class <%=abstractClassName%> : EntityBase, <%=interfaceName%>, IEntityId<<%= keyClassName %>>, System.IComparable, System.ICloneable, ICloneableEx, IEditableObject, IComponent, INotifyPropertyChanged
{
#region Variable Declarations
@@ -524,37 +524,47 @@
///<summary>
/// Returns a Typed <%=className%> Entity
///</summary>
- public virtual <%=className%> Copy()
+ protected virtual <%=className%> Copy(IDictionary existingCopies)
{
+ if (existingCopies == null)
+ {
+ // This is the root of the tree to be copied!
+ existingCopies = new Hashtable();
+ }
+
//shallow copy entity
<%=className%> copy = new <%=className%>();
+ existingCopies.Add(this, copy);
copy.SuppressEntityEvents = true;
<% for (int x=0; x < cols.Count; x++) { %>
- copy.<%= GetPropertyName(cols[x]) %> = this.<%= GetPropertyName(cols[x]) %>;
- <% if( cols[x].IsPrimaryKeyMember && !IsIdentityColumn(cols[x]) && !IsComputed(cols[x]) ) { %>
- copy.<%= GetOriginalPropertyName(cols[x]) %> = this.<%= GetOriginalPropertyName(cols[x]) %>;
+ copy.<%= GetPropertyName(cols[x]) %> = this.<%= GetPropertyName(cols[x]) %>;
+ <% if( cols[x].IsPrimaryKeyMember && !IsIdentityColumn(cols[x]) && !IsComputed(cols[x]) ) { %>
+ copy.<%= GetOriginalPropertyName(cols[x]) %> = this.<%= GetOriginalPropertyName(cols[x]) %>;
+ <% } %>
<% } %>
- <% } %>
<% if (IncludeGetListByFK) { %>
- <% //Generate a Source property for each foreign key relation
- System.Collections.ArrayList filled = new System.Collections.ArrayList();
- foreach(TableKeySchema tableKey in SourceTable.ForeignKeys)
- {
- // related table must be in the selection
- if (SourceTables.Contains(tableKey.PrimaryKeyTable)) {
- string fkPropertyName = GetKeysName(tableKey.ForeignKeyMemberColumns);
+ <% //Generate a Source property for each foreign key relation
+ System.Collections.ArrayList filled = new System.Collections.ArrayList();
+ foreach(TableKeySchema tableKey in SourceTable.ForeignKeys)
+ {
+ // related table must be in the selection
+ if (SourceTables.Contains(tableKey.PrimaryKeyTable)) {
+ string fkPropertyName = GetKeysName(tableKey.ForeignKeyMemberColumns);
- if(filled.Contains(fkPropertyName))
- continue;
+ if(filled.Contains(fkPropertyName))
+ continue;
+
+ filled.Add(fkPropertyName);
- filled.Add(fkPropertyName);
-
- string pkClassName = GetClassName(tableKey.PrimaryKeyTable);
- %>
- copy.<%=fkPropertyName%>Source = MakeCopyOf(this.<%=fkPropertyName%>Source) as <%= pkClassName %>;
- <% } //end if in SourceTables
- } //end for each FK
+ string pkClassName = GetClassName(tableKey.PrimaryKeyTable);
+ %>
+ if (this.<%=fkPropertyName%>Source != null && existingCopies.Contains(this.<%=fkPropertyName%>Source))
+ copy.<%=fkPropertyName%>Source = existingCopies[this.<%=fkPropertyName%>Source] as <%= pkClassName %>;
+ else
+ copy.<%=fkPropertyName%>Source = MakeCopyOf(this.<%=fkPropertyName%>Source, existingCopies) as <%= pkClassName %>;
+ <% } //end if in SourceTables
+ } //end for each FK
}// IncludeGetListByFK%>
<%
@@ -571,13 +581,23 @@
else
typeName = item.CollectionTypeName;
%>
- copy.<%= item.PropertyNameUnique %> = (<%= typeName %>) MakeCopyOf(this.<%=item.PropertyNameUnique %>);
+ copy.<%= item.PropertyNameUnique %> = (<%= typeName %>) MakeCopyOf(this.<%=item.PropertyNameUnique %>, existingCopies);
<% }//end foreach CollectionInfo
}//end if IncludeRelations
%>
copy.EntityState = this.EntityState;
copy.SuppressEntityEvents = false;
return copy;
+ }
+
+
+
+ ///<summary>
+ /// Returns a Typed <%=className%> Entity
+ ///</summary>
+ public virtual <%=className%> Copy()
+ {
+ return this.Copy(null);
}
///<summary>
@@ -585,10 +605,18 @@
///</summary>
public object Clone()
{
- return this.Copy();
+ return this.Copy(null);
}
///<summary>
+ /// ICloneableEx.Clone() Member, returns the Shallow Copy of this entity.
+ ///</summary>
+ public object Clone(IDictionary existingCopies)
+ {
+ return this.Copy(existingCopies);
+ }
+
+ ///<summary>
/// Returns a deep copy of the child collection object passed in.
///</summary>
public static object MakeCopyOf(object x)
@@ -606,6 +634,29 @@
}
///<summary>
+ /// Returns a deep copy of the child collection object passed in.
+ ///</summary>
+ public static object MakeCopyOf(object x, IDictionary existingCopies)
+ {
+ if (x == null)
+ return null;
+
+ if (x is ICloneableEx)
+ {
+ // Return a deep copy of the object
+ return ((ICloneableEx)x).Clone(existingCopies);
+ }
+ else if (x is ICloneable)
+ {
+ // Return a deep copy of the object
+ return ((ICloneable)x).Clone();
+ }
+ else
+ throw new System.NotSupportedException("Object Does Not Implement the ICloneable or IClonableEx Interface.");
+ }
+
+
+ ///<summary>
/// Returns a Typed <%=className%> Entity which is a deep copy of the current entity.
///</summary>
public virtual <%=className%> DeepCopy()
@@ -695,7 +746,8 @@
///<returns>true if Object1 is a <see cref="<%=abstractClassName%>"/> and has the same value as this instance; otherwise, false.</returns>
public override bool Equals(object Object1)
{
- if (Object1 is <%=abstractClassName%>)
+ // Cast exception if Object1 is null or DbNull
+ if (Object1 != null && Object1 != DBNull.Value && Object1 is <%=abstractClassName%>)
return ValueEquals(this, (<%=abstractClassName%>)Object1);
else
return false;
Modified: source/trunk/Source/Entities/IEntity.cst
===================================================================
--- source/trunk/Source/Entities/IEntity.cst 2007-12-20 02:54:22 UTC (rev 687)
+++ source/trunk/Source/Entities/IEntity.cst 2007-12-20 08:06:24 UTC (rev 688)
@@ -20,6 +20,7 @@
%>
using System;
using System.ComponentModel;
+using System.Collections;
namespace <%=NameSpace%>
{
@@ -140,4 +141,17 @@
///</summary>
string EntityTrackingKey { get; set; }
}
+
+ /// <summary>
+ /// Interface that TList and every entity implements to support
+ /// cloning of an object tree.
+ /// </summary>
+ public interface ICloneableEx
+ {
+ ///<summary>
+ /// The tracking key used to with the <see cref="EntityLocator" />
+ ///</summary>
+ ///<param name="existingCopies">A list containing references to all objects already copied.</param>
+ object Clone(IDictionary existingCopies);
+ }
}
Modified: source/trunk/Source/Entities/ListBase.cst
===================================================================
--- source/trunk/Source/Entities/ListBase.cst 2007-12-20 02:54:22 UTC (rev 687)
+++ source/trunk/Source/Entities/ListBase.cst 2007-12-20 08:06:24 UTC (rev 688)
@@ -26,7 +26,7 @@
/// Supports filtering, databinding, searching and sorting.
/// </summary>
[Serializable]
- public abstract class ListBase<T> : BindingList<T>, IBindingListView, IBindingList, IList, ICloneable, IListSource, ITypedList, IDisposable, IComponent, IRaiseItemChangedEvents, IDeserializationCallback
+ public abstract class ListBase<T> : BindingList<T>, IBindingListView, IBindingList, IList, ICloneable, ICloneableEx, IListSource, ITypedList, IDisposable, IComponent, IRaiseItemChangedEvents, IDeserializationCallback
{
private List<T> _OriginalList = new List<T>();
@@ -578,6 +578,15 @@
}
///<summary>
+ /// Creates an exact copy of this instance.
+ ///</summary>
+ ///<implements><see cref="ICloneableEx.Clone"/></implements>
+ public virtual object Clone(IDictionary existingCopies)
+ {
+ throw new NotImplementedException("Method not implemented.");
+ }
+
+ ///<summary>
/// Creates an exact copy of this TList{T} object.
///</summary>
///<returns>A new, identical copy of the TList{T} casted as object.</returns>
@@ -594,7 +603,31 @@
System.NotSupportedException("object not cloneable");
}
}
- #endregion ICloneable
+
+ ///<summary>
+ /// Creates an exact copy of this TList{T} object.
+ ///</summary>
+ ///<returns>A new, identical copy of the TList{T} casted as object.</returns>
+ public static object MakeCopyOf(object x, IDictionary existingCopies)
+ {
+ if (x is ICloneableEx)
+ {
+ // Return a deep copy of the object
+ return ((ICloneableEx)x).Clone(existingCopies);
+ }
+ else if (x is ICloneable)
+ {
+ // Return a deep copy of the object
+ return ((ICloneable)x).Clone();
+ }
+ else
+ {
+ throw new
+ System.NotSupportedException("object not cloneable");
+ }
+ }
+
+ #endregion ICloneable
#region PropertyCollection
/// <summary>
Modified: source/trunk/Source/Entities/TList.cst
===================================================================
--- source/trunk/Source/Entities/TList.cst 2007-12-20 02:54:22 UTC (rev 687)
+++ source/trunk/Source/Entities/TList.cst 2007-12-20 08:06:24 UTC (rev 688)
@@ -125,8 +125,18 @@
///<implements><see cref="ICloneable.Clone"/></implements>
public override object Clone()
{
- return this.Copy();
+ return this.Copy(null);
}
+
+ ///<summary>
+ /// Creates an exact copy of this <%=listName%>{T} instance.
+ ///</summary>
+ ///<returns>The <%=listName%>{T} object this method creates, cast as an object.</returns>
+ ///<implements><see cref="ICloneableEx.Clone"/></implements>
+ public override object Clone(IDictionary existingCopies)
+ {
+ return this.Copy(existingCopies);
+ }
///<summary>
/// Creates an exact copy of this <%=listName%>{T} object.
@@ -134,10 +144,26 @@
///<returns>A new, identical copy of the <%=listName%>{T}.</returns>
public virtual <%=listName%><T> Copy()
{
+ return this.Copy(null);
+ }
+
+ ///<summary>
+ /// Creates an exact copy of this <%=listName%>{T} object.
+ ///</summary>
+ ///<returns>A new, identical copy of the <%=listName%>{T}.</returns>
+ public virtual <%=listName%><T> Copy(IDictionary existingCopies)
+ {
+ if (existingCopies == null)
+ existingCopies = new Hashtable();
+
<%=listName%><T> copy = new <%=listName%><T>();
foreach (T item in this)
{
- T itemCopy = (T)MakeCopyOf(item);
+ T itemCopy = default(T);
+ if (existingCopies.Contains(item))
+ itemCopy = (T)existingCopies[item];
+ else
+ itemCopy = (T)MakeCopyOf(item, existingCopies);
copy.Add(itemCopy);
}
Modified: source/trunk/Source/TemplateLib/CommonSqlCode.cs
===================================================================
--- source/trunk/Source/TemplateLib/CommonSqlCode.cs 2007-12-20 02:54:22 UTC (rev 687)
+++ source/trunk/Source/TemplateLib/CommonSqlCode.cs 2007-12-20 08:06:24 UTC (rev 688)
@@ -5526,6 +5526,23 @@
return result;
}
+ ///<summary>
+ /// Get's the foreign key columns from a corresponding a m:m relationship to it's corresponding 1:m relationship
+ ///</summary>
+ public ColumnSchemaCollection GetCorrespondingRelationshipKeys(TableKeySchemaCollection fkeys, ColumnSchema col)
+ {
+ //System.Diagnostics.Debugger.Break();
+ for (int j = 0; j < fkeys.Count; j++)
+ {
+ for (int y = 0; y < fkeys[j].ForeignKeyMemberColumns.Count; y++)
+ {
+ if (fkeys[j].ForeignKeyMemberColumns[y].Name.ToLower()
+ == col.Name.ToLower())
+ return (ColumnSchemaCollection)fkeys[j].ForeignKeyMemberColumns;
+ }
+ }
+ return null;
+ }
private string _currentTable = string.Empty;
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2007-12-20 02:54:22 UTC (rev 687)
+++ source/trunk/Source/changes.log 2007-12-20 08:06:24 UTC (rev 688)
@@ -1,4 +1,6 @@
-.netTiers v2.2.0.687
+.netTiers v2.2.0.688
+12/20/2007
+ - [FIX] Correct stack overflow exception and invalid cast exception in equals method (contrib brianb)
12/19/2007
- [ENH] New ValidationType property to allow validation to be done by either NetTiers (default) or new EntLib validation (contrib katokay)
- [ENH] Added Support in the EntityGridView for EntityDataSource
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ms...@us...> - 2007-12-20 02:54:19
|
Revision: 687
http://nettiers.svn.sourceforge.net/nettiers/?rev=687&view=rev
Author: mshatny
Date: 2007-12-19 18:54:22 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
[ENH] Added Support in the EntityGridView for generic EntityDataSource
Modified Paths:
--------------
source/trunk/Source/WebLibrary/UI/EntityGridView.cs.cst
source/trunk/Source/changes.log
Modified: source/trunk/Source/WebLibrary/UI/EntityGridView.cs.cst
===================================================================
--- source/trunk/Source/WebLibrary/UI/EntityGridView.cs.cst 2007-12-19 17:09:20 UTC (rev 686)
+++ source/trunk/Source/WebLibrary/UI/EntityGridView.cs.cst 2007-12-20 02:54:22 UTC (rev 687)
@@ -389,6 +389,18 @@
/// <summary>
/// Retrieves data from the underlying data storage by calling the method that is identified by the
+ /// SelectMethod property with the parameters in the SelectParameters collection.
+ /// </summary>
+ /// <remarks>
+ /// Occurs when a Select operation has completed.
+ /// </remarks>
+ void dsc_Selected(object sender, Web.Data.EntityDataSourceMethodEventArgs e)
+ {
+ RecordsCount = e.AffectedRows;
+ }
+
+ /// <summary>
+ /// Retrieves data from the underlying data storage by calling the method that is identified by the
/// SelectMethod property with the parameters in the SelectParameters collection.
/// </summary>
/// <remarks>
Modified: source/trunk/Source/changes.log
===================================================================
--- source/trunk/Source/changes.log 2007-12-19 17:09:20 UTC (rev 686)
+++ source/trunk/Source/changes.log 2007-12-20 02:54:22 UTC (rev 687)
@@ -1,6 +1,7 @@
-.netTiers v2.2.0.686
+.netTiers v2.2.0.687
12/19/2007
- [ENH] New ValidationType property to allow validation to be done by either NetTiers (default) or new EntLib validation (contrib katokay)
+ - [ENH] Added Support in the EntityGridView for EntityDataSource
12/17/2007
- [FIX] Allow project msbuildversion to include new 2008 version (contrib toksic)
- [REF] Minor refactoring of ServiceBaseCore
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|