示例#1
0
    private bool CheckData()
    {
        BCO.ConfirmStockTake bco = new BCO.ConfirmStockTake(ConntionDB);

        string strLocateNo = string.Empty;
        string strResult = string.Empty;
        bco.GetLocateNo(this.txtStocktakeNo.Text, out strLocateNo, out strResult);
        if (strResult == "0")
        {
            ShowErrorMessage("此盤點單號不存在");
            ScriptManager.RegisterStartupScript(this.UpdatePanel3, typeof(UpdatePanel), "隨便寫", "document.getElementById('" + this.txtStocktakeNo.ClientID + "').focus();", true);
            return false;
        }

        if (lblLocateNo.Text.Trim() == "")
        {
            ShowErrorMessage("請輸入 [儲區]");
            return false;
        }

        bool isExist = false;
        DataTable dtData = queryData(out isExist);
        if (dtData.Rows.Count == 0)
        {
            if (isExist == false)
            {
                ShowErrorMessage("查無待確認資料");
                return false;
            }
        }

        return true;
    }
示例#2
0
    private void ddlDatabind()
    {
        BCO.ConfirmStockTake bco = new BCO.ConfirmStockTake(ConntionDB);

        string strLocateNo = string.Empty;
        string strResult = string.Empty;
        bco.GetLocateNo(this.txtStocktakeNo.Text, out strLocateNo, out strResult);
        if (strResult == "0")
        {

            lblLocateNo.Text = "";
            lblStocktakeNo.Text = "";
            ddlS.Items.Clear();
            ddlE.Items.Clear();
            GridView1.DataBind();
            //txtStocktakeNo.Focus();
            if (txtStocktakeNo.Text.Trim() != "")
            {
                ShowErrorMessage("此盤點單號不存在");
                ScriptManager.RegisterStartupScript(this.UpdatePanel3, typeof(UpdatePanel), "隨便寫", "document.getElementById('" + this.txtStocktakeNo.ClientID + "').focus();", true);
            }
            ScriptManager.RegisterStartupScript(this.UpdatePanel3, typeof(UpdatePanel), "ButtonControl", "DisableButton();", true);
        }
        else
        {
            lblLocateNo.Text = strLocateNo;

            DataTable Dt = null;
            Dt = bco.GetLocateSection(this.txtStocktakeNo.Text);
            this.ddlS.DataSource = Dt;
            this.ddlS.DataTextField = "LOCATE_SECTION";
            this.ddlS.DataValueField = "LOCATE_SECTION";
            this.ddlS.DataBind();
            this.ddlS.Items.Insert(0, "     ");
            this.ddlE.DataSource = Dt;
            this.ddlE.DataTextField = "LOCATE_SECTION";
            this.ddlE.DataValueField = "LOCATE_SECTION";
            this.ddlE.DataBind();
            this.ddlE.Items.Insert(0, "     ");

            Dt = CreateEmptyTable();
            GridView1.DataSource = Dt;
            GridView1.DataBind();

            lblStocktakeNo.Text = "";
            ScriptManager.RegisterStartupScript(this.UpdatePanel3, typeof(UpdatePanel), "ButtonControl", "EnableButton();", true);
        }

    }