ReSharper: -CLR types introduced on GTB
This commit is contained in:
@@ -23,14 +23,14 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
{
|
||||
public static class GlobalConfig
|
||||
{
|
||||
public static Lazy<string> connectionString = new Lazy<string>(()
|
||||
public static Lazy<String> connectionString = new Lazy<String>(()
|
||||
=>
|
||||
System.Configuration.ConfigurationManager.ConnectionStrings["default"].ConnectionString
|
||||
);
|
||||
}
|
||||
//
|
||||
[Route("GetUserList"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetUserList(string LogInName = "", int? Id = null)
|
||||
public async Task<HttpResponseMessage> GetUserList(String LogInName = "", Int32? Id = null)
|
||||
{
|
||||
|
||||
return await Task.Run(() =>
|
||||
@@ -46,7 +46,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
});
|
||||
|
||||
}
|
||||
private System.Collections.Generic.List<UserInformation> getUserList(string LogInName = "", int? Id = null)
|
||||
private System.Collections.Generic.List<UserInformation> getUserList(String LogInName = "", Int32? Id = null)
|
||||
{
|
||||
var ret = new System.Collections.Generic.List<UserInformation>();
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
@@ -69,16 +69,16 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
foreach (DataRow row in dbResult.Rows)
|
||||
{
|
||||
ret.Add(
|
||||
new UserInformation((int)row["UserId"])
|
||||
new UserInformation((Int32)row["UserId"])
|
||||
{
|
||||
FullName = row["FullName"] == DBNull.Value ? "" : (string)row["FullName"],
|
||||
LogInName = (string)row["LogInName"],
|
||||
Domain = (string)row["Domain"],
|
||||
HardwareId = row["HardwareId"] == DBNull.Value ? "" : (string)row["HardwareId"],
|
||||
PasswordHash = row["PasswordHash"] == DBNull.Value ? "" : (string)row["PasswordHash"],
|
||||
FullName = row["FullName"] == DBNull.Value ? "" : (String)row["FullName"],
|
||||
LogInName = (String)row["LogInName"],
|
||||
Domain = (String)row["Domain"],
|
||||
HardwareId = row["HardwareId"] == DBNull.Value ? "" : (String)row["HardwareId"],
|
||||
PasswordHash = row["PasswordHash"] == DBNull.Value ? "" : (String)row["PasswordHash"],
|
||||
RegisterDate = (DateTimeOffset)row["RegisterDate"],
|
||||
ValidDate = (DateTimeOffset)row["ValidDate"],
|
||||
AccountActive = (bool)row["AccountActive"],
|
||||
AccountActive = (Boolean)row["AccountActive"],
|
||||
});
|
||||
|
||||
}
|
||||
@@ -106,13 +106,13 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
foreach (DataRow row in dbResult.Rows)
|
||||
{
|
||||
ret.Add(
|
||||
new UserInformation((int)row["UserId"])
|
||||
new UserInformation((Int32)row["UserId"])
|
||||
{
|
||||
FullName = row["FullName"] == DBNull.Value ? "" : (string)row["FullName"],
|
||||
LogInName = (string)row["LogInName"],
|
||||
Domain = (string)row["Domain"],
|
||||
HardwareId = row["HardwareId"] == DBNull.Value ? "" : (string)row["HardwareId"],
|
||||
AccountActive = (bool)row["AccountActive"],
|
||||
FullName = row["FullName"] == DBNull.Value ? "" : (String)row["FullName"],
|
||||
LogInName = (String)row["LogInName"],
|
||||
Domain = (String)row["Domain"],
|
||||
HardwareId = row["HardwareId"] == DBNull.Value ? "" : (String)row["HardwareId"],
|
||||
AccountActive = (Boolean)row["AccountActive"],
|
||||
});
|
||||
|
||||
}
|
||||
@@ -133,7 +133,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
[Route("RefreshUsersHardwareId"), HttpGet]
|
||||
public async Task<HttpResponseMessage> RefreshUsersHardwareId(int id, string HardwareId)
|
||||
public async Task<HttpResponseMessage> RefreshUsersHardwareId(Int32 id, String HardwareId)
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
@@ -157,7 +157,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
[Route("RefreshUsersPasswordHash"), HttpGet]
|
||||
public async Task<HttpResponseMessage> RefreshUsersPasswordHash(int id, string PasswordHash)
|
||||
public async Task<HttpResponseMessage> RefreshUsersPasswordHash(Int32 id, String PasswordHash)
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
@@ -184,7 +184,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
[Route("EditUserValidity"), HttpGet]
|
||||
public async Task<HttpResponseMessage> EditUserValidity(int id, DateTimeOffset? ValidDate = null, bool? AccountActive = null)
|
||||
public async Task<HttpResponseMessage> EditUserValidity(Int32 id, DateTimeOffset? ValidDate = null, Boolean? AccountActive = null)
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
@@ -236,7 +236,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
[Route("GetFileContent"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetFileContent(int FileId)
|
||||
public async Task<HttpResponseMessage> GetFileContent(Int32 FileId)
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
@@ -262,7 +262,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
[Route("GetFWUpdateSafeContainers"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetFWUpdateSafeContainers(int UserId)
|
||||
public async Task<HttpResponseMessage> GetFWUpdateSafeContainers(Int32 UserId)
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
@@ -286,10 +286,10 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
ret.Add(
|
||||
new FwUpdateSafeDb()
|
||||
{
|
||||
ContainerId = (int)row["FWUpdateSafeContainer_ID"],
|
||||
Name = (string)row["FWUpdateSafeContainer_Name"],
|
||||
UserId = (int)row["FWUpdateSafeContainer_UserId"],
|
||||
FilePartId = (int)row["FWUpdateSafeContainer_FileId"],
|
||||
ContainerId = (Int32)row["FWUpdateSafeContainer_ID"],
|
||||
Name = (String)row["FWUpdateSafeContainer_Name"],
|
||||
UserId = (Int32)row["FWUpdateSafeContainer_UserId"],
|
||||
FilePartId = (Int32)row["FWUpdateSafeContainer_FileId"],
|
||||
ValidDate = (DateTime)row["FWUpdateSafeContainer_ValidDate"]
|
||||
});
|
||||
|
||||
@@ -306,7 +306,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
});
|
||||
}
|
||||
[Route("AddPcbIdsToSafe"), HttpPost]
|
||||
public async Task<HttpResponseMessage> AddPcbIdsToSafe(int ContainerDbId, [FromBody] List<int> PcbIds)
|
||||
public async Task<HttpResponseMessage> AddPcbIdsToSafe(Int32 ContainerDbId, [FromBody] List<Int32> PcbIds)
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
@@ -348,14 +348,14 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
[Route("GetPcbIdsFromSafe"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetPcbIdsFromSafe(int ContainerDbId)
|
||||
public async Task<HttpResponseMessage> GetPcbIdsFromSafe(Int32 ContainerDbId)
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var ret = new System.Collections.Generic.List<int>();
|
||||
var ret = new System.Collections.Generic.List<Int32>();
|
||||
using (var dataacces = new SqlDataAccess(GlobalConfig.connectionString.Value))
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
@@ -368,7 +368,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
foreach (DataRow row in dbResult.Rows)
|
||||
{
|
||||
ret.Add((int)row["FWUpdateSafeContainer_PcbId"]);
|
||||
ret.Add((Int32)row["FWUpdateSafeContainer_PcbId"]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -392,7 +392,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
/// <returns></returns>
|
||||
[Route("PostFWUpdateSafeOdd"), HttpPost]
|
||||
|
||||
public async Task<HttpResponseMessage> PostFWUpdateSafeOdd(int PUserId, string PFileName, DateTime PValidDate, string PBuilderOperatorName = "none")
|
||||
public async Task<HttpResponseMessage> PostFWUpdateSafeOdd(Int32 PUserId, String PFileName, DateTime PValidDate, String PBuilderOperatorName = "none")
|
||||
{
|
||||
if (PFileName.Length > 150)
|
||||
{
|
||||
@@ -452,8 +452,8 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
await content.ReadAsMultipartAsync(provider);
|
||||
|
||||
string uploadingFileName = provider.FileData.Select(x => x.LocalFileName).FirstOrDefault();
|
||||
string originalFileName = String.Concat(fileuploadPath, "\\" + (provider.Contents[0].Headers.ContentDisposition.FileName).Trim(new Char[] { '"' }));
|
||||
String uploadingFileName = provider.FileData.Select(x => x.LocalFileName).FirstOrDefault();
|
||||
String originalFileName = string.Concat(fileuploadPath, "\\" + (provider.Contents[0].Headers.ContentDisposition.FileName).Trim(new Char[] { '"' }));
|
||||
|
||||
if (File.Exists(originalFileName))
|
||||
{
|
||||
@@ -480,7 +480,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
});
|
||||
}
|
||||
[Route("GetFWUpdateSafeContainerContent"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetFWUpdateSafeContainerContent(int SafeContainerId)
|
||||
public async Task<HttpResponseMessage> GetFWUpdateSafeContainerContent(Int32 SafeContainerId)
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
@@ -500,8 +500,8 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
foreach (DataRow row in dbResult.Rows)
|
||||
{
|
||||
var content = new byte[] { };
|
||||
var filePath = $"C:\\\\Temp\\{(int)row["FWUpdateSafeContainer_ID"]}\\{(string)row["FWUpdateSafeContainer_Name"]}";
|
||||
var content = new Byte[] { };
|
||||
var filePath = $"C:\\\\Temp\\{(Int32)row["FWUpdateSafeContainer_ID"]}\\{(String)row["FWUpdateSafeContainer_Name"]}";
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
content = File.ReadAllBytes(filePath);
|
||||
@@ -513,10 +513,10 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
ret.Add(
|
||||
new FwUpdateSafeDb()
|
||||
{
|
||||
ContainerId = (int)row["FWUpdateSafeContainer_ID"],
|
||||
Name = (string)row["FWUpdateSafeContainer_Name"],
|
||||
UserId = (int)row["FWUpdateSafeContainer_UserId"],
|
||||
FilePartId = (int)row["FWUpdateSafeContainer_FileId"],
|
||||
ContainerId = (Int32)row["FWUpdateSafeContainer_ID"],
|
||||
Name = (String)row["FWUpdateSafeContainer_Name"],
|
||||
UserId = (Int32)row["FWUpdateSafeContainer_UserId"],
|
||||
FilePartId = (Int32)row["FWUpdateSafeContainer_FileId"],
|
||||
ValidDate = (DateTime)row["FWUpdateSafeContainer_ValidDate"],
|
||||
Content = content
|
||||
});
|
||||
@@ -594,9 +594,9 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
|
||||
public virtual byte[] GetFileBytes(HttpPostedFile uploadedFile)
|
||||
public virtual Byte[] GetFileBytes(HttpPostedFile uploadedFile)
|
||||
{
|
||||
var bytes = new byte[uploadedFile.ContentLength];
|
||||
var bytes = new Byte[uploadedFile.ContentLength];
|
||||
uploadedFile.InputStream.Read(bytes, 0, uploadedFile.ContentLength);
|
||||
return bytes;
|
||||
}
|
||||
@@ -660,7 +660,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
[Route("GetFWUpdateReportFile"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetFWUpdateReportFile(int? PcbId = null, int? UserId = null, int? OrderNr = null, bool WithContent = true)
|
||||
public async Task<HttpResponseMessage> GetFWUpdateReportFile(Int32? PcbId = null, Int32? UserId = null, Int32? OrderNr = null, Boolean WithContent = true)
|
||||
{
|
||||
return await Task.Run(() =>
|
||||
{
|
||||
@@ -704,8 +704,8 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
foreach (DataRow row in dbResult.Rows)
|
||||
{
|
||||
var addOBJ = JsonConvert.DeserializeObject<FwUpdateReportDb>(UTF32Encoding.UTF32.GetString((byte[])row["FileContent"]));
|
||||
addOBJ.FileId = (int)row["FWUpdateReport_ID"];
|
||||
var addOBJ = JsonConvert.DeserializeObject<FwUpdateReportDb>(UTF32Encoding.UTF32.GetString((Byte[])row["FileContent"]));
|
||||
addOBJ.FileId = (Int32)row["FWUpdateReport_ID"];
|
||||
addOBJ.Date = (DateTime)row["FWUpdateReport_Date"];
|
||||
ret.Add(addOBJ);
|
||||
}
|
||||
@@ -723,12 +723,12 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
[Route("GetRecoveryFile"), HttpGet]
|
||||
public async Task<HttpResponseMessage> GetRecoveryFile(int PcbID, int? RadioFrq, string Region, string FlexnetVersion)
|
||||
public async Task<HttpResponseMessage> GetRecoveryFile(Int32 PcbID, Int32? RadioFrq, String Region, String FlexnetVersion)
|
||||
{
|
||||
|
||||
var file = new RecoverySettings() { PcbId = PcbID, RadioFrequencyMhz = RadioFrq, Region = Region, Release = FlexnetVersion };
|
||||
file.RecoveryRegisters = new List<RecoveryRegisterItem>();
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "GENESISFLOW_SealDisplay", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x00 }, IsCiritcal = true, ReadbackValue = new byte[] { 0x00, 0x00, 0x00, 0x00 } });
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "GENESISFLOW_SealDisplay", WriteValue = new Byte[] { 0x00, 0x00, 0x00, 0x00 }, IsCiritcal = true, ReadbackValue = new Byte[] { 0x00, 0x00, 0x00, 0x00 } });
|
||||
|
||||
|
||||
|
||||
@@ -761,18 +761,18 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "GENESISFLOW_SealDisplay", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x01 }, IsCiritcal = true });
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "GENESISFLOW_SealDisplay", WriteValue = new Byte[] { 0x00, 0x00, 0x00, 0x01 }, IsCiritcal = true });
|
||||
|
||||
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "SENSUSRADIO_SystemState", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x01 }, IsCiritcal = true, ReadbackValue = new byte[] { 0x00, 0x00, 0x00, 0x0c } });
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "SENSUSRADIO_MainAlarmMask", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x00 } });
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "SENSUSRADIO_ExtendedAlarmMask", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0x00 } });
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "SENSUSRADIO_SystemState", WriteValue = new Byte[] { 0x00, 0x00, 0x00, 0x01 }, IsCiritcal = true, ReadbackValue = new Byte[] { 0x00, 0x00, 0x00, 0x0c } });
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "SENSUSRADIO_MainAlarmMask", WriteValue = new Byte[] { 0x00, 0x00, 0x00, 0x00 } });
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "SENSUSRADIO_ExtendedAlarmMask", WriteValue = new Byte[] { 0x00, 0x00, 0x00, 0x00 } });
|
||||
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "SENSUSRADIO_SystemState", WriteValue = new byte[] { 0x00, 0x00, 0x00, 0xFF }, IsCiritcal = true, ReadbackValue = new byte[] { 0x00, 0x00, 0x00, 0x0c } });
|
||||
file.RecoveryRegisters.Add(new RecoveryRegisterItem() { RegisterIdent = "SENSUSRADIO_SystemState", WriteValue = new Byte[] { 0x00, 0x00, 0x00, 0xFF }, IsCiritcal = true, ReadbackValue = new Byte[] { 0x00, 0x00, 0x00, 0x0c } });
|
||||
|
||||
|
||||
|
||||
var blacklist = new List<string>()
|
||||
var blacklist = new List<String>()
|
||||
{
|
||||
"CUSTOMER_RebootCount",
|
||||
"GENESISFLOW_ForwardArrow",
|
||||
@@ -785,7 +785,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
};
|
||||
|
||||
|
||||
var Crit = new List<string>()
|
||||
var Crit = new List<String>()
|
||||
{
|
||||
"GENESISFLOW_SealDisplay",
|
||||
"GENESISFLOW_MeterSize",
|
||||
@@ -818,7 +818,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
|
||||
|
||||
|
||||
var onlyIfDefaultl = new List<string>()
|
||||
var onlyIfDefaultl = new List<String>()
|
||||
{
|
||||
"METROLOGYASST_PulseWeight",
|
||||
"METROLOGYASST_PressureUnits",
|
||||
@@ -847,7 +847,7 @@ namespace Xylem.Common.Service.MeterProcessState.Controllers
|
||||
}
|
||||
|
||||
[Route("AddNewUser"), HttpGet]
|
||||
public async Task<HttpResponseMessage> AddNewUser(string FullName, string LogInName, string Domain, string HardwareId = null, string PasswordHash = null)
|
||||
public async Task<HttpResponseMessage> AddNewUser(String FullName, String LogInName, String Domain, String HardwareId = null, String PasswordHash = null)
|
||||
{
|
||||
|
||||
return await Task.Run(() =>
|
||||
|
||||
Reference in New Issue
Block a user