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 cashUnit.iCashCount returnIcashCountObject(Form1.spLogBuff spLogLine) { cashUnit.iCashCount iCashCountObject = parseOperations.parseStringIcashCountInfo(spLogLine); return(iCashCountObject); }