Exemplo n.º 1
0
        public bool ConsParseLine(string strValue, string strSplit, out CMSMStruct.ConsDownStruct consd, out Exception err)
        {
            int i = 0;

            consd = new CMSMData.CMSMStruct.ConsDownStruct();
            err   = null;
            try
            {
                string[] strFields = strValue.Split(strSplit.ToCharArray());
                consd.strSerial   = strFields[i++];
                consd.strGoodsID  = strFields[i++];
                consd.strAssID    = strFields[i++];
                consd.strCardID   = strFields[i++];
                consd.dPrice      = double.Parse(strFields[i++]);
                consd.iCount      = int.Parse(strFields[i++]);
                consd.dTRate      = double.Parse(strFields[i++]);
                consd.dFee        = double.Parse(strFields[i++]);
                consd.strComments = strFields[i++];
                consd.strFlag     = strFields[i++];
                consd.strConsDate = strFields[i++];
                consd.strOperName = strFields[i++];
                consd.strDeptID   = strFields[i++];
            }
            catch (Exception e)
            {
                err = e;
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        public string ToConsString(CMSMStruct.ConsDownStruct asstmp)
        {
            /*
             * iSerial--DU001
             * vcGoodsID--DU002
             * iAssID--DU003
             * vcCardID--DU004
             * nPrice--DU005
             * iCount--DU006
             * nTRate--DU007
             * nFee--DU008
             * vcComments--DU009
             * cFlag--DU010
             * dtConsDate--DU011
             * vcOperName--DU012
             * vcDeptID--DU013
             * DU018--数据类型:1--会员资料;2--消费明细;3--小票数据;4--积分日志;5--充值日志;6--营业日志
             */
            StringBuilder sb = new StringBuilder(1024);

            sb.Append(asstmp.strSerial);
            sb.Append(",");
            sb.Append(asstmp.strGoodsID);
            sb.Append(",");
            sb.Append(asstmp.strAssID);
            sb.Append(",");
            sb.Append(asstmp.strCardID);
            sb.Append(",");
            sb.Append(asstmp.dPrice.ToString());
            sb.Append(",");
            sb.Append(asstmp.iCount.ToString());
            sb.Append(",");
            sb.Append(asstmp.dTRate.ToString());
            sb.Append(",");
            sb.Append(asstmp.dFee.ToString());
            sb.Append(",");
            sb.Append(asstmp.strComments);
            sb.Append(",");
            sb.Append(asstmp.strFlag);
            sb.Append(",");
            sb.Append(asstmp.strConsDate);
            sb.Append(",");
            sb.Append(asstmp.strOperName);
            sb.Append(",");
            sb.Append(asstmp.strDeptID);
//			sb.Append(",null,null,null,null,2");
            return(sb.ToString());
        }