From 4c7d878f2e641065b193622190bf56f3b6df12b5 Mon Sep 17 00:00:00 2001 From: lastvoidtemplar Date: Mon, 12 Jul 2021 11:05:25 +0300 Subject: [PATCH] Update RecordController.cs --- .../BoerseDataConvert/Controller/RecordController.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/BoerseDataConvert/BoerseDataConvert/Controller/RecordController.cs b/BoerseDataConvert/BoerseDataConvert/Controller/RecordController.cs index 82d6ac3..3b858fd 100644 --- a/BoerseDataConvert/BoerseDataConvert/Controller/RecordController.cs +++ b/BoerseDataConvert/BoerseDataConvert/Controller/RecordController.cs @@ -73,11 +73,15 @@ namespace BoerseDataConvert if(tagsTable.CheckInvalidTag(tag)) throw new ArgumentException($"WARN: Invalid tag \"{tag}\", {cur_fileName} line {count + 1}"); string tagname = tagsTable.GetTagName(tag); + if (value == "") return tagname; if (value != "NULL" && tagsTable.HaveValueRanges(tag))//Checks if the tag have not a value ranges { - if (tagsTable.IsString(tag) && tagsTable.CheckStringLengthToBig(tag,value.Length))//Checks if value type is string - { - throw new ArgumentException($"WARN: Too long value \"{tag}\", \"{value}\", max allowed \"{tagsTable.GetTagName(tag)}\", {cur_fileName} line {count + 1}"); + if (tagsTable.IsString(tag))//Checks if value type is string + { + if (tagsTable.CheckStringLengthToBig(tag, value.Length)) + { + throw new ArgumentException($"WARN: Too long value \"{tag}\", \"{value}\", max allowed \"{tagsTable.GetTagName(tag)}\", {cur_fileName} line {count + 1}"); + } } else//Checks if value type is decimal { @@ -88,7 +92,7 @@ namespace BoerseDataConvert } catch (FormatException) { - throw new ArgumentException($"WARN: Value is not in a valid format for number \"{tag}\", \"{value}\", {cur_fileName} line {count + 1}"); + throw new ArgumentException($"WARN: Value is not in a valid format for number \"{tag}\", \"{value}\", {cur_fileName} line {count + 1}"); } } }