コード例 #1
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    public void Bind()
    {
        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();
        }
        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);
            }
        }

        string sql = string.Empty;

        if (paymentid > 0)
        {
            sql = "SELECT case sxf when '' then null else sxf end as sxf1,isnull(Price,0) as Price1,* FROM [dbo].[CompCollection_view] where pretype=" + pretype + " and  paymentid=" + paymentid + " and status=1 order by Date  desc";
        }
        else
        {
            sql = "SELECT case sxf when '' then null else sxf end as sxf1,isnull(Price,0) as Price1,* FROM [dbo].[CompCollection_view] where OrderID in(select ID from Dis_Order where ISNULL(dr,0)=0 and  (Otype<>9) and CompID=" + this.CompID + ")   and status=1 and CompID=" + this.CompID + strwhere
                  + " order by Date  desc";
        }

        Pagger pagger = new Pagger(sql);

        Pager.RecordCount = pagger.GetDataCount(sql);

        DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1);

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

        page = Pager.CurrentPageIndex.ToString();
    }
コード例 #2
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    public void Bind()
    {
        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();
        }
        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);
            }
        }

        string sql = "SELECT * FROM [dbo].[CompCollection_view] " + " where OrderID  in(select ID from Dis_Order where ISNULL(dr,0)=0 and Otype=9 and CompID=" + this.CompID + ") and CompID=" + this.CompID + strwhere
                     + " order by Date desc";

        Pagger pagger = new Pagger(sql);

        Pager.RecordCount = pagger.GetDataCount(sql);

        DataTable dt = pagger.getData(Pager.PageSize, Pager.StartRecordIndex - 1);
        DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0];

        for (int i = 0; i < ds.Rows.Count; i++)
        {
            ta += Convert.ToDecimal(ds.Rows[i]["Price"].ToString() == "" ? "0" : ds.Rows[i]["Price"].ToString()) - Convert.ToDecimal(ds.Rows[i]["sxf"].ToString() == "" ? "0" : ds.Rows[i]["sxf"].ToString());
        }
        this.rptOrder.DataSource = dt;
        this.rptOrder.DataBind();

        page = Pager.CurrentPageIndex.ToString();
    }
コード例 #3
0
ファイル: PayDisList.aspx.cs プロジェクト: kkwkk/ybyzt
    /// <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 ID in(select ID from BD_Distributor where smid in(" + IDlist + "))";
            }
            else
            {
                strwhere = "and ID in(select ID from BD_Distributor where smid = " + DisSalesManID + ")";
            }
        }

        strwhere += " and dr=0 and AuditState=2 and CompID =" + CompID;

        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);
            }
        }



        List <Hi.Model.BD_Distributor> dis = new Hi.BLL.BD_Distributor().GetList(Pager.PageSize, Pager.CurrentPageIndex, "shortindex", true, strwhere, out pageCount, out Counts);

        this.rptDis.DataSource = dis;
        this.rptDis.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
コード例 #4
0
    /// <summary>
    /// 查询条件
    /// </summary>
    /// <returns></returns>
    public string SearchWhere()
    {
        string where = " and cu.compid=" + CompID + " and cu.IsAudit>0 and isnull(cu.dr,0)=0 and isnull(dis.dr,0)=0";
        string IDlist = string.Empty;//销售经理下属 员工ID集合

        if (DisSalesManID != 0)
        {
            if (Common.GetDisSalesManType(DisSalesManID.ToString(), out IDlist))
            {
                //销售经理
                where += "and cu.DisID in(select ID from BD_Distributor where smid in(" + IDlist + "))";
            }
            else
            {
                where += "and cu.DisID in(select ID from BD_Distributor where smid = " + DisSalesManID + ")";
            }
        }
        if (!string.IsNullOrEmpty(txtDisName.Value.Trim()))
        {
            where += " and (dis.DisCode like '%" + txtDisName.Value.Trim().Replace("'", "''") + "%' or dis.DisName like '%" + txtDisName.Value.Trim().Replace("'", "''") + "%')";
        }
        //if (!string.IsNullOrEmpty(txtDisArea.areaId))
        //{
        //    where += " and areaid='" + txtDisArea.areaId + "'";
        //}
        if (!string.IsNullOrEmpty(txtPhone.Value.Trim()))
        {
            where += " and dis.Phone like '%" + txtPhone.Value.Trim().Replace("'", "''") + "%'";
        }
        if (!string.IsNullOrEmpty(txtPrincipal.Value.Trim()))
        {
            where += " and dis.Principal like '%" + txtPrincipal.Value.Trim().Replace("'", "''") + "%'";
        }
        if (ddlAUState.SelectedValue != "-1")
        {
            where += " and cu.IsAudit='" + ddlAUState.SelectedValue + "'";
        }
        if (ddlState.SelectedValue != "-1")
        {
            where += " and cu.IsEnabled='" + ddlState.SelectedValue + "'";
        }
        if (txtCreateDate.Value.Trim() != "")
        {
            where += " and dis.createdate>='" + txtCreateDate.Value.Trim() + "' ";
        }
        if (txtEndCreateDate.Value.Trim() != "")
        {
            where += " and dis.createdate<='" + txtEndCreateDate.Value.Trim() + "' ";
        }
        return(where);
    }
コード例 #5
0
ファイル: PayZdblList.aspx.cs プロジェクト: kkwkk/ybyzt
    /// <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();
    }
コード例 #6
0
ファイル: OrderCreateList.aspx.cs プロジェクト: kkwkk/ybyzt
    /// <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
ファイル: OrderReturnList.aspx.cs プロジェクト: kkwkk/ybyzt
    /// <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();
        }

        if (this.ddrState.Value != "-2")
        {
            strwhere += " and ReturnState=" + Common.NoHTML(this.ddrState.Value.Trim().ToString());
        }

        string type = Request.QueryString["type"] + "";

        if (type == "")
        {
            this.Ostate1.Attributes.Add("style", "display:block;");
            this.Ostate2.Attributes.Add("style", "display:block;");
            strwhere += "and CompID=" + this.CompID + " and (ReturnState>" + (int)Enums.AuditState.未提交 + " or ReturnState=" + (int)Enums.AuditState.退回 + ") and isnull(dr,0)=0"; //IsDel=1  订单已删除
        }
        else
        {
            this.Ostate1.Attributes.Add("style", "display:none;");
            this.Ostate2.Attributes.Add("style", "display:none;");
            strwhere += "and CompID=" + this.CompID + " and ReturnState>=" + (int)Enums.AuditState.已审 + " and OrderID in (select Id from DIS_Order where PayState=" + (int)Enums.PayState.已支付 + ") 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_OrderReturn> l = OrderReturnBll.GetList(Pager.PageSize, Pager.CurrentPageIndex, "ReturnDate", false, strwhere, out pageCount, out Counts);

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

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