CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
SelectObjectArgs.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="SelectObjectArgs.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Argument object used in the SelectObject event.</summary>
7//-----------------------------------------------------------------------
8using System;
9using System.ComponentModel;
10
11namespace Csla.Web
12{
17 public class SelectObjectArgs : EventArgs
18 {
19
20 private object _businessObject;
21 private string _sortExpression;
22 private string _sortProperty;
23 private ListSortDirection _sortDirection;
24 private int _startRowIndex;
25 private int _maximumRows;
26 private bool _retrieveTotalRowCount;
27
34 public object BusinessObject
35 {
36 get { return _businessObject; }
37 set { _businessObject = value; }
38 }
39
45 public string SortExpression
46 {
47 get
48 {
49 return _sortExpression;
50 }
51 }
52
63 public string SortProperty
64 {
65 get
66 {
67 return _sortProperty;
68 }
69 }
70
81 public ListSortDirection SortDirection
82 {
83 get
84 {
85 return _sortDirection;
86 }
87 }
88
95 public int StartRowIndex
96 {
97 get
98 {
99 return _startRowIndex;
100 }
101 }
102
109 public int MaximumRows
110 {
111 get
112 {
113 return _maximumRows;
114 }
115 }
116
125 {
126 get
127 {
128 return _retrieveTotalRowCount;
129 }
130 }
131
137 public SelectObjectArgs(System.Web.UI.DataSourceSelectArguments args)
138 {
139
140 _startRowIndex = args.StartRowIndex;
141 _maximumRows = args.MaximumRows;
142 _retrieveTotalRowCount = args.RetrieveTotalRowCount;
143
144 _sortExpression = args.SortExpression;
145 if (!(string.IsNullOrEmpty(_sortExpression)))
146 {
147 if (_sortExpression.Length >= 5 &&
148 _sortExpression.Substring(_sortExpression.Length - 5) == " DESC")
149 {
150 _sortProperty = _sortExpression.Substring(0, _sortExpression.Length - 5);
151 _sortDirection = ListSortDirection.Descending;
152
153 }
154 else
155 {
156 _sortProperty = args.SortExpression;
157 _sortDirection = ListSortDirection.Ascending;
158 }
159 }
160 }
161 }
162}
Argument object used in the SelectObject event.
bool RetrieveTotalRowCount
Gets a value indicating whether the query should return the total row count through the Csla....
string SortExpression
Gets the sort expression that should be used to sort the data being returned to the data source contr...
ListSortDirection SortDirection
Gets the sort direction for the sort if only one property/column name is specified.
int StartRowIndex
Gets the index for the first row that will be displayed.
string SortProperty
Gets the property name for the sort if only one property/column name is specified.
object BusinessObject
Get or set a reference to the business object that is created and populated by the SelectObject event...
SelectObjectArgs(System.Web.UI.DataSourceSelectArguments args)
Creates an instance of the object, initializing it with values from data binding.
int MaximumRows
Gets the maximum number of rows that should be returned as a result of this query.
@ Serializable
Prevents updating or inserting until the transaction is complete.