protected void Page_Load(object sender, EventArgs e) { //zlg 如果有模块,则先配置 valObj.setConn(conn).setModule(ModuleName); #region//默认隐藏的列 //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP1); //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP2); //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP3); //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要 //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP1); //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP2); //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP3); #endregion condObj.OrderBy(WEC_CUSTOM_MODEL_SET.Attribute.ID, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "查询"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { WEC_CUSTOM_MODEL_SET roleOld = new WEC_CUSTOM_MODEL_SET(); roleOld.Where(WEC_CUSTOM_MODEL_SET.Attribute.ID, Request["ids"].ToString()); listObj = BLLTable <WEC_CUSTOM_MODEL_SET> .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].ID + "',Name:'" + listObj[i].ID + "'}";//这里的Name用于显示在列表中,请自行重定义。 hidInitIDS.Value += listObj[i].ID; } } try { listObj = BLLTable <WEC_CUSTOM_MODEL_SET> .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; } } }
private void BindList(WEC_CUSTOM_MODEL_SET condObj, int curPage) { if (condObj.af_PageByAttributeItem == null) //如果不存在用户定义的分页排序属性,则用主键属性排序 { condObj.af_PageBy(WEC_CUSTOM_MODEL_SET.Attribute.A_ID, Order.Desc); //.ID 改成 .A_ID } #region //数据权限条件 #endregion //condObj.PID = decimal.Parse(pid); //valObj = new WEC_CUSTOM_MODEL_SET(); valObj.A_ID = 1; condObj.Where("1=1 GROUP BY A_ID"); listObj = BLLTable <WEC_CUSTOM_MODEL_SET> .Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; }
protected void Page_Load(object sender, EventArgs e) { //zlg �����ģ�飬�������� valObj.setConn(conn).setModule(ModuleName); #region//Ĭ�����ص��� //hideTableColumnList = new List<AttributeItem>(); //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP1); //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP2); //hideTableColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP3); //valObj.LoadAllAttributes(true);//��ʱ�Ӵ˴��룬�Ժ��ܸ��½�����Ҫ //valObj.Remove(hideTableColumnList); //hideFindColumnList = new List<AttributeItem>(); //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP1); //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP2); //hideFindColumnList.Add(WEC_CUSTOM_MODEL_SET.Attribute.EXP3); #endregion condObj.OrderBy(WEC_CUSTOM_MODEL_SET.Attribute.ID, Order.Desc); if (!IsPostBack) { btnFind.Text = LanguageService.GetLanguageString("btnFind", "��ѯ"); aspPager.PageSize = 10; aspPager.CurrentPageIndex = 1; if (!string.IsNullOrEmpty(Request["ids"])) { WEC_CUSTOM_MODEL_SET roleOld = new WEC_CUSTOM_MODEL_SET(); roleOld.Where(WEC_CUSTOM_MODEL_SET.Attribute.ID, Request["ids"].ToString()); listObj = BLLTable<WEC_CUSTOM_MODEL_SET>.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].ID + "',Name:'" + listObj[i].ID + "'}";//�����Name������ʾ���б��У��������ض��塣 hidInitIDS.Value += listObj[i].ID; } } try { listObj = BLLTable<WEC_CUSTOM_MODEL_SET>.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; } } }
private void BindList(WEC_CUSTOM_MODEL_SET condObj, int curPage) { if (condObj.af_PageByAttributeItem == null)//����������û�����ķ�ҳ�������ԣ����������������� condObj.af_PageBy(WEC_CUSTOM_MODEL_SET.Attribute.A_ID, Order.Desc);//.ID �ij� .A_ID #region//����Ȩ������ #endregion //condObj.PID = decimal.Parse(pid); //valObj = new WEC_CUSTOM_MODEL_SET(); valObj.A_ID = 1; condObj.Where ("1=1 GROUP BY A_ID"); listObj = BLLTable<WEC_CUSTOM_MODEL_SET>.Factory(conn).SelectByPage(valObj, condObj, aspPager.PageSize, curPage, ref recount); repList.DataSource = listObj; repList.DataBind(); aspPager.RecordCount = recount; }