示例#1
0
    private void BindCustomer(string nick, DateTime start, DateTime end)
    {
        List <TalkContent> list = talkDal.GetTalkCustomer(start, end, nick, Enum.TalkObjType.All);

        Rpt_CustomerList.DataSource = list;
        Rpt_CustomerList.DataBind();
    }
示例#2
0
    protected void ShowCus(object sender, EventArgs e)
    {
        LinkButton lb = (LinkButton)sender;

        string fnick = lb.Text;

        List <TalkContent> list = talkDal.GetTalkCustomer(DateTime.Parse(ViewState["start"].ToString()), DateTime.Parse(ViewState["end"].ToString()), fnick, Enum.TalkObjType.Out);

        Rpt_CustomerList.DataSource = list;
        Rpt_CustomerList.DataBind();
        ViewState["nick"] = fnick;
    }
    private void Bind(DateTime start, DateTime end, string nick,params int[] tid)
    {
        int TotalCount = 0;//总记录数
        int TotalPage = 1; //总页数

        int page = 1;
        try
        {
            page = int.Parse(Request.QueryString["Page"]);
            if (ViewState["page"] != null)
            {
                page = int.Parse(ViewState["page"].ToString());
                ViewState["page"] = null;
            }
        }
        catch { }

        List<GoodsOrderInfo>  goodsOrderList = goDal.GetCustomerList(nick, start, end);

        IList<CustomerInfo> list = trDal.GetCustomerList(start, end, nick);

        if (list.Count > 0)
        {
            for (int i = 0; i < list.Count; i++)
            {
                IList<GoodsOrderInfo> thislist = goodsOrderList.Where(o => o.buyer_nick == list[i].CustomerNick).ToList();
                if (thislist.Count > 0)
                {
                    list[i].tid = thislist[0].tid;
                }
            }
        }

        int suc = 0;
        if (tid != null && tid.Length > 0)
        {
            list = list.Where(o => !string.IsNullOrEmpty(o.tid)).ToList();
            suc = 1;
        }

        TotalCount = list.Count;
        pds.DataSource = list;
        pds.AllowPaging = true;
        pds.PageSize = 20;

        if (TotalCount == 0)
            TotalPage = 1;
        else
        {
            if (TotalCount % pds.PageSize == 0)
                TotalPage = TotalCount / pds.PageSize;
            else
                TotalPage = TotalCount / pds.PageSize + 1;
        }

        pds.CurrentPageIndex = page - 1;
        lblCurrentPage.Text = "共" + TotalCount.ToString() + "条记录 当前页:" + page + "/" + TotalPage;

        lnkFrist.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=1" + "&start=" + start.ToShortDateString() + "&suc=" + suc;
        if (!pds.IsFirstPage)
            lnkPrev.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + (page - 1) + "&start=" + start.ToShortDateString() + "&suc=" + suc;

        if (!pds.IsLastPage)
            lnkNext.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + (page + 1) + "&start=" + start.ToShortDateString() + "&suc=" + suc;
        lnkEnd.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + TotalPage + "&start=" + start.ToShortDateString() + "&suc=" + suc;

        Rpt_CustomerList.DataSource = pds;
        Rpt_CustomerList.DataBind();
        TB_Start.Text = start.ToString("yyyy-MM-dd");

    }
    private void Bind()
    {
        string nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value);

        int TotalCount = 0; //总记录数
        int TotalPage  = 1; //总页数

        int page = 1;

        try
        {
            page = int.Parse(Request.QueryString["Page"]);
            if (ViewState["page"] != null)
            {
                page = int.Parse(ViewState["page"].ToString());
                ViewState["page"] = null;
            }
        }
        catch { }

        IList <TeteUserTokenInfo> list = tutDal.GetAllTeteUserToken(nick);

        TotalCount      = list.Count;
        pds.DataSource  = list;
        pds.AllowPaging = true;
        pds.PageSize    = 20;

        if (TotalCount == 0)
        {
            TotalPage = 1;
        }
        else
        {
            if (TotalCount % pds.PageSize == 0)
            {
                TotalPage = TotalCount / pds.PageSize;
            }
            else
            {
                TotalPage = TotalCount / pds.PageSize + 1;
            }
        }

        pds.CurrentPageIndex = page - 1;
        lblCurrentPage.Text  = "共" + TotalCount.ToString() + "条记录 当前页:" + page + "/" + TotalPage;

        lnkFrist.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=1";
        if (!pds.IsFirstPage)
        {
            lnkPrev.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + (page - 1);
        }

        if (!pds.IsLastPage)
        {
            lnkNext.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + (page + 1);
        }
        lnkEnd.NavigateUrl = Request.CurrentExecutionFilePath + "?Page=" + TotalPage;

        Rpt_CustomerList.DataSource = pds;
        Rpt_CustomerList.DataBind();
    }