Пример #1
0
    /// <summary>
    /// 绑定销售订单信息列表
    /// </summary>
    public void Bind()
    {
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = " and dr=0" + " and CompID=" + this.CompID;

        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }

        List <Hi.Model.YZT_CMerchants> l = CMerchantsBll.GetList(Pager.PageSize, Pager.CurrentPageIndex, "CreateDate", true, strwhere, out pageCount, out Counts);

        this.rptOrder.DataSource = l;
        this.rptOrder.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Пример #2
0
    /// <summary>
    /// 绑定销售订单信息列表
    /// </summary>
    public void Bind()
    {
        // 公司选择器
        string selectedCompId = this.ddrComp.Value;

        ddrComp.DataSource     = Common.ListAllComps(true);
        ddrComp.DataTextField  = "CompName";
        ddrComp.DataValueField = "id";
        ddrComp.DataBind();
        ddrComp.Value = selectedCompId;

        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = "and dr=0 and isnull(IsEnabled,0)=1 and (ISNULL(ForceDate,0)=0 or ForceDate <= getdate() ) and (ISNULL(InvalidDate,0)=0 or InvalidDate>=getdate())";

        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }

        string compstr  = string.Empty;
        string compstr1 = string.Empty;

        if (!string.IsNullOrEmpty(selectedCompId) && selectedCompId != "-1")
        {
            compstr  = " and fca.CompID=" + selectedCompId;
            compstr1 = " and CompID=" + selectedCompId;
        }

        strwhere += " and id in ( select fca.CMID from YZT_FCArea fca left join BD_Distributor dis on (fca.Province+fca.City+fca.Area=dis.Province+dis.City+dis.Area or fca.Province+fca.City=dis.Province+dis.City or fca.Province=dis.Province) and dis.IsEnabled=1 where 1=1 and  dis.ID= " + this.DisID + compstr + " union select fcd.CMID from YZT_FCDis fcd where fcd.DisID=" + this.DisID + compstr1 + " union select ID from YZT_CMerchants where type=1 and dr=0" + compstr1 + ")";
        strwhere += compstr1;

        List <Hi.Model.YZT_CMerchants> l = CMerchantsBll.GetList(Pager.PageSize, Pager.CurrentPageIndex, "CreateDate", true, strwhere, out pageCount, out Counts);

        this.rptOrder.DataSource = l;
        this.rptOrder.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }