Ejemplo n.º 1
0
    /// <summary>
    /// 绑定库位
    /// </summary>
    public void BindWareLocator(DropDownList ddlWareLocator, string wareNo)
    {
        using (LWareLocatorBB wareLocatorBB = new LWareLocatorBB())
        {
            DataSet ds = new DataSet();
            ds = wareLocatorBB.GetList("isDel=0 and wareNo='" + wareNo + "'");

            ddlWareLocator.DataTextField = "wareLocatorNm";
            ddlWareLocator.DataValueField = "wareLocatorNo";
            ddlWareLocator.DataSource = ds.Tables[0];
            ddlWareLocator.DataBind();
            ddlWareLocator.Items.Insert(0, new ListItem("-请选择-", ""));
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 绑定库位下拉框
    /// </summary>
    /// <param name="cb"></param>
    private void BindWareLocator(DropDownList ddlWareLocator)
    {
        LWareLocatorBB wareLocatorBB = new LWareLocatorBB();

        try
        {
            DataTable dt = new DataTable();

            dt = wareLocatorBB.GetList(" wareNo='GZT' and isnull(downWareLocatorNo,'')<>''").Tables[0];

            ddlWareLocator.DataTextField = "wareLocatorNm";
            ddlWareLocator.DataValueField = "wareLocatorNo";
            ddlWareLocator.DataSource = dt;
            ddlWareLocator.DataBind();
            ddlWareLocator.Items.Insert(0, new ListItem("-请选择-", ""));
        }
        finally
        {
            wareLocatorBB.Dispose();
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 验证页面信息
    /// </summary>
    /// <param name="strErrorInfo">错误提示信息</param>
    /// <returns></returns>
    private bool ValidateData(out string strErrorInfo)
    {
        LWareLocatorBB wareLocatorBB = new LWareLocatorBB();

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

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

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

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

            if (this.ddlWare.SelectedValue == "")
            {
                strErrorInfo = "请首先选择库区!";
                this.ddlWare.Focus();
                return false;
            }

            if (this.tbMaxBoxNum.Text.Trim() != "" && !CommFunction.IsInt(this.tbMaxBoxNum.Text.Trim()))
            {
                strErrorInfo = "最多放置箱数不是正确的数字类型!";
                this.tbMaxBoxNum.Focus();
                return false;
            }

            return true;
        }
        finally
        {
            wareLocatorBB.Dispose();
        }
    }