public static XQt3320OutBlock1 FromQuery(XQt3320 query) { XQt3320OutBlock1 block = new XQt3320OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.gicode = query.GetFieldData(block.GetBlockName(), "gicode", 0).TrimEnd('?'); // char 7 block.gsym = query.GetFieldData(block.GetBlockName(), "gsym", 0).TrimEnd('?'); // char 6 block.gsgb = query.GetFieldData(block.GetBlockName(), "gsgb", 0).FirstOrDefault(); // char 1 block.per = query.GetFieldData(block.GetBlockName(), "per", 0).ParseFloat("per"); // float 13.2 block.eps = query.GetFieldData(block.GetBlockName(), "eps", 0).ParseFloat("eps"); // float 13.0 block.pbr = query.GetFieldData(block.GetBlockName(), "pbr", 0).ParseFloat("pbr"); // float 13.2 block.roa = query.GetFieldData(block.GetBlockName(), "roa", 0).ParseFloat("roa"); // float 13.2 block.roe = query.GetFieldData(block.GetBlockName(), "roe", 0).ParseFloat("roe"); // float 13.2 block.ebitda = query.GetFieldData(block.GetBlockName(), "ebitda", 0).ParseFloat("ebitda"); // float 13.2 block.evebitda = query.GetFieldData(block.GetBlockName(), "evebitda", 0).ParseFloat("evebitda"); // float 13.2 block.par = query.GetFieldData(block.GetBlockName(), "par", 0).ParseFloat("par"); // float 13.2 block.sps = query.GetFieldData(block.GetBlockName(), "sps", 0).ParseFloat("sps"); // float 13.2 block.cps = query.GetFieldData(block.GetBlockName(), "cps", 0).ParseFloat("cps"); // float 13.2 block.bps = query.GetFieldData(block.GetBlockName(), "bps", 0).ParseFloat("bps"); // float 13.0 block.t_per = query.GetFieldData(block.GetBlockName(), "t_per", 0).ParseFloat("t_per"); // float 13.2 block.t_eps = query.GetFieldData(block.GetBlockName(), "t_eps", 0).ParseFloat("t_eps"); // float 13.0 block.peg = query.GetFieldData(block.GetBlockName(), "peg", 0).ParseFloat("peg"); // float 13.2 block.t_peg = query.GetFieldData(block.GetBlockName(), "t_peg", 0).ParseFloat("t_peg"); // float 13.2 block.t_gsym = query.GetFieldData(block.GetBlockName(), "t_gsym", 0).TrimEnd('?'); // char 6 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public XQt3320OutBlock1 GetBlock1() { XQt3320OutBlock1 instance = XQt3320OutBlock1.FromQuery(this); return(instance); }