Exemplo n.º 1
0
    public static string MakePickUpBill(string SLP_BLocateControl,
                                        string SLP_BLocateSecControl,
                                        string SLP_ELocateControl,
                                        string SLP_ELocateSecControl,
                                        string UserIdControl
                                        )
    {
        bool InsertOK = false;
        string OK = "";
        string PickNo = "";
        string PickDate = DateTime.Now.ToString("yyyyMMddHHmmss");

        try
        {
            IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB);

            ParameterList.Clear();
            ParameterList.Add(UserIdControl);
            ParameterList.Add(PickDate);
            ParameterList.Add("");
            ParameterList.Add(SLP_BLocateControl + SLP_BLocateSecControl);
            ParameterList.Add(SLP_ELocateControl + SLP_ELocateSecControl);
            InsertOK = BCO.CreateByLocateSec(ParameterList, null, out OK, out PickNo);

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

            return "1|" + PickNo;

        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Exemplo n.º 2
0
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        ErrorMsgLabel.Text = "";
        string strErr = "";
        //判斷資料輸入完整性
        if (SLP_BLocateSec.Text == string.Empty || SLP_BLocateSec.Text.Length != 6 || SLP_ELocateSec.Text == string.Empty || SLP_ELocateSec.Text.Length != 6)
        {
            strErr = "上下架儲位輸入不完整,請重新輸入";
            ErrorMsgLabel.Text = strErr;
            return;
        }

        if (SLP_BLocateSec.Text == SLP_ELocateSec.Text)
        {
            strErr = "上下架儲位不得相同,請重新輸入";
            ErrorMsgLabel.Text = strErr;
            return;
        }

        string UserID = Session["UID"].ToString();
        string PickDate = DateTime.Now.ToString("yyyyMMddHHmmss");
        string BLocateSec = SLP_BLocateSec.Text;
        string ELocateSec = SLP_ELocateSec.Text;

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

        this.txtPickNo.Text = string.Empty;

        //this.btnRePrint.Enabled = false;
        this.btnMaintain.Enabled = false;

        try
        {
            IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB);

            ParameterList.Clear();
            ParameterList.Add(UserID);
            ParameterList.Add(PickDate);
            ParameterList.Add("");
            ParameterList.Add(SLP_BLocateSec.Text);
            ParameterList.Add(SLP_ELocateSec.Text);
            InsertOK = BCO.CreateByLocateSec(ParameterList, null, out OK, out PickNo);

            if (OK == "0")
            {
                //this.btnPrint.Enabled = true;
                strErr = "查無符合條件的資料";
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM159", "alert('" + strErr + "');", true);
                return;
            }
            else
            {
                this.txtPickNo.Text = PickNo;
                //this.btnPrint.Enabled = false;
                this.btnMaintain.Enabled = true;
                //this.btnRePrint.Enabled = true;
            }
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM159", "DoPrint();", true);
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }