Пример #1
0
    private string ProcessConfirm(string strStAcceptDate, string strDisNoForAry, Int32 iProcessingAryIndex)
    {
        #region
        bool bResult = false;
        string strCallbackResult = "";
        string strResult = "", strErrMsg = "";
        string strPrefixed = "POP_DisApproveError";
        string strDisNo = "", strNextDisNo = "";
        string[] strAryDisAry = strDisNoForAry.Split(";".ToCharArray());
        try
        {
            fmStatus = FormStatus.fmProcess;

            ALOModel.MaintainDisRecord BCO = new ALOModel.MaintainDisRecord(ConnectionDB);
            if (iProcessingAryIndex < strAryDisAry.Length)
            {

                strDisNo = strAryDisAry[iProcessingAryIndex];

                ArrayList ParameterList = new ArrayList();//20091113

                ParameterList.Clear();
                ParameterList.Add(strStAcceptDate);
                ParameterList.Add(strDisNo);
                ParameterList.Add("VDS_ALO_DIS_STORE");
                ParameterList.Add(Session["UID"].ToString());

                bResult = BCO.ProcessConfirm(ParameterList, out strResult, out strErrMsg, null);

                if (!bResult)
                {
                    Session[string.Format("{0}_DISNO_{1}", strPrefixed, PageTimeStamp.Value)] = string.Format("{0},", strDisNo);
                    Session[string.Format("{0}_OPTYPE_{1}", strPrefixed, PageTimeStamp.Value)] = "1";
                }

                iProcessingAryIndex = iProcessingAryIndex + 1;

                if (iProcessingAryIndex < strAryDisAry.Length)
                {
                    strNextDisNo = strAryDisAry[iProcessingAryIndex];
                }
                else
                {
                    strNextDisNo = "X";//表示已執行到最後一筆
                }

                //0:DIS_NO字串For陣列用-
                //1:下一筆陣列Index-
                //2:執行結果-
                //3:錯誤訊息-
                //4:要關閉執行狀態的DIS_NO-
                //5:要開啟執行狀態的DIS_NO-
                //6:是否有累積執行錯誤之DIS_NO-
                //7:ST_ACCEPT_DATE ClientID-
                //8:ResultMsgLabel ClientID-
                //9:ErrMsgLabel ClientID-
                //10:將再開啟之控制項字串陣列

                string strCtrlIDToUnLock = string.Format("{0}", btn_Query.ClientID);

                strCallbackResult = string.Format("{0}-{1}-{2}-{3}-{4}-{5}-{6}-{7}-{8}-{9}-{10}",
                    strDisNoForAry,
                    iProcessingAryIndex,
                    bResult ? "OK" : "NG",
                    strErrMsg,
                    strDisNo,
                    strNextDisNo,
                    Session[string.Format("{0}_DISNO_{1}", strPrefixed, PageTimeStamp.Value)] == null ? "0" : "1",
                    ((TextBox)SLP_SLPDate1.FindControl("TextBoxCode")).ClientID,
                    ResultMsgLabel.ClientID,
                    ErrorMsgLabel.ClientID,
                    strCtrlIDToUnLock
                    );
            }

        }
        catch (Exception ex)
        {
            throw ex;
        }

        return strCallbackResult;
        #endregion
    }
