Пример #1
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    public void Bind()
    {
        int    Counts   = 0;
        string strwhere = " and isnull(dr,0)=0";

        if (SalesManID > 0 || OrgID > 0)
        {
            string whereIn = string.Empty;
            if (OrgID > 0)
            {
                whereIn += "  and OrgID=" + OrgID + "";
            }
            if (SalesManID > 0)
            {
                whereIn += " and SalesManID=" + SalesManID + "";
            }
            strwhere = " and CompID in (select ID from [dbo].[BD_Company] where  isnull(dr,0)=0 " + whereIn + ")";
        }
        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }

        if (this.txtPager.Value.Trim().ToString() != "")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }
        //if (this.txtCreateDate.Value.Trim() == "" && this.txtECreateDate.Value.Trim() == "")
        //{
        //    strwhere += " and CreateDate>='" + DateTime.Now.AddDays(1 - DateTime.Now.Day).ToShortDateString() + " 0:0:0' ";
        //}
        strwhere += "and Otype!=9 and isnull(dr,0)=0 and OState in(2,4,5) ";

        List <Hi.Model.DIS_Order> l   = OrderInfoBLL.GetList(Pager.PageSize, Pager.CurrentPageIndex, "CreateDate", true, strwhere, out pageCount, out Counts);
        List <Hi.Model.DIS_Order> dis = OrderInfoBLL.GetList("", "isnull(dr,0)=0 and Otype!=9 and OState in(2,4,5)" + strwhere, "");

        for (int i = 0; i < dis.Count; i++)
        {
            ta += dis[i].AuditAmount;
            tb += dis[i].PayedAmount;
        }
        this.rptOrder.DataSource = l;
        this.rptOrder.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
        this.Org.SelectedValue = this.OrgID == 0 ? Org.SelectedValue : this.OrgID.ToString();
    }
Пример #2
0
    /// <summary>
    /// 绑定销售订单信息列表
    /// </summary>
    public void Bind()
    {
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = string.Empty;

        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }
        strwhere += "and CompID=" + CompID + " and Otype!=9  and OState in (2,3,4,5,7) and isnull(vdef1,0) in (0,1)  and isnull(dr,0)=0 and  (PayState in (0,1)  or  (PayState=2 and ID in (select OrderID from pay_prepayment where PreType=7)))"; //IsDel=1  订单已删除

        if (this.txtPager.Value.Trim().ToString() != "" && this.txtPager.Value.Trim().ToString() != "0")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }

        List <Hi.Model.DIS_Order> l = OrderInfoBLL.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();
    }
Пример #3
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    public void Bind()
    {
        int    Counts   = 0;
        string strwhere = string.Empty;

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

        if (this.txtPager.Value.Trim().ToString() != "")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }
        strwhere += "and Otype!=9 and isnull(dr,0)=0 and OState in(2,4,5) and compID=" + this.CompID;

        List <Hi.Model.DIS_Order> l   = OrderInfoBLL.GetList(Pager.PageSize, Pager.CurrentPageIndex, "CreateDate", true, strwhere, out pageCount, out Counts);
        List <Hi.Model.DIS_Order> dis = OrderInfoBLL.GetList("", "Otype!=9 and isnull(dr,0)=0 and OState in(2,4,5) " + strwhere, "");

        for (int i = 0; i < dis.Count; i++)
        {
            ta += dis[i].AuditAmount;
            tb += dis[i].PayedAmount;
        }
        this.rptOrder.DataSource = l;
        this.rptOrder.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Пример #4
0
    /// <summary>
    /// 绑定销售订单信息列表
    /// </summary>
    public void Bind()
    {
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = string.Empty;

        string IDlist = string.Empty;//销售经理下属 员工ID集合

        if (DisSalesManID != 0)
        {
            if (Common.GetDisSalesManType(DisSalesManID.ToString(), out IDlist))
            {
                //销售经理
                strwhere = "and DisID in(select ID from BD_Distributor where smid in(" + IDlist + "))";
            }
            else
            {
                strwhere = "and DisID in(select ID from BD_Distributor where smid = " + DisSalesManID + ")";
            }
        }

        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }
        strwhere += "and CompID=" + CompID + " and Otype=9  and OState in (2,3,4,5,6,7) and isnull(vdef1,0) in (0,1)  and isnull(dr,0)=0 and  (PayState in (0,1)  or  (PayState=2 and ID in (select OrderID from pay_prepayment where PreType=8)))"; //IsDel=1  订单已删除

        if (this.txtPager.Value.Trim().ToString() != "" && this.txtPager.Value.Trim().ToString() != "0")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }

        List <Hi.Model.DIS_Order> l = OrderInfoBLL.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();
    }
