コード例 #1
0
        public static List <cashUnit.asDenomInfo> parseStringIRetractEndForAsDenomInfoList(Form1.spLogBuff spLogLine)
        {
            cashUnit.iRetractEnd        iRetractEndObject     = new cashUnit.iRetractEnd();
            List <cashUnit.asDenomInfo> asDenomInfoObjectList = new List <cashUnit.asDenomInfo>();

            cashUnit.iAbArea acCassetteInfoList = new cashUnit.iAbArea();
            string[]         stringSeparators   = new string[] { "\r\n" };
            char[]           charSeperators     = new char[] { ':', ',', '\t', '[', ']' };
            string[]         cuParsedArray      = spLogLine.csInfo.Split(stringSeparators, StringSplitOptions.None);
            foreach (string str in cuParsedArray)
            {
                if (str.Contains("iTotalCount"))
                {
                    string[] asDenomInfoObjectArray = str.Split(charSeperators);
                    iRetractEndObject.iTotalCount   = Convert.ToInt16(asDenomInfoObjectArray[1]);
                    iRetractEndObject.iUnknownCount = Convert.ToInt16(asDenomInfoObjectArray[3]);
                }
                else if (str.Contains("asNotesInfo["))
                {
                    cashUnit.asDenomInfo asDenomInfoObject      = new cashUnit.asDenomInfo();
                    string[]             asDenomInfoObjectArray = str.Split(charSeperators);
                    asDenomInfoObject.iCode = asDenomInfoObjectArray[4];
                    asDenomInfoObject.iNum  = Convert.ToInt16(asDenomInfoObjectArray[6]);
                    asDenomInfoObjectList.Add(asDenomInfoObject);
                }
                else if (str.Contains("iAbAreaA:"))
                {
                    cashUnit.iAbArea acCassetteInfo = new cashUnit.iAbArea();
                    string[]         splittedStr    = str.Split(charSeperators);
                    acCassetteInfo.iAbAreaA = Convert.ToInt16(splittedStr[1]);
                    acCassetteInfo.iAbAreaB = Convert.ToInt16(splittedStr[3]);
                    acCassetteInfo.iAbAreaC = Convert.ToInt16(splittedStr[5]);
                    iRetractEndObject.acCassetteInfoList = acCassetteInfo;
                }
                else if (str.Contains("iLogicCode"))
                {
                    string[] splittedStr = str.Split(charSeperators);
                    iRetractEndObject.iLogicCode = splittedStr[1];
                }
            }


            iRetractEndObject.denomInfoList       = asDenomInfoObjectList;
            iRetractEndObject.iRetractEndDateTime = parseOperations.extractDateTimeFromSpLogLine(spLogLine);

            return(asDenomInfoObjectList);
        }
