public static cashUnit.iStoreMoneyEx parseStringIStoreMoneyEx(Form1.spLogBuff spLogLine) { cashUnit.iStoreMoneyEx iStoreMoneyExObject = new cashUnit.iStoreMoneyEx(); string[] stringSeparators = new string[] { "\r\n" }; char[] charSeperators = new char[] { ':', ',', '\t', '[', ']' }; string[] cuParsedArray = spLogLine.csInfo.Split(stringSeparators, StringSplitOptions.None); List <string> iStoreMoneyExList = new List <string>(); List <cashUnit.asInOutCassetteInfo> cassetteInfoList = new List <cashUnit.asInOutCassetteInfo>(); List <cashUnit.iAbArea> acCassetteInfoList = new List <cashUnit.iAbArea>(); List <cashUnit.asDenomInfo> denomInfoList = new List <cashUnit.asDenomInfo>(); List <cashUnit.asDenomInfo> asDenomInfoObjectList = new List <cashUnit.asDenomInfo>(); foreach (string str in cuParsedArray) { if (str.Contains("asInOutCassetteInfo[")) { cashUnit.asInOutCassetteInfo cassetteInfo = new cashUnit.asInOutCassetteInfo(); string[] splittedString = str.Split(charSeperators); cassetteInfo.iCassetteSlotNo = splittedString[4]; cassetteInfo.iNum = Convert.ToInt16(splittedString[6]); cassetteInfoList.Add(cassetteInfo); } 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]); iStoreMoneyExObject.acCassetteInfoList = acCassetteInfo; } else if (str.Contains("asDenomInfo[")) { 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("iLogicCode:")) { string[] iLogicCode = str.Split(charSeperators); iStoreMoneyExObject.iLogicCode = iLogicCode[1]; } } iStoreMoneyExObject.iStoreMoneyExDateTime = parseOperations.extractDateTimeFromSpLogLine(spLogLine); iStoreMoneyExObject.denomInfoList = asDenomInfoObjectList; iStoreMoneyExObject.cassetteInfoList = cassetteInfoList; return(iStoreMoneyExObject); }
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); }
public static cashUnit.iCashCount parseStringIcashCountInfo(Form1.spLogBuff spLogLine) { cashUnit.iCashCount iCashCountObject = new cashUnit.iCashCount(); string[] stringSeparators = new string[] { "\r\n" }; char[] charSeperators = new char[] { ':', ',' }; string[] cuParsedArray = spLogLine.csInfo.Split(stringSeparators, StringSplitOptions.None); List <string> asDenomInfoList = new List <string>(); List <cashUnit.asDenomInfo> asDenomInfoObjectList = new List <cashUnit.asDenomInfo>(); foreach (string str in cuParsedArray) { if (str.Contains("iTotalCount")) { iCashCountObject.iTotalCount = Convert.ToInt16(str.Split(charSeperators)[1]); iCashCountObject.iRejectCount = Convert.ToInt16(str.Split(charSeperators)[3]); } else if (str.Contains("asDenomInfo")) { asDenomInfoList.Add(str); } } foreach (string str in asDenomInfoList) { cashUnit.asDenomInfo asDenomInfoObject = new cashUnit.asDenomInfo(); string[] asDenomInfoObjectArray = str.Split(charSeperators); asDenomInfoObject.iCode = asDenomInfoObjectArray[2]; asDenomInfoObject.iNum = Convert.ToInt16(asDenomInfoObjectArray[4]); asDenomInfoObjectList.Add(asDenomInfoObject); } iCashCountObject.iCashCountDateTime = parseOperations.extractDateTimeFromSpLogLine(spLogLine); iCashCountObject.denomInfoList = asDenomInfoObjectList; return(iCashCountObject); }
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); }