protected override void OnInitData() { Criteria c = CreateCriteria(); List <Order> os = CreateOrders(); ModelDBHelper dbhelper = ModelDBHelper.Create(ModelName); Items = dbhelper.QueryPagedList(c, os, 0, PageSize).Rows; }
protected override void OnInitData() { int recordcount; ModelDBHelper dbhelper = ModelDBHelper.Create(ModelName); List <Order> os = CreateOrders(); Criteria c = CreateCriteria(); Items = dbhelper.QueryPagedList(c, os, Pager.PageIndex, Pager.PageSize, out recordcount).Rows; Pager.RecordCount = recordcount; }
protected override void OnInitData() { Criteria c = CreateCriteria(); List <Order> os = CreateOrders(); ModelDBHelper dbhelper = ModelDBHelper.Create(ModelName); // Items = dbhelper.QueryPagedList(c, os, 0, PageSize).Rows; DataTable dt = dbhelper.QueryPagedList(c, os, 0, PageSize, Fields); /*begin 表关联相关*/ if (null != dt) { JoinEx joinex = new JoinEx(); MoldPanel mp = new MoldPanel(); ColumnInfoCollection columns = mp.GetPanelContext(ModelName, "list").Panel.ListInfo.Groups[0].Columns; foreach (ColumnInfo item in columns) { if (!string.IsNullOrEmpty(item.Params["model"])) { joinex.JoinInfo.Add(item.Name, new JoinEx() { MainField = item.Name, PriMaryKeyName = item.Params["valuefield"], ToField = item.Params["textfield"], ToTableName = item.Params["model"] }); } } if (joinex.JoinInfo != null && joinex.JoinInfo.Count > 0) { DataBaseAssistant db = new DataBaseAssistant(); dt = db.Join(dt, joinex); } } /*end*/ if (dt != null) { Items = dt.Rows; } }