コード例 #2
0
        public static bool prepareCashInObjectsForCompareCashInInformation(List <Form1.spLogBuff> cashInLines)
        {
            bool moreCashInLines;

            if (cashInLines.Count == 0)
            {
                moreCashInLines = false;
            }
            else
            {
                //compare - cash in end lines
                List <cashUnit.iCashCount>      iCashCountObjectList        = new List <cashUnit.iCashCount>();//public List<asDenomInfo> denomInfoList
                List <Form1.spLogBuff>          cashInTransactionLines      = parseOperations.returnCashInTransaction(cashInLines);
                cashUnit.asDenomInfo            cashInObjectAsDenomInfo     = new cashUnit.asDenomInfo();
                List <cashUnit.lppCashIn>       cashInEndObjectList         = new List <cashUnit.lppCashIn>();
                List <cashUnit.asDenomInfo>     cashInObjectAsDenomInfoList = new List <cashUnit.asDenomInfo>();
                List <cashUnit.hrCashIn>        hrCashInObjectList          = new List <cashUnit.hrCashIn>();
                List <cashUnit.iStoreMoneyEx>   iStoreMoneyExObjectList     = new List <cashUnit.iStoreMoneyEx>();
                List <cashUnit.hrCashInEnd>     hrCashInEndObjectList       = new List <cashUnit.hrCashInEnd>();
                cashUnit.wfsCmdCimCashIn        wfsCmdCimCashInObject       = new cashUnit.wfsCmdCimCashIn();
                List <cashUnit.cashInEndResult> cashInEndResultObjectList   = new List <cashUnit.cashInEndResult>();
                cashUnit.iRetractEnd            iRetractEndObject           = new cashUnit.iRetractEnd();
                RichTextBox rtxt = Application.OpenForms["Form1"].Controls["richTextBox1"] as RichTextBox;

                foreach (Form1.spLogBuff spLogLine in cashInLines) //cashInTransactionLines
                {
                    if (spLogLine.csInfo.Contains("WFS_CMD_CIM_CASH_IN_ROLLBACK"))
                    {
                    }

                    else if (spLogLine.csInfo.Contains("WFS_CMD_CIM_CASH_IN_END")) //WFS_CMD_CIM_CASH_IN_END
                    {
                        cashInEndObjectList = parseOperations.parseStringCashInEnd(spLogLine);
                    }
                    else if (spLogLine.csInfo.Contains("hrCashInEnd,"))
                    {
                        hrCashInEndObjectList.Add(parseOperations.parseStringHrCashinEndInfo(spLogLine));
                    }
                    else if (spLogLine.csInfo.Contains("iStoreMoneyEx end"))
                    {
                        iStoreMoneyExObjectList.Add(parseOperations.parseStringIStoreMoneyEx(spLogLine));
                    }
                    else if (spLogLine.csInfo.Contains("iCashCount end")) //iCashCount end
                    {
                        iCashCountObjectList.Add(parseOperations.parseStringIcashCountInfo(spLogLine));
                    }
                    else if (spLogLine.csInfo.Contains("hrCashIn,"))
                    {
                        hrCashInObjectList.Add(parseOperations.parseStringHrCashinInfo(spLogLine));
                    }
                    else if (spLogLine.csInfo.Contains("WFS_CMD_CIM_CASH_IN") && !spLogLine.csInfo.Contains("WFS_CMD_CIM_CASH_IN_START") && spLogLine.csInfo.Contains("WFS_EXECUTE_COMPLETE"))
                    {
                        wfsCmdCimCashInObject = parseOperations.parseCmdCimCashInObject(spLogLine);
                    }
                    else if (spLogLine.csInfo.Contains("iRetract end"))
                    {
                        iRetractEndObject = parseOperations.parseStringIRetractEnd(spLogLine);
                        rtxt.Text        += iRetractEndObject.iTotalCount + "\r\n";
                        rtxt.Text        += iRetractEndObject.iUnknownCount + "\r\n";
                        rtxt.Text        += "-------------------------------------------------\r\n";
                    }
                }
                foreach (cashUnit.lppCashIn cashInEndObject in cashInEndObjectList)
                {
                    for (int i = 0; i < cashInEndObject.lppNoteNumberListStruct.usNumOfNoteNumbers; i++)
                    {
                        cashInObjectAsDenomInfo.iCode = cashInEndObject.lppNoteNumberListStruct.lppNoteNumberStructArray[i].usNoteID;
                        cashInObjectAsDenomInfo.iNum  = cashInEndObject.lppNoteNumberListStruct.lppNoteNumberStructArray[i].ulCount;
                        cashInObjectAsDenomInfoList.Add(cashInObjectAsDenomInfo);
                    }
                }
                moreCashInLines = true;
                string cashInResult = createCompareObjects(cashInEndObjectList, iCashCountObjectList, hrCashInObjectList, iStoreMoneyExObjectList, hrCashInEndObjectList, wfsCmdCimCashInObject, iRetractEndObject);
                #region


                //cashUnitCIM.iCashCount iCashCountObject = new cashUnitCIM.iCashCount();
                //cashUnitCIM.asDenomInfo iCashcountObjectAsDenomInfo = new cashUnitCIM.asDenomInfo();
                //List<cashUnitCIM.asDenomInfo> iCashCountObjectAsDenomInfoList = new List<cashUnitCIM.asDenomInfo>(); //compare - iCashCount
                //cashUnitCIM.hrCashin hrCashInObject = new cashUnitCIM.hrCashin();
                //cashUnitCIM.asDenomInfo hrCashInObjectAsDenomInfo = new cashUnitCIM.asDenomInfo();
                //List<cashUnitCIM.asDenomInfo> hrCashInObjectAsDenomInfoList = new List<cashUnitCIM.asDenomInfo>(); //compare - iCashCount
                //cashUnitCIM.iStoreMoneyEx iStoreMoneyExObject = new cashUnitCIM.iStoreMoneyEx();//public List<asDenomInfo> denomInfoList;
                //public List<asDenomInfo> denomInfoList;
                //cashUnitCIM.asDenomInfo iStoreMoneyExObjectAsDenomInfo = new cashUnitCIM.asDenomInfo();
                //List<cashUnitCIM.asDenomInfo> iStoreMoneyExObjectAsDenomInfoList = new List<cashUnitCIM.asDenomInfo>(); //compare - iCashCount
                //cashUnitCIM.hrCashInEnd hrCashInEndObject = new cashUnitCIM.hrCashInEnd();
                //cashUnitCIM.cashInEndResult cashInEndResultObject = new cashUnitCIM.cashInEndResult();
                //public List<hrCashInAccept> acceptList;
                //foreach (cashUnitCIM.iCashCount iCashCountObject in iCashCountObjectList)
                //{
                //    for (int i = 0; i < iCashCountObject.denomInfoList.Count; i++)
                //    {
                //        iCashcountObjectAsDenomInfo.iCode = iCashCountObject.denomInfoList[i].iCode;
                //        iCashcountObjectAsDenomInfo.iNum = iCashCountObject.denomInfoList[i].iNum;
                //        iCashCountObjectAsDenomInfoList.Add(iCashcountObjectAsDenomInfo);

                //    }

                //}

                //foreach (cashUnitCIM.hrCashIn hrCashInObject in hrCashInObjectList)
                //{

                //    for (int i = 0; i < hrCashInObject.acceptList.Count; i++)
                //    {
                //        hrCashInObjectAsDenomInfo.iCode = hrCashInObject.acceptList[i].code;
                //        hrCashInObjectAsDenomInfo.iNum = hrCashInObject.acceptList[i].count;
                //        hrCashInObjectAsDenomInfoList.Add(hrCashInObjectAsDenomInfo);
                //    }
                //}


                //foreach (cashUnitCIM.iStoreMoneyEx iStoreMoneyExObject in iStoreMoneyExObjectList)
                //{
                //    for (int i = 0; i < iStoreMoneyExObject.denomInfoList.Count; i++)
                //    {
                //        iStoreMoneyExObjectAsDenomInfo.iCode = iStoreMoneyExObject.denomInfoList[i].iCode;
                //        iStoreMoneyExObjectAsDenomInfo.iNum = iStoreMoneyExObject.denomInfoList[i].iNum;
                //        iStoreMoneyExObjectAsDenomInfoList.Add(iStoreMoneyExObjectAsDenomInfo);
                //    }
                //}

                //foreach (cashUnitCIM.hrCashInEnd hrCashInEndObject in hrCashInEndObjectList)
                //{

                //    for(int i = 0; i< hrCashInEndObject.cashInEndResultList.Count;i++)
                //    {
                //        cashInEndResultObject.slot = hrCashInEndObject.cashInEndResultList[i].slot;
                //        cashInEndResultObject.index = hrCashInEndObject.cashInEndResultList[i].index;
                //        cashInEndResultObject.count = Convert.ToInt16(hrCashInEndObject.cashInEndResultList[i].count);
                //        cashInEndResultObjectList.Add(cashInEndResultObject);
                //    }
                //}

                #endregion
            }
            return(moreCashInLines);
        }
