Esempio n. 1
0
    public static string MakePickUpBill(string ReturnNoControl,
                                        string SLP_DateControl,
                                        string SLP_PMAControl,
                                        string SLP_RootNoControl,
                                        string SLP_BLocateControl,
                                        string SLP_BLocateSecControl,
                                        string SLP_ELocateControl,
                                        string SLP_ELocateSecControl,
                                        string UserIdControl
                                        )
    {
        bool InsertOK = false;
        string OK = "";
        string PickNo = "";

        try
        {
            IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB);
            ParameterList.Clear();
            ParameterList.Add(UserIdControl);
            ParameterList.Add(DateTime.Now.ToString("yyyyMMddHHmmss"));
            ParameterList.Add(SLP_DateControl);
            ParameterList.Add(ReturnNoControl);
            ParameterList.Add(SLP_PMAControl);
            ParameterList.Add(SLP_RootNoControl);
            ParameterList.Add(SLP_BLocateControl + SLP_BLocateSecControl);
            ParameterList.Add(SLP_ELocateControl + SLP_ELocateSecControl);
            InsertOK = BCO.CreateByBackWard(ParameterList, null, out OK, out PickNo);

            if (OK == "0")
            {
                return "0|查無符合資料";
            }
            else
            {
                if (OK == "2")
                {
                    return "2|" + PickNo;

                }

            }

            return "1|" + PickNo;

        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Esempio n. 2
0
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        SLP_ELocateSec.Text = hid_ESec.Value;

        string strErr = "";
        string UserID = Session["UID"].ToString();
        string PickDate = DateTime.Now.ToString("yyyyMMddHHmmss");
        string InOutDate = SLP_Date.Text;
        string InOutNo = txtReturnNo.Text;
        string PMA = SLP_PMA.Text;
        string RootNo = SLP_RootNo.Text;
        string BLocateSec = SLP_BLocateSec.Text;
        string ELocateSec = SLP_ELocateSec.Text;

        TextBox txtBNo = (TextBox)this.SLP_BLocateSec.FindControl("TextBoxCode");
        TextBox txtENo = (TextBox)this.SLP_ELocateSec.FindControl("TextBoxCode");
        TextBox txtESec = (TextBox)this.SLP_ELocateSec.FindControl("TextBoxCode2");

        if (txtBNo.Text == txtENo.Text)
        {
            txtESec.Enabled = true;
        }
        else
        {
            txtESec.Enabled = false;
        }

        if (BLocateSec == string.Empty || ELocateSec == string.Empty)
        {
            strErr = "上下儲位不可為空白";
            ErrorMsgLabel.Text = strErr;
            return;
        }
        else
        {
            if (BLocateSec.Length != 6 || ELocateSec.Length != 6)
            {
                strErr = "上下儲位輸入錯誤";
                ErrorMsgLabel.Text = strErr;
                return;
            }
        }

        if (BLocateSec == ELocateSec)
        {
            strErr = "上下儲位不可相同";
            ErrorMsgLabel.Text = strErr;
            return;
        }

        string PickNo = string.Empty;
        string OK = string.Empty;
        bool InsertOK = false;

        //判斷必要條件
        if (this.SLP_Date.Text == string.Empty && txtReturnNo.Text == string.Empty)
        {
            strErr = "請至少輸入一個日期條件";
            ErrorMsgLabel.Text = strErr;
            return;
        }

        txtPickNo.Text = string.Empty;
        //btnRePrint.Enabled = false;
        btnMaintain.Enabled = false;

        try
        {
            IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB);
            ParameterList.Clear();
            ParameterList.Add(UserID);
            ParameterList.Add(PickDate);
            ParameterList.Add(InOutDate);
            ParameterList.Add(InOutNo);
            ParameterList.Add(PMA);
            ParameterList.Add(RootNo);
            ParameterList.Add(BLocateSec);
            ParameterList.Add(ELocateSec);

            InsertOK = BCO.CreateByBackWard(ParameterList, null, out OK, out PickNo);
            if (OK == "0")
            {
                strErr = "查無符合資料";
                //ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM153", "alert('" + strErr + "');", true);
                ErrorMsgLabel.Text = strErr;
                return;
            }
            else
            {
                //btnPrint.Enabled = false;
                //btnRePrint.Enabled = true;
                btnMaintain.Enabled = true;

                this.txtPickNo.Text = PickNo;

                if (OK == "2")
                {
                    strErr = "有商品於下架儲位庫存不足";
                    //ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM153", "alert('" + strErr + "');", true);
                    ErrorMsgLabel.Text = strErr;
                }
            }
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM153", "DoPrint();", true);
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }