Exemple #1
0
    private string ProcessCalculateFromBridge(string strDisNoForAry, string strITEM, string strPERIOD, string strCAL_NONEFF, string strUSERID, string strDIS_TYPE, string strROOT_NO, string strCtrlPending, Int32 iProcessingAryIndex)
    {
        #region
        bool bResult = false;
        string strCallbackResult = "";
        string strResult = "", strErrMsg = "";
        string strDisNo = "", strNextDisNo = "";
        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)
            {

                //2010/04/27 added:for clear Session
                if (iProcessingAryIndex == 0)
                {
                    Session[string.Format("{0}_DISNO_{1}", strPreFixed, strAryCtrlPending[0])] = null;
                }


                strDisNo = strAryDisAry[iProcessingAryIndex];

                ArrayList ParameterList = new ArrayList();
                ParameterList.Clear();
                ParameterList.Add(strDisNo);
                ParameterList.Add(strITEM);
                ParameterList.Add(strPERIOD);
                ParameterList.Add(strCAL_NONEFF);
                ParameterList.Add(strUSERID);
                ParameterList.Add(strDIS_TYPE);
                ParameterList.Add(strROOT_NO);

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

                if (!bResult)
                {
                    Session[string.Format("{0}_DISNO_{1}", strPreFixed, strAryCtrlPending[0])] = string.Format("{0},", strDisNo);
                }

                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:ResultMsgLabel ClientID
                //8:ErrMsgLabel ClientID
                //9:將再開啟之控制項字串陣列

                string strCtrlIDToUnLock = string.Format("{0},{1}", strAryCtrlPending[0], strAryCtrlPending[1]);

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

        }
        catch (Exception ex)
        {
            throw ex;
        }

        return strCallbackResult;
        #endregion
    }