Click or drag to resize

ControllerDataGridDataItemClassLoad Method

Load all data items with object AppModule method GetAll

Namespace:  SOWIWin.Helper
Assembly:  SOWIWin.Helper (in SOWIWin.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public virtual PageDataGridUI Load()

Return Value

Type: PageDataGridUI

[Missing <returns> documentation for "M:SOWIWin.Helper.ControllerDataGrid`1.Load"]

Implements

IControllerDataGridLoad
Remarks
This code
List<DataItemClass> lList = new List<DataItemClass>();
if (this.AppModule != null)
{
    lList = this.AppModule.GetAll();
}
this.SetData(lList);
return PageDataGridUI;
Examples
This example override method Load with a few of filters
public override PageDataGridUI Load()
{
    List<SOWIData.Management.DataGrid> lList = new List<SOWIData.Management.DataGrid>();
    if (this.ConnectionString.Length == 0)
    {
        if (this.AppDataGrid != null)
        {
            string lAppName = (this.FilterAppName == null ? "" : this.FilterAppName);
            string lUserName = (this.FilterUserName == null ? "" : this.FilterUserName);
            string lViewName = (this.FilterViewName == null ? "" : this.FilterViewName);
            string lTableName = (this.FilterTableName == null ? "" : this.FilterTableName);
            string lClientName = (this.FilterClientName == null ? "" : this.FilterClientName);
            lList = AppDataGrid.GetAll();
            if (lAppName != "")
            {
                lList = (from p in lList
                         where p.AppName == lAppName
                         select p).ToList();
            }
            if (lUserName != "")
            {
                lList = (from p in lList
                         where p.UserName == lUserName
                         select p).ToList();
            }
            if (lViewName != "")
            {
                lList = (from p in lList
                         where p.ViewName == lViewName
                         select p).ToList();
            }
            if (lTableName != "")
            {
                lList = (from p in lList
                         where p.TableName == lTableName
                         select p).ToList();
            }
            if (lClientName != "")
            {
                int lClientID = SOWIApp.Management.Client.GetClientID(lClientName, this.ConnectionString);
                lList = (from p in lList
                         where p.ClientID == lClientID
                         select p).ToList();
            }
            lList = (from p in lList
                     orderby p.AppName, p.ViewName, p.UserName, p.Order, p.OrderDefault
                     select p).ToList();
        }
    }
    this.SetData(lList);
    return this.PageDataGridUI;
}
See Also