public static XQt0424OutBlock FromQuery(XQt0424 query) { XQt0424OutBlock block = new XQt0424OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.sunamt = query.GetFieldData(block.GetBlockName(), "sunamt", 0).ParseLong("sunamt"); // long 18 block.dtsunik = query.GetFieldData(block.GetBlockName(), "dtsunik", 0).ParseLong("dtsunik"); // long 18 block.mamt = query.GetFieldData(block.GetBlockName(), "mamt", 0).ParseLong("mamt"); // long 18 block.sunamt1 = query.GetFieldData(block.GetBlockName(), "sunamt1", 0).ParseLong("sunamt1"); // long 18 block.cts_expcode = query.GetFieldData(block.GetBlockName(), "cts_expcode", 0).TrimEnd('?'); // char 22 block.tappamt = query.GetFieldData(block.GetBlockName(), "tappamt", 0).ParseLong("tappamt"); // long 18 block.tdtsunik = query.GetFieldData(block.GetBlockName(), "tdtsunik", 0).ParseLong("tdtsunik"); // long 18 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }
public static XQAllOutBlocks Get(string accno = default, string passwd = default, char prcgb = default, char chegb = default, char dangb = default, char charge = default, string cts_expcode = default) { using (XQt0424 instance = new XQt0424()) { instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.accno, 0, accno); // char 11 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.passwd, 0, passwd); // char 8 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.prcgb, 0, prcgb.ToString()); // char 1 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.chegb, 0, chegb.ToString()); // char 1 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.dangb, 0, dangb.ToString()); // char 1 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.charge, 0, charge.ToString()); // char 1 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.cts_expcode, 0, cts_expcode); // char 22 if (instance.Request() < 0) { return(null); } XQAllOutBlocks results = new XQAllOutBlocks(); results.OutBlock = instance.GetBlock(); if (results.OutBlock.IsValidData == false) { return(null); } results.OutBlock1 = instance.GetBlock1s(); return(results); } }
public static XQt0424OutBlock1[] ListFromQuery(XQt0424 query) { int count = query.GetBlockCount(XQt0424OutBlock1.BlockName); List <XQt0424OutBlock1> list = new List <XQt0424OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt0424OutBlock1 block = new XQt0424OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.expcode = query.GetFieldData(block.GetBlockName(), "expcode", i).TrimEnd('?'); // char 12 block.jangb = query.GetFieldData(block.GetBlockName(), "jangb", i).TrimEnd('?'); // char 10 block.janqty = query.GetFieldData(block.GetBlockName(), "janqty", i).ParseLong("janqty"); // long 18 block.mdposqt = query.GetFieldData(block.GetBlockName(), "mdposqt", i).ParseLong("mdposqt"); // long 18 block.pamt = query.GetFieldData(block.GetBlockName(), "pamt", i).ParseLong("pamt"); // long 18 block.mamt = query.GetFieldData(block.GetBlockName(), "mamt", i).ParseLong("mamt"); // long 18 block.sinamt = query.GetFieldData(block.GetBlockName(), "sinamt", i).ParseLong("sinamt"); // long 18 block.lastdt = query.GetFieldData(block.GetBlockName(), "lastdt", i).TrimEnd('?'); // char 8 block.msat = query.GetFieldData(block.GetBlockName(), "msat", i).ParseLong("msat"); // long 18 block.mpms = query.GetFieldData(block.GetBlockName(), "mpms", i).ParseLong("mpms"); // long 18 block.mdat = query.GetFieldData(block.GetBlockName(), "mdat", i).ParseLong("mdat"); // long 18 block.mpmd = query.GetFieldData(block.GetBlockName(), "mpmd", i).ParseLong("mpmd"); // long 18 block.jsat = query.GetFieldData(block.GetBlockName(), "jsat", i).ParseLong("jsat"); // long 18 block.jpms = query.GetFieldData(block.GetBlockName(), "jpms", i).ParseLong("jpms"); // long 18 block.jdat = query.GetFieldData(block.GetBlockName(), "jdat", i).ParseLong("jdat"); // long 18 block.jpmd = query.GetFieldData(block.GetBlockName(), "jpmd", i).ParseLong("jpmd"); // long 18 block.sysprocseq = query.GetFieldData(block.GetBlockName(), "sysprocseq", i).ParseLong("sysprocseq"); // long 10 block.loandt = query.GetFieldData(block.GetBlockName(), "loandt", i).TrimEnd('?'); // char 8 block.hname = query.GetFieldData(block.GetBlockName(), "hname", i).TrimEnd('?'); // char 20 block.marketgb = query.GetFieldData(block.GetBlockName(), "marketgb", i).FirstOrDefault(); // char 1 block.jonggb = query.GetFieldData(block.GetBlockName(), "jonggb", i).FirstOrDefault(); // char 1 block.janrt = query.GetFieldData(block.GetBlockName(), "janrt", i).ParseFloat("janrt"); // float 10.2 block.price = query.GetFieldData(block.GetBlockName(), "price", i).ParseLong("price"); // long 8 block.appamt = query.GetFieldData(block.GetBlockName(), "appamt", i).ParseLong("appamt"); // long 18 block.dtsunik = query.GetFieldData(block.GetBlockName(), "dtsunik", i).ParseLong("dtsunik"); // long 18 block.sunikrt = query.GetFieldData(block.GetBlockName(), "sunikrt", i).ParseFloat("sunikrt"); // float 10.2 block.fee = query.GetFieldData(block.GetBlockName(), "fee", i).ParseLong("fee"); // long 10 block.tax = query.GetFieldData(block.GetBlockName(), "tax", i).ParseLong("tax"); // long 10 block.sininter = query.GetFieldData(block.GetBlockName(), "sininter", i).ParseLong("sininter"); // long 10 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } list.Add(block); } return(list.ToArray()); }
public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, string accno = default,string passwd = default,char prcgb = default,char chegb = default,char dangb = default,char charge = default,string cts_expcode = default */) { using (XQt0424 instance = new XQt0424()) { XQAllOutBlocks results = new XQAllOutBlocks(); string tableName = (tableNamePostfix == null) ? "XQt0424OutBlock" : $"XQt0424OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); results.OutBlock = instance.Select <XQt0424OutBlock>(qo); tableName = (tableNamePostfix == null) ? "XQt0424OutBlock1" : $"XQt0424OutBlock1_{tableNamePostfix}"; qo = new QueryOption(tableName); results.OutBlock1 = instance.SelectMany <XQt0424OutBlock1>(qo); return(results); } }
public static XQt0424OutBlock1[] Get(string accno = default, string passwd = default, char prcgb = default, char chegb = default, char dangb = default, char charge = default, string cts_expcode = default) { using (XQt0424 instance = new XQt0424()) { instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.accno, 0, accno); // char 11 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.passwd, 0, passwd); // char 8 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.prcgb, 0, prcgb.ToString()); // char 1 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.chegb, 0, chegb.ToString()); // char 1 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.dangb, 0, dangb.ToString()); // char 1 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.charge, 0, charge.ToString()); // char 1 instance.SetFieldData(XQt0424InBlock.BlockName, XQt0424InBlock.F.cts_expcode, 0, cts_expcode); // char 22 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlock1s(); return(outBlock); } }