public static XQAllOutBlocks Get(string user_id = default, char gb = default, string group_name = default, char cont = default, string cont_key = default) { using (XQt1866 instance = new XQt1866()) { instance.SetFieldData(XQt1866InBlock.BlockName, XQt1866InBlock.F.user_id, 0, user_id); // char 8 instance.SetFieldData(XQt1866InBlock.BlockName, XQt1866InBlock.F.gb, 0, gb.ToString()); // char 1 instance.SetFieldData(XQt1866InBlock.BlockName, XQt1866InBlock.F.group_name, 0, group_name); // char 40 instance.SetFieldData(XQt1866InBlock.BlockName, XQt1866InBlock.F.cont, 0, cont.ToString()); // char 1 instance.SetFieldData(XQt1866InBlock.BlockName, XQt1866InBlock.F.cont_key, 0, cont_key); // char 40 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 XQt1866OutBlock1[] ListFromQuery(XQt1866 query) { int count = query.GetBlockCount(XQt1866OutBlock1.BlockName); List <XQt1866OutBlock1> list = new List <XQt1866OutBlock1>(); if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { return(list.ToArray()); } for (int i = 0; i < count; i++) { XQt1866OutBlock1 block = new XQt1866OutBlock1(); block.IsValidData = true; block.InvalidReason = ""; try { block.query_index = query.GetFieldData(block.GetBlockName(), "query_index", i).TrimEnd('?'); // char 12 block.group_name = query.GetFieldData(block.GetBlockName(), "group_name", i).TrimEnd('?'); // char 40 block.query_name = query.GetFieldData(block.GetBlockName(), "query_name", i).TrimEnd('?'); // char 40 } 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 user_id = default,char gb = default,string group_name = default,char cont = default,string cont_key = default */) { using (XQt1866 instance = new XQt1866()) { XQAllOutBlocks results = new XQAllOutBlocks(); string tableName = (tableNamePostfix == null) ? "XQt1866OutBlock" : $"XQt1866OutBlock_{tableNamePostfix}"; QueryOption qo = new QueryOption(tableName); results.OutBlock = instance.Select <XQt1866OutBlock>(qo); tableName = (tableNamePostfix == null) ? "XQt1866OutBlock1" : $"XQt1866OutBlock1_{tableNamePostfix}"; qo = new QueryOption(tableName); results.OutBlock1 = instance.SelectMany <XQt1866OutBlock1>(qo); return(results); } }
public static XQt1866OutBlock1[] Get(string user_id = default, char gb = default, string group_name = default, char cont = default, string cont_key = default) { using (XQt1866 instance = new XQt1866()) { instance.SetFieldData(XQt1866InBlock.BlockName, XQt1866InBlock.F.user_id, 0, user_id); // char 8 instance.SetFieldData(XQt1866InBlock.BlockName, XQt1866InBlock.F.gb, 0, gb.ToString()); // char 1 instance.SetFieldData(XQt1866InBlock.BlockName, XQt1866InBlock.F.group_name, 0, group_name); // char 40 instance.SetFieldData(XQt1866InBlock.BlockName, XQt1866InBlock.F.cont, 0, cont.ToString()); // char 1 instance.SetFieldData(XQt1866InBlock.BlockName, XQt1866InBlock.F.cont_key, 0, cont_key); // char 40 if (instance.Request() < 0) { return(null); } var outBlock = instance.GetBlock1s(); return(outBlock); } }
public static XQt1866OutBlock FromQuery(XQt1866 query) { XQt1866OutBlock block = new XQt1866OutBlock(); block.IsValidData = true; block.InvalidReason = ""; if (query.QueryResult != null && query.QueryResult.IsSystemError == true) { block.IsValidData = false; block.InvalidReason = query.ReceiveMessage; return(block); } try { block.result_count = query.GetFieldData(block.GetBlockName(), "result_count", 0).ParseLong("result_count"); // long 5 block.cont = query.GetFieldData(block.GetBlockName(), "cont", 0).FirstOrDefault(); // char 1 block.cont_key = query.GetFieldData(block.GetBlockName(), "cont_key", 0).TrimEnd('?'); // char 40 } catch (InvalidDataFormatException e) { block.IsValidData = false; block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\""; } return(block); }