forked from tylike/CIIP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewObject.cs
More file actions
33 lines (26 loc) · 992 Bytes
/
Copy pathViewObject.cs
File metadata and controls
33 lines (26 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Linq;
using DevExpress.ExpressApp.Model;
namespace CIIP.CodeFirstView
{
public abstract class ViewObject
{
public abstract Type BusinessObjectType { get; }
public abstract void UpdateNode(IModelListView view);
public abstract void LayoutListView();
public virtual void LayoutDetailView()
{
}
protected void SetFooterCount(IModelListView view)
{
view.IsFooterVisible = true;
var firstColumn = view.Columns.Where(x => x.Index > -1).OrderBy(x => x.Index).FirstOrDefault();
var sum = firstColumn?.Summary.FirstOrDefault(x => x.SummaryType == SummaryType.Count);
if (firstColumn != null && sum == null)
{
sum = firstColumn.Summary.AddNode<IModelColumnSummaryItem>(firstColumn.PropertyName+"Count");
sum.SummaryType = SummaryType.Count;
}
}
}
}