예제 #1
0
파일: t3202.cs 프로젝트: iPeterPan/XingAPI
        public static XQt3202OutBlock[] ListFromQuery(XQt3202 query)
        {
            int count = query.GetBlockCount(XQt3202OutBlock.BlockName);
            List <XQt3202OutBlock> list = new List <XQt3202OutBlock>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt3202OutBlock block = new XQt3202OutBlock();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.recdt   = query.GetFieldData(block.GetBlockName(), "recdt", i).TrimEnd('?');                 // char 8
                    block.tableid = query.GetFieldData(block.GetBlockName(), "tableid", i).TrimEnd('?');               // char 6
                    block.upgu    = query.GetFieldData(block.GetBlockName(), "upgu", i).TrimEnd('?');                  // char 2
                    block.custno  = query.GetFieldData(block.GetBlockName(), "custno", i).TrimEnd('?');                // char 5
                    block.custnm  = query.GetFieldData(block.GetBlockName(), "custnm", i).TrimEnd('?');                // char 80
                    block.shcode  = query.GetFieldData(block.GetBlockName(), "shcode", i).TrimEnd('?');                // char 6
                    block.upnm    = query.GetFieldData(block.GetBlockName(), "upnm", i).TrimEnd('?');                  // char 20
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
예제 #2
0
파일: t3202.cs 프로젝트: iPeterPan/XingAPI
 public XQt3202OutBlock[] GetBlocks()
 {
     XQt3202OutBlock[] instance = XQt3202OutBlock.ListFromQuery(this);
     return(instance);
 }