public void BindWare(DropDownList ddlWare)
    {
        using (LWareBB wareBB = new LWareBB())
        {
            DataSet ds = new DataSet();
            ds = wareBB.GetList("isDel=0");

            ddlWare.DataTextField = "wareNm";
            ddlWare.DataValueField = "wareNo";
            ddlWare.DataSource = ds.Tables[0];
            ddlWare.DataBind();
            ddlWare.Items.Insert(0, new ListItem("-请选择-", ""));
        }
    }
    /// <summary>
    /// 验证页面信息
    /// </summary>
    /// <param name="strErrorInfo">错误提示信息</param>
    /// <returns></returns>
    private bool ValidateData(out string strErrorInfo)
    {
        LWareBB wareBB = new LWareBB();

        try
        {
            strErrorInfo = "";
            DataSet ds = new DataSet();

            if (this.tbWareNo.Text.Trim() == "")
            {
                strErrorInfo = "请首先填写库区编码!";
                this.tbWareNo.Focus();
                return false;
            }

            //判断库区编码是否重复
            ds = wareBB.GetList("wareNo='" + this.tbWareNo.Text.Trim().Replace("'", "''") + "' and id<>" + this.IdValue.ToString());
            if (ds.Tables[0].Rows.Count > 0)
            {
                strErrorInfo = "库区编码重复!";
                this.tbWareNo.Focus();
                return false;
            }

            if (this.tbWareNm.Text.Trim() == "")
            {
                strErrorInfo = "请首先填写库区名称!";
                this.tbWareNm.Focus();
                return false;
            }

            if (this.ddlWareType.SelectedValue == "")
            {
                strErrorInfo = "请首先选择仓库类别!";
                this.ddlWareType.Focus();
                return false;
            }

            if (this.ddlWareSort.SelectedValue == "")
            {
                strErrorInfo = "请首先选择货位分类!";
                this.ddlWareSort.Focus();
                return false;
            }

            return true;
        }
        finally
        {
            wareBB.Dispose();
        }
    }
    public DataTable GetWareByWareNo(string strWareNo)
    {
        using (LWareBB wareBB = new LWareBB())
        {
            DataSet ds = new DataSet();
            string strWhere = "wareNo='" + strWareNo + "'";

            ds = wareBB.GetList(strWhere);

            return ds.Tables[0];
        }
    }
    public bool IsWareLocatorUsing(string strWareLocatorNo)
    {
        LWareLocatorBB wareLocatorBB = new LWareLocatorBB();
        LWareBB wareBB = new LWareBB();

        try
        {
            DataTable dtWare = new DataTable();
            DataTable dtWareLocator = new DataTable();

            dtWare = wareBB.GetList("wareNo='" + strWareLocatorNo + "'").Tables[0];//获取库区
            dtWareLocator = wareLocatorBB.GetVList("wareLocatorNo='" + strWareLocatorNo + "'").Tables[0];//获取库位

            //如果扫描的为库区,返回true
            if (dtWare.Rows.Count > 0)
            {
                return false;
            }

            //判断库位是否正在使用
            if (dtWareLocator.Rows.Count == 0)
            {
                return true;
            }
            else if (dtWareLocator.Rows[0]["wareType"].ToString() == "07"
                || dtWareLocator.Rows[0]["isUsing"] == DBNull.Value
                || Convert.ToBoolean(dtWareLocator.Rows[0]["isUsing"]) == false)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
        finally
        {
            wareLocatorBB.Dispose();
            wareBB.Dispose();
        }
    }
    public DataTable GetWare(string strWareType)
    {
        using (LWareBB wareBB = new LWareBB())
        {
            DataSet ds = new DataSet();
            string strWhere = "isDel=0";

            if (strWareType != "")
            {
                strWhere += " and wareType='" + strWareType + "'";
            }

            ds = wareBB.GetList(strWhere);

            return ds.Tables[0];
        }
    }