コード例 #3
0
        public static string createCompareObjects(List <cashUnit.lppCashIn> cashInEndObjectList, List <cashUnit.iCashCount> iCashCountObjectList, List <cashUnit.hrCashIn> hrCashInObjectList, List <cashUnit.iStoreMoneyEx> iStoreMoneyExObjectList, List <cashUnit.hrCashInEnd> hrCashInEndObjectList, cashUnit.wfsCmdCimCashIn wfsCmdCimCashInObject, cashUnit.iRetractEnd iRetractEndObject)
        {
            cashUnit.compareObject        iCashCountCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> iCashCountCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        hrCashInCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> hrCashInCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        wfsCmdCimCashInCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> wfsCmdCimCashInCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        iStoreMoneyExCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> iStoreMoneyExCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        hrCashInEndCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> hrCashInEndCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        cashInEndCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> cashInEndCompareObjectList = new List <cashUnit.compareObject>();

            cashUnit.compareObject        iRetractEndCompareObject     = new cashUnit.compareObject();
            List <cashUnit.compareObject> iRetractEndCompareObjectList = new List <cashUnit.compareObject>();

            string result = "";


            foreach (cashUnit.iCashCount iCashCountObject in iCashCountObjectList)
            {
                for (int i = 0; i < iCashCountObject.denomInfoList.Count(); i++)
                {
                    denomTranslation noteValue = denomTranslation.returnNoteInfo(iCashCountObject.denomInfoList[i].iCode);
                    iCashCountCompareObject.iCode  = iCashCountObject.denomInfoList[i].iCode;
                    iCashCountCompareObject.iCount = iCashCountObject.denomInfoList[i].iNum;
                    iCashCountCompareObject.compareObjectDateTime = iCashCountObject.iCashCountDateTime;
                    iCashCountCompareObjectList.Add(iCashCountCompareObject);
                }
            }

            foreach (cashUnit.hrCashIn hrCashInObject in hrCashInObjectList)
            {
                for (int i = 0; i < hrCashInObject.acceptList.Count; i++)
                {
                    denomTranslation noteValue = denomTranslation.returnNoteInfo(hrCashInObject.acceptList[i].code);

                    hrCashInCompareObject.iCode  = hrCashInObject.acceptList[i].code;
                    hrCashInCompareObject.iCount = hrCashInObject.acceptList[i].count;
                    hrCashInCompareObject.compareObjectDateTime = hrCashInObject.hrCashInDateTime;

                    hrCashInCompareObjectList.Add(hrCashInCompareObject);
                }
            }


            foreach (cashUnit.lppNoteNumber lppNumberList in wfsCmdCimCashInObject.lppNoteNumberListStruct.lppNoteNumberStructArray)
            {
                wfsCmdCimCashInCompareObject.iCode  = lppNumberList.usNoteID;
                wfsCmdCimCashInCompareObject.iCount = lppNumberList.ulCount;
                wfsCmdCimCashInCompareObjectList.Add(wfsCmdCimCashInCompareObject);
            }

            foreach (cashUnit.iStoreMoneyEx iStoreMoneyExObject in iStoreMoneyExObjectList)
            {
                for (int i = 0; i < iStoreMoneyExObject.denomInfoList.Count; i++)
                {
                    iStoreMoneyExCompareObject.iCode  = iStoreMoneyExObject.denomInfoList[i].iCode;
                    iStoreMoneyExCompareObject.iCount = iStoreMoneyExObject.denomInfoList[i].iNum;
                    iStoreMoneyExCompareObject.compareObjectDateTime = iStoreMoneyExObject.iStoreMoneyExDateTime;
                    iStoreMoneyExCompareObjectList.Add(iStoreMoneyExCompareObject);
                }
            }

            foreach (cashUnit.hrCashInEnd hrCashInEndObject in hrCashInEndObjectList)
            {
                for (int i = 0; i < hrCashInEndObject.cashInEndResultList.Count; i++)
                {
                    hrCashInEndCompareObject.cassetteID            = "S" + hrCashInEndObject.cashInEndResultList[i].slot + "_I" + hrCashInEndObject.cashInEndResultList[i].index;
                    hrCashInEndCompareObject.iCount                = hrCashInEndObject.cashInEndResultList[i].count;
                    hrCashInEndCompareObject.compareObjectDateTime = hrCashInEndObject.hrCashInEndDateTime;
                    hrCashInEndCompareObjectList.Add(hrCashInEndCompareObject);
                }
            }


            foreach (cashUnit.lppCashIn cashInEndObject in cashInEndObjectList)
            {
                for (int i = 0; i < cashInEndObject.lppNoteNumberListStruct.lppNoteNumberStructArray.Count(); i++)
                {
                    cashInEndCompareObject.cassetteID            = cashInEndObject.cUnitID;
                    cashInEndCompareObject.iCode                 = cashInEndObject.lppNoteNumberListStruct.lppNoteNumberStructArray[i].usNoteID;
                    cashInEndCompareObject.iCount                = cashInEndObject.lppNoteNumberListStruct.lppNoteNumberStructArray[i].ulCount;
                    cashInEndCompareObject.cassetteID            = cashInEndObject.lppNoteNumberListStruct.lppNoteNumberStructArray[i].lppPhysicalstruct.lpPhysicalPositionName;
                    cashInEndCompareObject.compareObjectDateTime = cashInEndObject.lppCashInDateTime;
                    cashInEndCompareObjectList.Add(cashInEndCompareObject);
                }
            }

            if (iRetractEndObject.denomInfoList != null)
            {
                foreach (cashUnit.asDenomInfo asDenomInfoList in iRetractEndObject.denomInfoList)
                {
                    iRetractEndCompareObject.iCode  = asDenomInfoList.iCode;
                    iRetractEndCompareObject.iCount = Convert.ToInt16(asDenomInfoList.iNum);
                    iRetractEndCompareObject.compareObjectDateTime = iRetractEndObject.iRetractEndDateTime;
                    iRetractEndCompareObjectList.Add(iRetractEndCompareObject);
                }
            }

            foreach (cashUnit.compareObject obj in iCashCountCompareObjectList)
            {
                result += "iCashCount:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }

            foreach (cashUnit.compareObject obj in hrCashInCompareObjectList)
            {
                result += "hrCashIn:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }

            foreach (cashUnit.compareObject obj in iStoreMoneyExCompareObjectList)
            {
                result += "iStoreMoneyEx:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }

            foreach (cashUnit.compareObject obj in hrCashInEndCompareObjectList)
            {
                result += "hrCashInEnd:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }


            foreach (cashUnit.compareObject obj in cashInEndCompareObjectList)
            {
                result += "cashInEnd:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }

            foreach (cashUnit.compareObject obj in iRetractEndCompareObjectList)
            {
                result += "iRetractEnd:\r\n" + "Casssette Id: " + obj.cassetteID + "\r\n" + "Note ID: " + obj.iCode + "\r\n" + "Count: " + obj.iCount + "\r\n" + "Date Time: " + obj.compareObjectDateTime + "\r\n" + "------------------------------------------------------------\r\n";
            }

            List <List <cashUnit.compareObject> > compareObjects = new List <List <cashUnit.compareObject> > {
                iCashCountCompareObjectList, hrCashInCompareObjectList, iStoreMoneyExCompareObjectList, hrCashInEndCompareObjectList, cashInEndCompareObjectList, iRetractEndCompareObjectList
            };

            compareCashInObjects(compareObjects);

            RichTextBox rtxt = Application.OpenForms["Form1"].Controls["richTextBox1"] as RichTextBox;

            rtxt.Text += result;
            return(result);
        }