Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region//默认隐藏的列
        //hideTableColumnList = new List<AttributeItem>();
        //hideTableColumnList.Add(CRM_CUST.Attribute.EXP1);
        //hideTableColumnList.Add(CRM_CUST.Attribute.EXP2);
        //hideTableColumnList.Add(CRM_CUST.Attribute.EXP3);
        //valObj.LoadAllAttributes(true);//暂时加此代码,以后框架更新将不需要
        //valObj.Remove(hideTableColumnList);

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

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

            if (!string.IsNullOrEmpty(Request["ids"]))
            {
                CRM_CUST roleOld = new CRM_CUST();
                roleOld.Where(CRM_CUST.Attribute.Cus_ID, Request["ids"].ToString());
                listObj = BLLTable <CRM_CUST> .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].Cus_ID + "',Name:'" + listObj[i].Cus_ID + "'}";//这里的Name用于显示在列表中,请自行重定义。
                    hidInitIDS.Value += listObj[i].Cus_ID;
                }
            }
            try
            {
                listObj = BLLTable <CRM_CUST> .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;
            }
        }
    }
Beispiel #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        cusCond.OrderBy(CRM_CUST.Attribute.Cus_ID, Order.Desc);//Cus_ID列名不明确

        if (!IsPostBack)
        {
            aspPager.PageSize = 12;

            try
            {
                proList = BLLTable <CRM_CUST> .Factory(conn).SelectByPage(proValue, cusCond, aspPager.PageSize, 1, ref recount);

                repCus.DataSource = proList;
                repCus.DataBind();
            }
            catch (Exception ex)
            {
                //PageHelper.Error(Page, ex);
            }
            aspPager.RecordCount      = recount;
            aspPager.CurrentPageIndex = 1;
        }
    }