Example #1
0
    public static string TransAcceptBridgeAtServer(string ProcessingArgument)
    {
        #region
        string[] strAryArg = ProcessingArgument.Split(",".ToCharArray());
        string CallServerValue = strAryArg[0];
        string ObjectFrom = strAryArg[1];
        string CtrlPending = strAryArg[2];
        string strResult = "";
        string strErrMsg = "";
        bool bResult = false;

        string[] strAry = CallServerValue.Split("_".ToCharArray());
        string[] strAryCtrlPending = CtrlPending.Split(";".ToCharArray());



        ALO_ALO211 ALO211 = new ALO_ALO211();
        LogEventErrorHandler LEH = new LogEventErrorHandler();
        string strLogFileFolder = HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["LogFolder"]).Replace("ALO\\", "");
        string strLogFileName = string.Format("{0}_{1}.log", "ALO21", DateTime.Now.ToString("yyyyMMdd"));
        string strLogFilePath = string.Format("{0}\\{1}", strLogFileFolder, strLogFileName);
        //2010-05-01 cyhsu 
        HttpContext.Current.Session[string.Format("ALO21_TransResult_{0}", strAry[4])] = null;
        try
        {
            #region
            LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 0】準備轉門市進貨單", ObjectFrom), false);

            LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 1-1】檢核輸入參數是否異常,輸入參數:{1}", ObjectFrom, CallServerValue), false);

            if (strAry.Length != 5)
            {
                throw new Exception(string.Format("TransAcceptBridgeAtServer:{0};輸入參數:{1}。", "輸入參數個數異常", CallServerValue));
            }

            LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 1-2】檢核輸出參數是否異常,輸出參數:{1}", ObjectFrom, CtrlPending), false);

            if (strAryCtrlPending.Length != 3)
            {
                throw new Exception(string.Format("TransAcceptBridgeAtServer:{0};輸出參數:{1}。", "輸出參數個數異常", CtrlPending));
            }

            LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 2-0】開始執行轉門市進貨單作業", ObjectFrom), false);

            bResult = ALO211.ProcessCreateMultiStoreAccepts2(strAry[0], strAry[1], strAry[2], strAry[3], strAry[4], out strErrMsg);

            LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 3】結束轉門市進貨單作業並組回傳字串", ObjectFrom), false);

            if (ObjectFrom.IndexOf("TRANSACCEPT") != -1) //轉門市進貨單
            {
                strResult = string.Format("{0}-{1}-{2}-{3}-{4}-{5}-{6}-{7}-{8}", bResult.ToString().ToLower(), strErrMsg,
                            "TRANSACCEPT", strAryCtrlPending[0], strAryCtrlPending[1], strAryCtrlPending[2], strAry[0], strAry[1], strAry[2]);

                LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 4】組成並回傳PageMethod字串:{1}", ObjectFrom, strResult), true);

            }
            #endregion
        }
        catch (Exception ex)
        {
            LEH.WriteErrorLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}執行發生異常】", ObjectFrom), ex, true);
            throw ex;
        }
        HttpContext.Current.Session[string.Format("ALO21_TransResult_{0}", strAry[4])] = strResult;
        return strResult;

        #endregion
    }
Example #2
0
    public static string CheckCheckDataResult(string ProcessingArgument)
    {
        //strAryArg[0] = UserId 
        //strAryArg[1] = PageTimeStamp

        string[] strAryArg = ProcessingArgument.Split(",".ToCharArray());
        string strResult = "";

        LogEventErrorHandler LEH = new LogEventErrorHandler();
        string strLogFileFolder = HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["LogFolder"]).Replace("ALO\\", "");
        string strLogFileName = string.Format("{0}_{1}.log", "ALO21", DateTime.Now.ToString("yyyyMMdd"));
        string strLogFilePath = string.Format("{0}\\{1}", strLogFileFolder, strLogFileName);
        LEH.WriteEventLog(strLogFilePath, strAryArg[0], strAryArg[1], "【CheckTransAcceptResult.STEP 0】檢查轉單後結果", false);

        try
        {
            if (HttpContext.Current.Session[string.Format("ALO21_CheckResult_{0}", strAryArg[1])] != null &&
                HttpContext.Current.Session[string.Format("ALO21_CheckResult_{0}", strAryArg[1])].ToString() != string.Empty)
            {
                strResult = HttpContext.Current.Session[string.Format("ALO21_CheckResult_{0}", strAryArg[1])].ToString();
                if (strResult == string.Empty)
                {
                    throw new Exception("檢查檢核結果有空值異常!");
                }
            }

        }
        catch (Exception ex)
        {
            LEH.WriteErrorLog(strLogFilePath, strAryArg[0], strAryArg[1], "【CheckTransAcceptResult.執行發生異常】", ex, true);
            throw ex;
        }

        return strResult;
    }
Example #3
0
    public static string CheckDataBridgeAtServer(string ProcessingArgument, string strDisNo)
    {
        #region 各項檢核
        string[] strAryArg = ProcessingArgument.Split(",".ToCharArray());
        string CallServerValue = strAryArg[0];
        string ObjectFrom = strAryArg[1];
        string CtrlPending = strAryArg[2];
        string strResult = "";
        string strErrMsg = "";
        bool bResult = false;

        string[] strAry = CallServerValue.Split("_".ToCharArray());
        string[] strAryCtrlPending = CtrlPending.Split(";".ToCharArray());

        ALO_ALO211 ALO211 = new ALO_ALO211();
        LogEventErrorHandler LEH = new LogEventErrorHandler();
        string strLogFileFolder = HttpContext.Current.Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["LogFolder"]).Replace("ALO\\", "");
        string strLogFileName = string.Format("{0}_{1}.log", "ALO21", DateTime.Now.ToString("yyyyMMdd"));
        string strLogFilePath = string.Format("{0}\\{1}", strLogFileFolder, strLogFileName);
        HttpContext.Current.Session[string.Format("ALO21_CheckResult_{0}", strAry[4])] = null;

        try
        {
            #region
            LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 0】準備開始進行檢核", ObjectFrom), false);

            LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 1-1】檢核輸入參數是否異常,輸入參數:{1}", ObjectFrom, CallServerValue), false);

            if (strAry.Length != 5)
            {
                throw new Exception(string.Format("CheckDataBridgeAtServer:{0};輸入參數:{1}。", "輸入參數個數異常", CallServerValue));
            }

            LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 1-2】檢核輸出參數是否異常,輸出參數:{1}", ObjectFrom, CtrlPending), false);

            if (strAryCtrlPending.Length != 6)
            {
                throw new Exception(string.Format("CheckDataBridgeAtServer:{0};輸出參數:{1}。", "輸出參數個數異常", CtrlPending));
            }



            if (ObjectFrom.IndexOf("PICKDIFF") != -1) //出貨品項檢核
            {
                #region
                LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 2-0】開始執行出貨品項檢核作業", ObjectFrom), false);

                bResult = ALO211.CheckData(strAry[0], strAry[1], strAry[2], strAry[3], strAry[4], strDisNo, ProcessingType.PICKDIFF, out strErrMsg);

                LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 3】結束出貨品項檢核作業並組回傳字串", ObjectFrom), false);

                strResult = string.Format("{0}||{1}||{2}||{3}||{4}||{5}||{6}||{7}||{8}", bResult.ToString().ToLower(), strErrMsg,
                    strAryCtrlPending[0], strAryCtrlPending[1], "PICKDIFF", strAryCtrlPending[2], strAryCtrlPending[3], strAryCtrlPending[4], strAryCtrlPending[5]);
                #endregion
            }
            else if (ObjectFrom.IndexOf("DISDIFF") != -1) //配本品項檢核
            {
                #region
                LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 2-0】開始執行配本品項檢核作業", ObjectFrom), false);

                bResult = ALO211.CheckData(strAry[0], strAry[1], strAry[2], strAry[3], strAry[4], strDisNo, ProcessingType.DISDIFF, out strErrMsg);

                LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 3】結束配本品項檢核作業並組回傳字串", ObjectFrom), false);

                strResult = string.Format("{0}||{1}||{2}||{3}||{4}||{5}||{6}||{7}||{8}", bResult.ToString().ToLower(), strErrMsg,
                    strAryCtrlPending[0], strAryCtrlPending[1], "DISDIFF", strAryCtrlPending[2], strAryCtrlPending[3], strAryCtrlPending[4], strAryCtrlPending[5]);
                #endregion
            }
            else if (ObjectFrom.IndexOf("CHECKTRANS") != -1) //轉單前檢核
            {
                #region

                LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 2-0】開始執行轉單前檢核作業", ObjectFrom), false);

                bResult = ALO211.CheckData(strAry[0], strAry[1], strAry[2], strAry[3], strAry[4], strDisNo, ProcessingType.CHECKTRANS, out strErrMsg);

                LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 3】結束轉單前檢核作業並組回傳字串", ObjectFrom), false);

                strResult = string.Format("{0}||{1}||{2}||{3}||{4}||{5}||{6}||{7}||{8}||{9}||{10}||{11}||{12}", bResult.ToString().ToLower(), strErrMsg,
                    strAryCtrlPending[0], strAryCtrlPending[1], "CHECKTRANS", strAryCtrlPending[2], strAryCtrlPending[3], strAryCtrlPending[4], strAryCtrlPending[5],
                    strAry[0], strAry[2], strAry[3], strAry[4] + "_" + strAry[3]);
                #endregion
            }

            LEH.WriteEventLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}.STEP 4】組成並回傳PageMethod字串:{1}", ObjectFrom, strResult.Trim() == "" ? "無值" : strResult), true);
            #endregion
        }
        catch (Exception ex)
        {
            LEH.WriteErrorLog(strLogFilePath, strAry[3], strAry[4], string.Format("【{0}執行發生異常】", ObjectFrom), ex, true);
            throw ex;
        }
        HttpContext.Current.Session[string.Format("ALO21_CheckResult_{0}", strAry[4])] = strResult;
        return strResult;
        #endregion
    }