Beispiel #1
0
    public static string MakePickUpBill(string SLP_CustDateControl,
                                        string SLP_DateControl,
                                        string UserIdControl
                                        )
    {
        bool InsertOK = false;
        string OK = "";
        string PickNos = "";
        string MapNos = "";
        try
        {

            //return "2|PK908120001,PK908120002";

            int Day = int.Parse(DateTime.Now.AddDays(-9).ToString("yyyyMMdd"));
            int CustDay = int.Parse((DateTime.Parse(SLP_CustDateControl + " 00:00:00")).ToString("yyyyMMdd"));
            if (CustDay < Day)
            {
                return "0|客戶查補日不可小於系統日-9日";
            }

            IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB);
            ParameterList.Clear();
            ParameterList.Add(UserIdControl);
            ParameterList.Add(DateTime.Now.ToString("yyyyMMddHHmmss"));
            ParameterList.Add(SLP_CustDateControl);
            ParameterList.Add(SLP_DateControl);

            InsertOK = BCO.CreateByCRMTrans(ParameterList, null, out OK, out PickNos);

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

            return OK + "|" + PickNos;

        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Beispiel #2
0
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        string strErr = "";
        string UserID = Session["UID"].ToString();
        string PickDate = DateTime.Now.ToString("yyyyMMddHHmmss");
        string TransDate = this.SLP_CustDate.Text;
        string AcceptDate = this.SLP_Date.Text;

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

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

        if (SLP_CustDate.Text == string.Empty && SLP_Date.Text == string.Empty)
        {
            strErr = "請至少輸入一個條件";
            ErrorMsgLabel.Text = strErr;
            return;
        }
        else
        {
            int Day = int.Parse(DateTime.Now.AddDays(-9).ToString("yyyyMMdd"));
            int CustDay = int.Parse((DateTime.Parse(TransDate + " 00:00:00")).ToString("yyyyMMdd"));
            if (CustDay < Day)
            {
                strErr = "客戶查補日不可小於系統日-9日";
                ErrorMsgLabel.Text = strErr;
                return;
            }
        }

        try
        {
            IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB);
            ParameterList.Clear();
            ParameterList.Add(UserID);
            ParameterList.Add(PickDate);
            ParameterList.Add(TransDate);
            ParameterList.Add(AcceptDate);

            InsertOK = BCO.CreateByCRMTrans(ParameterList, null, out OK, out PickNo);

            if (OK == "0")
            {
                strErr = "查無符合條件的資料";
                ErrorMsgLabel.Text = strErr;
                return;
            }
            else
            {
                for (int i = 0; i < PickNo.Split(',').Length; i++)
                {
                    LstBoxPicks.Items.Add(PickNo.Split(',')[i].ToString());
                }

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

                LstBoxPicks.SelectedIndex = 0;
                if (OK == "2")
                {
                    strErr = "有商品於儲位庫存不足";
                }
            }
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM158", "DoPrint();", true);
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }