Esempio n. 1
0
        public bool GoodsParseLine(string strValue, string strSplit, out CMSMStruct.GoodsStruct asstmp, out Exception err)
        {
            int i = 0;

            asstmp = new CMSMData.CMSMStruct.GoodsStruct();
            err    = null;
            try
            {
                string[] strFields = strValue.Split(strSplit.ToCharArray());
                asstmp.strGoodsID   = strFields[i++];
                asstmp.strGoodsName = strFields[i++];
                asstmp.strSpell     = strFields[i++];
                asstmp.dPrice       = double.Parse(strFields[i++]);
                asstmp.dRate        = double.Parse(strFields[i++]);
                asstmp.iIgValue     = int.Parse(strFields[i++]);
                asstmp.strNewFlag   = strFields[i++];
                asstmp.strComments  = strFields[i++];
            }
            catch (Exception e)
            {
                err = e;
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        public string ToGoodsString(CMSMStruct.GoodsStruct asstmp)
        {
            StringBuilder sb = new StringBuilder(1024);

//			sb.Append(asstmp.strGoodsID);
//			sb.Append(",");
//			sb.Append(asstmp.strGoodsName);
//			sb.Append(",");
//			sb.Append(asstmp.strSpell);
//			sb.Append(",");
//			sb.Append(asstmp.dPrice);
//			sb.Append(",");
//			sb.Append(asstmp.dRate);
//			sb.Append(",");
//			sb.Append(asstmp.iIgValue);
//			sb.Append(",");
//			sb.Append(asstmp.strNewFlag);
//			sb.Append(",");
//			sb.Append(asstmp.strComments);
            return(sb.ToString());
        }