Пример #5
0
    /// <summary>
    /// 绑定销售订单信息列表
    /// </summary>
    public void Bind()
    {
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = string.Empty;

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

        if (Request.QueryString["type"] + "" == "2")
        {
            //待收款订单
            strwhere += " and (( Otype=1 and OState not in (-1,0,1)  and PayState in(0,1) ) or( Otype<>1 and OState in (2,4,5) and PayState in(0,1))) and OState<>6   and CompID='" + this.CompID + "' and ReturnState=0 and isnull(dr,0)=0"; //IsDel=1  订单已删除
            this.ddrPayState.Value = "0";
        }
        else
        {
            strwhere += "and CompID=" + this.CompID + " and OState>=" + (int)Enums.OrderState.待审核 + " and otype=9  and isnull(dr,0)=0"; //IsDel=1  订单已删除
        }

        if (this.txtPager.Value.Trim().ToString() != "" && this.txtPager.Value.Trim().ToString() != "0")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }

        List <Hi.Model.DIS_Order> l = OrderInfoBLL.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();
    }
Пример #6
0
    /// <summary>
    /// 绑定销售订单信息列表
    /// </summary>
    public void Bind()
    {
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = string.Empty;
        string IDlist    = string.Empty;//销售经理下属 员工ID集合

        if (DisSalesManID != 0)
        {
            if (Common.GetDisSalesManType(DisSalesManID.ToString(), out IDlist))
            {
                //销售经理
                strwhere = "and DisID in(select ID from BD_Distributor where smid in(" + IDlist + "))";
            }
            else
            {
                strwhere = "and DisID in(select ID from BD_Distributor where smid = " + DisSalesManID + ")";
            }
        }

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

        #region
        if (Request.QueryString["type"] + "" == "2")
        {
            //待收款订单
            strwhere += " and (( Otype=1 and OState not in (-1,0,1)  and PayState in(0,1) ) or( Otype<>1 and OState in (2,4,5) and PayState in(0,1))) and OState<>6   and CompID='" + this.CompID + "' and ReturnState=0 and Otype!=9 and isnull(dr,0)=0"; //IsDel=1  订单已删除
            this.ddrPayState.Value           = "0";
            ddrOState.Attributes["disabled"] = "false";
        }
        else if (Request.QueryString["type"] + "" == "1")
        {
            //待审核
            strwhere       += " and OState=1 and Otype<>9 and isnull(dr,0)=0 and CompID='" + this.CompID + "'";
            ddrOState.Value = "0";
            ddrOState.Attributes["disabled"] = "false";
        }
        else if (Request.QueryString["type"] + "" == "3")
        {
            //待发货
            strwhere       += " and (OState=" + (int)Enums.OrderState.已审 + " or (OState=" + (int)Enums.OrderState.已发货 + " and IsOutState in (0,1,2))) and Otype<>9 and isnull(dr,0)=0 and CompID='" + this.CompID + "'";
            ddrOState.Value = "0";
            ddrOState.Attributes["disabled"] = "false";
        }
        else
        {
            strwhere += "and CompID=" + this.CompID + " and OState>=" + (int)Enums.OrderState.待审核 + "and Otype!=9 and isnull(dr,0)=0"; //IsDel=1  订单已删除
        }
        #endregion

        if (this.txtPager.Value.Trim().ToString() != "" && this.txtPager.Value.Trim().ToString() != "0")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                PageSize = Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }

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

        foreach (var item in l)
        {
            oId += item.ID + ",";
        }
        oId += "0";

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

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Пример #7
0
    /// <summary>
    /// 绑定销售订单信息列表
    /// </summary>
    public void Bind()
    {
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = " and isnull(dr,0)=0 ";

        //if (SalesManID != null && SalesManID != 0)
        //{
        //    strwhere += " and CompID in (select ID from [dbo].[BD_Company] where orgid=" + OrgID + " and SalesManID=" + SalesManID + " and isnull(dr,0)=0)";
        //}

        if (SalesManID > 0 || OrgID > 0)
        {
            string whereIn = string.Empty;
            if (OrgID > 0)
            {
                whereIn += "  and OrgID=" + OrgID + "";
            }
            if (SalesManID > 0)
            {
                whereIn += " and SalesManID=" + SalesManID + "";
            }
            strwhere += " and CompID in (select ID from [dbo].[BD_Company] where  isnull(dr,0)=0 " + whereIn + ")";
        }
        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }
        strwhere += "and Otype!=9 and isnull(dr,0)=0"; //IsDel=1  订单已删除

        if (this.txtPager.Value.Trim().ToString() != "")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }

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

        this.rptOrder.DataSource = l;

        //查询制单人列表
        List <int> ids = l.Select(T => T.CreateUserID).Distinct().ToList();

        if (ids != null && ids.Count > 0)
        {
            userList = new Hi.BLL.SYS_Users().GetList("TrueName,ID", " ID in(" + string.Join(",", ids) + ") ", "");
        }

        this.rptOrder.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
        this.Org.SelectedValue = (this.OrgID == 0 ? Org.SelectedValue : this.OrgID.ToString());
    }