public bool FillParseLine(string strValue, string strSplit, out CMSMStruct.FillFeeStruct ffs, out Exception err) { int i = 0; ffs = new CMSMData.CMSMStruct.FillFeeStruct(); err = null; try { string[] strFields = strValue.Split(strSplit.ToCharArray()); ffs.strSerial = strFields[i++]; ffs.strAssID = strFields[i++]; ffs.strCardID = strFields[i++]; ffs.dFillFee = double.Parse(strFields[i++]); ffs.dFillProm = double.Parse(strFields[i++]); ffs.dFeeLast = double.Parse(strFields[i++]); ffs.dFeeCur = double.Parse(strFields[i++]); ffs.strFillDate = strFields[i++]; ffs.strComments = strFields[i++]; ffs.strOperName = strFields[i++]; ffs.strDeptID = strFields[i++]; } catch (Exception e) { err = e; return(false); } return(true); }
public string ToFillString(CMSMStruct.FillFeeStruct asstmp) { /* * iSerial--DU001 * iAssID--DU002 * vcCardID--DU003 * nFillFee--DU004 * nFillProm--DU005 * nFeeLast--DU006 * nFeeCur--DU007 * dtFillDate--DU008 * vcComments--DU009 * vcOperName--DU010 * vcDeptID--DU011 * DU018--数据类型:1--会员资料;2--消费明细;3--小票数据;4--积分日志;5--充值日志;6--营业日志 */ StringBuilder sb = new StringBuilder(1024); sb.Append(asstmp.strSerial); sb.Append(","); sb.Append(asstmp.strAssID); sb.Append(","); sb.Append(asstmp.strCardID); sb.Append(","); sb.Append(asstmp.dFillFee.ToString()); sb.Append(","); sb.Append(asstmp.dFillProm.ToString()); sb.Append(","); sb.Append(asstmp.dFeeLast.ToString()); sb.Append(","); sb.Append(asstmp.dFeeCur.ToString()); sb.Append(","); sb.Append(asstmp.strFillDate); sb.Append(","); sb.Append(asstmp.strComments); sb.Append(","); sb.Append(asstmp.strOperName); sb.Append(","); sb.Append(asstmp.strDeptID); // sb.Append(",null,null,null,null,null,null,5"); return(sb.ToString()); }