Пример #2
0
    private string ProcessConfirmFromBridge(string strStAcceptDate, string strDisNoForAry, string strCtrlPending, Int32 iProcessingAryIndex)
    {
        #region
        bool bResult = false, bResultCheck = false;
        string strCallbackResult = "";
        string strResult = "", strErrMsg = "", strErrMsgCheck = "";
        string strPrefixed = "POP_DisApproveError";
        string strDisNo = "", strNextDisNo = "";
        string strDIS_QTY = "";
        string[] strAryDisAry = strDisNoForAry.Split(";".ToCharArray());
        string[] strAryCtrlPending = strCtrlPending.Split(";".ToCharArray());

        try
        {
            fmStatus = FormStatus.fmProcess;

            ALOModel.MaintainDisRecord BCO = new ALOModel.MaintainDisRecord(ConnectionDB);
            if (iProcessingAryIndex < strAryDisAry.Length)
            {

                strDisNo = strAryDisAry[iProcessingAryIndex];

                ArrayList ParameterList = new ArrayList();//20091113

                //---------------------------------------------------------------------
                //2010/02/09 added:確認前檢核
                ALOModel.MaintainDisCRMRecord BCO3 = new ALOModel.MaintainDisCRMRecord(ConnectionDB);
                ParameterList.Clear();
                ParameterList.Add(strStAcceptDate);
                ParameterList.Add(strDisNo);
                try
                {
                    bResultCheck = BCO3.Pick_Control_Check(ParameterList, out strErrMsgCheck);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                //---------------------------------------------------------------------


                ParameterList.Clear();
                ParameterList.Add(strStAcceptDate);
                ParameterList.Add(strDisNo);
                ParameterList.Add("VDS_ALO_DIS_STORE");
                ParameterList.Add(strAryCtrlPending[5]);

                try
                {
                    bResult = BCO.ProcessConfirm(ParameterList, out strResult, out strErrMsg, null);
                }
                catch (Exception ex)
                {
                    throw ex;
                }


                if (!bResult)
                {
                    Session[string.Format("{0}_DISNO_{1}", strPrefixed, strAryCtrlPending[0])] += string.Format("{0},", strDisNo);
                    Session[string.Format("{0}_OPTYPE_{1}", strPrefixed, strAryCtrlPending[0])] = "1";
                    Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strAryCtrlPending[0])] += string.Format("配本序號:{0},{1}{2}{3};\r\n", strDisNo, strErrMsgCheck, bResultCheck ? "" : ",", strErrMsg);
                }
                else
                {
                    if (!bResultCheck)
                    {
                        Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strAryCtrlPending[0])] += string.Format("配本序號:{0},{1};\r\n", strDisNo, strErrMsgCheck);
                    }
                }


                ALOModel.ProcessMultiDisRecords BCO2 = new ALOModel.ProcessMultiDisRecords(ConnectionDB);
                DataTable dtTemp = BCO2.QueryDisItemForALO20(GetQueryParams(strStAcceptDate, strDisNo, bResult));
                if (dtTemp != null && dtTemp.Rows.Count > 0)
                    strDIS_QTY = dtTemp.Rows[0]["DIS_QTY"].ToString().Trim();

                iProcessingAryIndex = iProcessingAryIndex + 1;

                if (iProcessingAryIndex < strAryDisAry.Length)
                {
                    strNextDisNo = strAryDisAry[iProcessingAryIndex];
                }
                else
                {
                    strNextDisNo = "X";//表示已執行到最後一筆
                }

                //0:DIS_NO字串For陣列用-
                //1:下一筆陣列Index-
                //2:執行結果-
                //3:錯誤訊息-
                //4:要關閉執行狀態的DIS_NO-
                //5:要開啟執行狀態的DIS_NO-
                //6:是否有累積執行錯誤之DIS_NO-
                //7:ST_ACCEPT_DATE ClientID-
                //8:ResultMsgLabel ClientID-
                //9:ErrMsgLabel ClientID-
                //10:將再開啟之控制項字串陣列
                //11:DIS_QTY
                string strCtrlIDToUnLock = string.Format("{0}", strAryCtrlPending[1]);

                strCallbackResult = string.Format("{0}-{1}-{2}-{3}-{4}-{5}-{6}-{7}-{8}-{9}-{10}-{11}",
                    strDisNoForAry,
                    iProcessingAryIndex,
                    bResult ? "OK" : "NG",
                    Session[string.Format("{0}_ERRMSG_{1}", strPrefixed, strAryCtrlPending[0])].ToString(),//strErrMsg,
                    strDisNo,
                    strNextDisNo,
                    Session[string.Format("{0}_DISNO_{1}", strPrefixed, strAryCtrlPending[0])] == null ? "0" : "1",
                    strAryCtrlPending[2],
                    strAryCtrlPending[3],
                    strAryCtrlPending[4],
                    strCtrlIDToUnLock,
                    strDIS_QTY
                    );
            }

        }
        catch (Exception ex)
        {
            throw ex;
        }

        return strCallbackResult;
        #endregion
    }