protected void Page_Load(object sender, EventArgs e) { #region//默认隐藏的列 //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP1); //hideTableColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP2); //hideTableColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP3); //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要 //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP1); //hideFindColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP2); //hideFindColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP3); #endregion condObj.OrderBy(HR_CHKWKDIVKEYVALUE.Attribute.OtherKeyFieldName, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "查询"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { HR_CHKWKDIVKEYVALUE roleOld = new HR_CHKWKDIVKEYVALUE(); roleOld.Where(HR_CHKWKDIVKEYVALUE.Attribute.OtherKeyFieldName, Request["ids"].ToString()); listObj = BLLTable <HR_CHKWKDIVKEYVALUE> .Factory(conn).Select(valObj, roleOld); for (int i = 0; i < listObj.Count; i++) { if (i > 0) { hidOld.Value += ","; hidInitIDS.Value += ","; } hidOld.Value += "{ID:'" + listObj[i].OtherKeyFieldName + "',Name:'" + listObj[i].OtherKeyFieldName + "'}";//这里的Name用于显示在列表中,请自行重定义。 hidInitIDS.Value += listObj[i].OtherKeyFieldName; } } try { listObj = BLLTable <HR_CHKWKDIVKEYVALUE> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; } catch (Exception ex) { litWarn.Text = ex.Message; } } }
protected void Page_Load(object sender, EventArgs e) { valObj.OrderBy(HR_CHKWKDIVKEYVALUE.Attribute.DeviceID, Order.Desc); #region//默认隐藏的列 //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP1); //hideTableColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP2); //hideTableColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP3); //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要 //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP1); //hideFindColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP2); //hideFindColumnList.Add(HR_CHKWKDIVKEYVALUE.Attribute.EXP3); #endregion //多级数据表页面才用到 if (Request["PID"] != null) { pid = Request["PID"]; } title = valObj._ZhName + "选择"; Page.Title = title; if (!IsPostBack) { aspPager.CurrentPageIndex = 1; aspPager.PageSize = 20; try { listObj = BLLTable <HR_CHKWKDIVKEYVALUE> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, 1, ref recount); repCus.DataSource = listObj; repCus.DataBind(); } catch (Exception ex) { litWarn.Text = ex.Message; } aspPager.RecordCount = recount; } }