示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //zlg 如果有模块,则先配置
        valObj.setConn(conn).setModule(ModuleName);

        #region//默认隐藏的列
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(V_DEVICELIST.Attribute.EXP1);
        //hideTableColumnList.Add(V_DEVICELIST.Attribute.EXP2);
        //hideTableColumnList.Add(V_DEVICELIST.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要
        //valObj.Remove(hideTableColumnList);

        //hideFindColumnList = new List<AttributeItem>();
        //hideFindColumnList.Add(V_DEVICELIST.Attribute.EXP1);
        //hideFindColumnList.Add(V_DEVICELIST.Attribute.EXP2);
        //hideFindColumnList.Add(V_DEVICELIST.Attribute.EXP3);
        #endregion
        condObj.OrderBy(V_DEVICELIST.Attribute.ID, Order.Desc);

        if (!IsPostBack)
        {
            btnFind.Text              = LanguageService.GetLanguageString("btnFind", "查询");
            aspPager.PageSize         = 10;
            aspPager.CurrentPageIndex = 1;

            if (!string.IsNullOrEmpty(Request["ids"]))
            {
                V_DEVICELIST roleOld = new V_DEVICELIST();
                roleOld.Where(V_DEVICELIST.Attribute.ID, Request["ids"].ToString());
                listObj = BLLTable <V_DEVICELIST> .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 <V_DEVICELIST> .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)
    {
        //zlg �����ģ�飬��������
        valObj.setConn(conn).setModule(ModuleName);

        #region//Ĭ�����ص���
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(V_DEVICELIST.Attribute.EXP1);
        //hideTableColumnList.Add(V_DEVICELIST.Attribute.EXP2);
        //hideTableColumnList.Add(V_DEVICELIST.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//��ʱ�Ӵ˴��룬�Ժ��ܸ��½�����Ҫ
        //valObj.Remove(hideTableColumnList);

        //hideFindColumnList = new List<AttributeItem>();
        //hideFindColumnList.Add(V_DEVICELIST.Attribute.EXP1);
        //hideFindColumnList.Add(V_DEVICELIST.Attribute.EXP2);
        //hideFindColumnList.Add(V_DEVICELIST.Attribute.EXP3);
        #endregion
        condObj.OrderBy(V_DEVICELIST.Attribute.ID, Order.Desc);

        if (!IsPostBack)
        {
            btnFind.Text = LanguageService.GetLanguageString("btnFind", "��ѯ");
            aspPager.PageSize = 10;
            aspPager.CurrentPageIndex = 1;

            if (!string.IsNullOrEmpty(Request["ids"]))
            {
                V_DEVICELIST roleOld = new V_DEVICELIST();
                roleOld.Where(V_DEVICELIST.Attribute.ID, Request["ids"].ToString());
                listObj = BLLTable<V_DEVICELIST>.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<V_DEVICELIST>.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;
            }

        }
    }