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); }