From 8e49e3b42f53c5cec5403902f6903ac6170d4e94 Mon Sep 17 00:00:00 2001 From: Roland Drabesch Date: Thu, 23 Jun 2022 10:20:26 +0200 Subject: [PATCH] psuh --- ...erRegisters.csproj.CoreCompileInputs.cache | 2 +- .../SampleGeneration/ObjectGenerator.cs | 2 +- .../Controllers/FwUpdateController.cs | 21 +++++++++++++++---- .../Models/AccountBindingModels.cs | 1 + 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache index 7286a520..f22623aa 100644 --- a/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache +++ b/Common/Hardware/WaterMeter/WaterMeterCore/WaterMeterRegisters/obj/Debug/WaterMeterRegisters.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -d6acafee485301268608cd081e3b8b166497c098 +5ed75d99ee45ff67821090f1b3dbb001dd9e4fe3 diff --git a/Common/Service/MeterProcessState/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs b/Common/Service/MeterProcessState/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs index c3c01b70..6f928fc8 100644 --- a/Common/Service/MeterProcessState/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs +++ b/Common/Service/MeterProcessState/Areas/HelpPage/SampleGeneration/ObjectGenerator.cs @@ -9,7 +9,7 @@ using System.Reflection; namespace Service.MeterProcessState.Areas.HelpPage { /// - /// This class will create an object of a given type and populate it with sample data. + /// This class will create an object of a given type and populate it with sample data. force push /// public class ObjectGenerator { diff --git a/Common/Service/MeterProcessState/Controllers/FwUpdateController.cs b/Common/Service/MeterProcessState/Controllers/FwUpdateController.cs index 48d5b306..0780ea13 100644 --- a/Common/Service/MeterProcessState/Controllers/FwUpdateController.cs +++ b/Common/Service/MeterProcessState/Controllers/FwUpdateController.cs @@ -382,9 +382,22 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers } }); } + /// + /// + /// + /// + /// + /// + /// + /// [Route("PostFWUpdateSafeOdd"), HttpPost] - public async Task PostFWUpdateSafeOdd(int PUserId, string PFileName, DateTime PValidDate, string PBuilderOperatorName = "none") + + public async Task PostFWUpdateSafeOdd(int PUserId, string PFileName, DateTime PValidDate, string PBuilderOperatorName = "none") { + if (PFileName.Length > 150) + { + throw new ApplicationException("File name is to long"); + } var inpStrem = HttpContext.Current.Request.GetBufferlessInputStream(true); var inpHeaders = Request.Content.Headers; return await Task.Run(async () => @@ -397,7 +410,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value)) { var parameters = new List(); - var FileName = new System.Data.SqlClient.SqlParameter("@FileName", SqlDbType.NVarChar, 50); + var FileName = new System.Data.SqlClient.SqlParameter("@FileName", SqlDbType.NVarChar, 150); var UserId = new System.Data.SqlClient.SqlParameter("@UserId", SqlDbType.Int); var ValidDate = new System.Data.SqlClient.SqlParameter("@ValidDate", SqlDbType.Date); @@ -411,7 +424,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers var sb = new StringBuilder(); sb.AppendLine($" Declare @FileID as int "); - sb.AppendLine($" Declare @FileName as NVarChar(50) "); + sb.AppendLine($" Declare @FileName as NVarChar(150) "); sb.AppendLine($" Declare @UserId as int "); sb.AppendLine($" set @FileName = '{PFileName}' "); sb.AppendLine($" set @UserId = {PUserId} "); @@ -602,7 +615,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers { var parameters = new List(); var DbFileContent = new System.Data.SqlClient.SqlParameter("@FileContent", SqlDbType.VarBinary); - var DbFileName = new System.Data.SqlClient.SqlParameter("@FileName", SqlDbType.NVarChar, 50); + var DbFileName = new System.Data.SqlClient.SqlParameter("@FileName", SqlDbType.NVarChar,150 ); diff --git a/Common/Service/MeterProcessState/Models/AccountBindingModels.cs b/Common/Service/MeterProcessState/Models/AccountBindingModels.cs index 1308e900..a4772eb2 100644 --- a/Common/Service/MeterProcessState/Models/AccountBindingModels.cs +++ b/Common/Service/MeterProcessState/Models/AccountBindingModels.cs @@ -2,6 +2,7 @@ namespace Service.MeterProcessState.Models { + // force push // Models used as parameters to AccountController actions. public class AddExternalLoginBindingModel