Example #1
0
 /// <summary>
 ///   Gets the next display order value for a table or a group of records.</summary>
 /// <param name="connection">
 ///   Connection (required).</param>
 /// <param name="row">
 ///   Row with a display order field (required).</param>
 /// <param name="filter">
 ///   Filter for records (can be null).</param>
 /// <returns>
 ///   One more of maximum display order values of records in the group. 
 ///   If none, 1.</returns>
 public static int GetNextValue(IDbConnection connection, IDisplayOrderRow row, ICriteria filter = null)
 {
     return GetNextValue(connection, ((Row)row).Table, row.DisplayOrderField, filter);
 }
Example #2
0
 /// <summary>
 ///   Gets the next display order value for a table or a group of records.</summary>
 /// <param name="connection">
 ///   Connection (required).</param>
 /// <param name="row">
 ///   Row with a display order field (required).</param>
 /// <param name="filter">
 ///   Filter for records (can be null).</param>
 /// <returns>
 ///   One more of maximum display order values of records in the group.
 ///   If none, 1.</returns>
 public static int GetNextValue(IDbConnection connection, IDisplayOrderRow row, ICriteria filter = null)
 {
     return(GetNextValue(connection, ((Row)row).Table, row.DisplayOrderField, filter));
 }
Example #3
0
 /// <summary>
 ///   Sets a records display order to to requested value, and also renumbers other records
 ///   in the group as required.</summary>
 /// <param name="connection">
 ///   Connection (required).</param>
 /// <param name="row">
 ///   Row with a display order and ID field (should implement IDbIdRow interface).</param>
 /// <param name="filter">
 ///   Filter that will determine the record group (can be null).</param>
 /// <param name="recordID">
 ///   ID value of the record.</param>
 /// <param name="newDisplayOrder">
 ///   New display order of the record.</param>
 /// <param name="descendingKeyOrder">
 ///   Will records with same display order values be sorted in ascending or descending ID order?
 ///   For example, if records with ID's 1, 2, 3 has display order value of "0", their actual display
 ///   orders are 1, 2 and 3. If this parameter is set to true (descending), their display orders will
 ///   become 3, 2, 1. This parameter controls if records that are added recently and has no display
 ///   order value assigned (or 0) be shown at start or at the end.</param>
 /// <returns>
 ///   If any of the display order values is changed true.</returns>
 public static bool ReorderValues(IDbConnection connection, IDisplayOrderRow row, ICriteria filter = null, 
     Int64? recordID = null, int newDisplayOrder = 1, bool descendingKeyOrder = false, bool hasUniqueConstraint = false)
 {
     return ReorderValues(connection, ((Row)row).Table, (Field)((IIdRow)row).IdField, row.DisplayOrderField, filter, recordID,
         newDisplayOrder, descendingKeyOrder, hasUniqueConstraint);
 }
Example #4
0
 /// <summary>
 ///   Sets a records display order to to requested value, and also renumbers other records
 ///   in the group as required.</summary>
 /// <param name="connection">
 ///   Connection (required).</param>
 /// <param name="row">
 ///   Row with a display order and ID field (should implement IDbIdRow interface).</param>
 /// <param name="filter">
 ///   Filter that will determine the record group (can be null).</param>
 /// <param name="recordID">
 ///   ID value of the record.</param>
 /// <param name="newDisplayOrder">
 ///   New display order of the record.</param>
 /// <param name="descendingKeyOrder">
 ///   Will records with same display order values be sorted in ascending or descending ID order?
 ///   For example, if records with ID's 1, 2, 3 has display order value of "0", their actual display
 ///   orders are 1, 2 and 3. If this parameter is set to true (descending), their display orders will
 ///   become 3, 2, 1. This parameter controls if records that are added recently and has no display
 ///   order value assigned (or 0) be shown at start or at the end.</param>
 /// <returns>
 ///   If any of the display order values is changed true.</returns>
 public static bool ReorderValues(IDbConnection connection, IDisplayOrderRow row, ICriteria filter = null,
                                  Int64?recordID = null, int newDisplayOrder = 1, bool descendingKeyOrder = false, bool hasUniqueConstraint = false)
 {
     return(ReorderValues(connection, ((Row)row).Table, (Field)((IIdRow)row).IdField, row.DisplayOrderField, filter, recordID,
                          newDisplayOrder, descendingKeyOrder, hasUniqueConstraint));
 }