示例#1
0
文件: t1664.cs 项目: tdoobw/XingAPI
		public static XQt1664OutBlock1[] ReadFromDB(string tableNamePostfix = null /*, char mgubun = default,char vagubun = default,char bdgubun = default,int cnt = default */)
		{
			using (XQt1664 instance = new XQt1664())
			{

				string tableName = (tableNamePostfix == null) ? "XQt1664OutBlock1" : $"XQt1664OutBlock1_{tableNamePostfix}";
				QueryOption qo = new QueryOption(tableName);
				// if (mgubun != default) qo.Add("mgubun", mgubun);
				// if (vagubun != default) qo.Add("vagubun", vagubun);
				// if (bdgubun != default) qo.Add("bdgubun", bdgubun);
				// if (cnt != default) qo.Add("cnt", cnt);


				var outBlock = instance.SelectMany<XQt1664OutBlock1>(qo);
				return outBlock;
			}
		}
示例#2
0
文件: t1664.cs 项目: tdoobw/XingAPI
		public static XQt1664OutBlock1[] Get(char mgubun = default,char vagubun = default,char bdgubun = default,int cnt = default)
		{
			using (XQt1664 instance = new XQt1664())
			{
				instance.SetFieldData(XQt1664InBlock.BlockName, XQt1664InBlock.F.mgubun, 0, mgubun.ToString()); // char 1
				instance.SetFieldData(XQt1664InBlock.BlockName, XQt1664InBlock.F.vagubun, 0, vagubun.ToString()); // char 1
				instance.SetFieldData(XQt1664InBlock.BlockName, XQt1664InBlock.F.bdgubun, 0, bdgubun.ToString()); // char 1
				instance.SetFieldData(XQt1664InBlock.BlockName, XQt1664InBlock.F.cnt, 0, cnt.ToString("d3")); // int 3

				if (instance.Request() < 0)
				{
					return null;
				}

				var outBlock = instance.GetBlock1s();
				return outBlock;
			}
		}
示例#3
0
文件: t1664.cs 项目: tdoobw/XingAPI
		public static XQt1664OutBlock1[] ListFromQuery(XQt1664 query)
		{
			int count = query.GetBlockCount(XQt1664OutBlock1.BlockName);
			List<XQt1664OutBlock1> list = new List<XQt1664OutBlock1>();
			if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
			{
				return list.ToArray();
			}
			for (int i = 0; i < count; i ++)
			{
				XQt1664OutBlock1 block = new XQt1664OutBlock1();
				block.IsValidData = true;
				block.InvalidReason = "";
				try
				{
					block.dt = query.GetFieldData(block.GetBlockName(), "dt", i).TrimEnd('?'); // char 8
					block.tjj01 = query.GetFieldData(block.GetBlockName(), "tjj01", i).ParseDouble("tjj01"); // double 12.0
					block.tjj02 = query.GetFieldData(block.GetBlockName(), "tjj02", i).ParseDouble("tjj02"); // double 12.0
					block.tjj03 = query.GetFieldData(block.GetBlockName(), "tjj03", i).ParseDouble("tjj03"); // double 12.0
					block.tjj04 = query.GetFieldData(block.GetBlockName(), "tjj04", i).ParseDouble("tjj04"); // double 12.0
					block.tjj05 = query.GetFieldData(block.GetBlockName(), "tjj05", i).ParseDouble("tjj05"); // double 12.0
					block.tjj06 = query.GetFieldData(block.GetBlockName(), "tjj06", i).ParseDouble("tjj06"); // double 12.0
					block.tjj07 = query.GetFieldData(block.GetBlockName(), "tjj07", i).ParseDouble("tjj07"); // double 12.0
					block.tjj08 = query.GetFieldData(block.GetBlockName(), "tjj08", i).ParseDouble("tjj08"); // double 12.0
					block.tjj17 = query.GetFieldData(block.GetBlockName(), "tjj17", i).ParseDouble("tjj17"); // double 12.0
					block.tjj18 = query.GetFieldData(block.GetBlockName(), "tjj18", i).ParseDouble("tjj18"); // double 12.0
					block.cha = query.GetFieldData(block.GetBlockName(), "cha", i).ParseDouble("cha"); // double 12.0
					block.bicha = query.GetFieldData(block.GetBlockName(), "bicha", i).ParseDouble("bicha"); // double 12.0
					block.totcha = query.GetFieldData(block.GetBlockName(), "totcha", i).ParseDouble("totcha"); // double 12.0
					block.basis = query.GetFieldData(block.GetBlockName(), "basis", i).ParseFloat("basis"); // float 6.2

				} catch (InvalidDataFormatException e) {
					block.IsValidData = false;
					block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
				}
				list.Add(block);
			}
			return list.ToArray();

		}