clr types
This commit is contained in:
@@ -10,9 +10,9 @@
|
||||
|
||||
public partial class CordonelDbContext
|
||||
{
|
||||
private readonly Action<String> errorsCallback;
|
||||
private readonly Action<string> errorsCallback;
|
||||
|
||||
public CordonelDbContext(String connectionString, Action<String> errorsCallback = null)
|
||||
public CordonelDbContext(string connectionString, Action<string> errorsCallback = null)
|
||||
{
|
||||
this.errorsCallback = errorsCallback;
|
||||
this.SqlConnection = new SqlConnection(connectionString, this.OnSqlErrors);
|
||||
@@ -23,7 +23,7 @@
|
||||
this.StandardRequirements = new StandardRequirementsRepository(this);
|
||||
}
|
||||
|
||||
public CordonelDbContext(SqlConnection sqlConnection, Action<String> errorsCallback = null)
|
||||
public CordonelDbContext(SqlConnection sqlConnection, Action<string> errorsCallback = null)
|
||||
{
|
||||
this.SqlConnection = sqlConnection;
|
||||
this.EOLProgress = new EOLProgressRepository(this);
|
||||
@@ -111,31 +111,31 @@
|
||||
FileName = reader.GetValue<string>(15),
|
||||
});
|
||||
|
||||
internal virtual CordonelMetrologyValues GetLatestGenesisFlowValues(Object pcbId)
|
||||
internal virtual CordonelMetrologyValues GetLatestGenesisFlowValues(object pcbId)
|
||||
=> this.SqlConnection
|
||||
.CreateCommand(string.Format(LATEST_CALIBRATION_VALUES_BY_PCB, nameof(pcbId)))
|
||||
.SetParameter(nameof(pcbId), pcbId?.ToString())
|
||||
.FirstOrDefault(reader => new CordonelMetrologyValues
|
||||
{
|
||||
Id = reader.GetValue<Int32>(0),
|
||||
PcbId = reader.GetValue<Int32>(1),
|
||||
CalFactor1 = reader.GetValue<Int32>(2),
|
||||
CalFactor2 = reader.GetValue<Int32>(3),
|
||||
CalFactor3 = reader.GetValue<Int32>(4),
|
||||
ZeroOffset1 = reader.GetValue<Int32>(5),
|
||||
ZeroOffset2 = reader.GetValue<Int32>(6),
|
||||
ZeroOffset3 = reader.GetValue<Int32>(7),
|
||||
FirstHitUpdatePeriod = reader.GetValue<Int32>(8),
|
||||
FirstHitShift = reader.GetValue<Int32>(9),
|
||||
FirstHitPercent1 = reader.GetValue<Int32>(10),
|
||||
FirstHitPercent2 = reader.GetValue<Int32>(11),
|
||||
FirstHitPercent3 = reader.GetValue<Int32>(12),
|
||||
ToFTempOffset1 = reader.GetValue<Int32>(13),
|
||||
ToFTempOffset2 = reader.GetValue<Int32>(14),
|
||||
ToFTempOffset3 = reader.GetValue<Int32>(15),
|
||||
MeterSize = reader.GetValue<Int32>(16),
|
||||
Id = reader.GetValue<int>(0),
|
||||
PcbId = reader.GetValue<int>(1),
|
||||
CalFactor1 = reader.GetValue<int>(2),
|
||||
CalFactor2 = reader.GetValue<int>(3),
|
||||
CalFactor3 = reader.GetValue<int>(4),
|
||||
ZeroOffset1 = reader.GetValue<int>(5),
|
||||
ZeroOffset2 = reader.GetValue<int>(6),
|
||||
ZeroOffset3 = reader.GetValue<int>(7),
|
||||
FirstHitUpdatePeriod = reader.GetValue<int>(8),
|
||||
FirstHitShift = reader.GetValue<int>(9),
|
||||
FirstHitPercent1 = reader.GetValue<int>(10),
|
||||
FirstHitPercent2 = reader.GetValue<int>(11),
|
||||
FirstHitPercent3 = reader.GetValue<int>(12),
|
||||
ToFTempOffset1 = reader.GetValue<int>(13),
|
||||
ToFTempOffset2 = reader.GetValue<int>(14),
|
||||
ToFTempOffset3 = reader.GetValue<int>(15),
|
||||
MeterSize = reader.GetValue<int>(16),
|
||||
Date = reader.GetValue<DateTime>(17),
|
||||
Successful = reader.GetValue<Boolean>(18),
|
||||
Successful = reader.GetValue<bool>(18),
|
||||
});
|
||||
|
||||
internal virtual CordonelRSSIValues GetLatestRssiValues(string pcbId)
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@
|
||||
|
||||
public interface IFilterRepository<T> : IRepositoryEnumerable<T>
|
||||
{
|
||||
IEnumerable<T> Like(String pattern);
|
||||
IEnumerable<T> Like(string pattern);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
|
||||
public interface IPORepository<T> : IFilterRepository<T>
|
||||
{
|
||||
IEnumerable<String> GetPcbs(String ponr);
|
||||
IEnumerable<string> GetPcbs(string ponr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
{
|
||||
T Add(T model);
|
||||
|
||||
T Delete(Object id);
|
||||
T Delete(object id);
|
||||
|
||||
T FirstOrDefault(Object id);
|
||||
T FirstOrDefault(object id);
|
||||
|
||||
T FirstOrDefault(params Object[] ids);
|
||||
T FirstOrDefault(params object[] ids);
|
||||
|
||||
T Update(T model);
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
|
||||
public interface IRequirementsRepository<T>
|
||||
{
|
||||
T FindByPcbId(String pcbid);
|
||||
T FindByPcbId(string pcbid);
|
||||
|
||||
T FindByPoNo(String pono);
|
||||
T FindByPoNo(string pono);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
public interface ISpecialRequirementsRepository<T> : IRepository<T>
|
||||
{
|
||||
T FirstOrDefaultByPO(String ponr);
|
||||
T FirstOrDefaultByPO(string ponr);
|
||||
|
||||
void Approve(int id, string name, string comment);
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
public interface IStandardRequirementRepository<T> : IRepository<T>
|
||||
{
|
||||
T FirstOrDefaultByPO(String ponr);
|
||||
T FirstOrDefaultByPO(string ponr);
|
||||
|
||||
void Approve(int id, string name, string comment);
|
||||
|
||||
|
||||
+29
-29
@@ -72,39 +72,39 @@
|
||||
.SetParameter(nameof(pcbId), pcbId)
|
||||
.FirstOrDefault(reader => new EOLProgressModel
|
||||
{
|
||||
Id = reader.GetValue<Int32>(0),
|
||||
PcbId = reader.GetValue<Int32>(1),
|
||||
Id = reader.GetValue<int>(0),
|
||||
PcbId = reader.GetValue<int>(1),
|
||||
StartDate = reader.GetValue<DateTime>(2),
|
||||
StandardRequirementId = reader.GetValue<Int32?>(3),
|
||||
StandardRequirementVersion = reader.GetValue<Int32?>(4),
|
||||
SpecialRequirementId = reader.GetValue<Int32?>(5),
|
||||
SpecialRequirementVersion = reader.GetValue<Int32?>(6),
|
||||
RequirementRequestChecked = reader.GetValue<String>(7),
|
||||
RequirementPcbIdChecked = reader.GetValue<String>(8),
|
||||
RequirementOrderChecked = reader.GetValue<String>(9),
|
||||
RequirementRegionChecked = reader.GetValue<String>(10),
|
||||
ProductionStatusLutCrc = reader.GetValue<String>(11),
|
||||
ProductionStatusFwVersion = reader.GetValue<String>(12),
|
||||
ProductionStatusMeterSize = reader.GetValue<String>(13),
|
||||
StandardRequirementId = reader.GetValue<int?>(3),
|
||||
StandardRequirementVersion = reader.GetValue<int?>(4),
|
||||
SpecialRequirementId = reader.GetValue<int?>(5),
|
||||
SpecialRequirementVersion = reader.GetValue<int?>(6),
|
||||
RequirementRequestChecked = reader.GetValue<string>(7),
|
||||
RequirementPcbIdChecked = reader.GetValue<string>(8),
|
||||
RequirementOrderChecked = reader.GetValue<string>(9),
|
||||
RequirementRegionChecked = reader.GetValue<string>(10),
|
||||
ProductionStatusLutCrc = reader.GetValue<string>(11),
|
||||
ProductionStatusFwVersion = reader.GetValue<string>(12),
|
||||
ProductionStatusMeterSize = reader.GetValue<string>(13),
|
||||
ProductionStatusDrainedBatteryLoad = reader.GetValue<Double?>(14),
|
||||
ProductionStatusBatteryLoadChecked = reader.GetValue<String>(15),
|
||||
ProductionStatusBatteryLoadChecked = reader.GetValue<string>(15),
|
||||
ProductionStatusRemainingLifeTime = reader.GetValue<Double?>(16),
|
||||
ProductionStatusRemainingLifeTimeChecked = reader.GetValue<String>(17),
|
||||
ProductionStatusZeroFlowChecked = reader.GetValue<String>(18),
|
||||
ProductionStatusCalibrationChecked = reader.GetValue<String>(19),
|
||||
ParametrizationDoneChecked = reader.GetValue<String>(20),
|
||||
StoreConfigurationDoneChecked = reader.GetValue<String>(21),
|
||||
RebootDoneChecked = reader.GetValue<String>(22),
|
||||
ParametrizationCompareChecked = reader.GetValue<String>(23),
|
||||
RadioCheckId = reader.GetValue<Int64?>(24),
|
||||
FinalRadioSystemState = reader.GetValue<Int64?>(25),
|
||||
FinalRadioSystemStateCheck = reader.GetValue<String>(26),
|
||||
PasswordFileInstalledCheck = reader.GetValue<String>(27),
|
||||
AttachmentsChecked = reader.GetValue<String>(28),
|
||||
ProductionStatusRemainingLifeTimeChecked = reader.GetValue<string>(17),
|
||||
ProductionStatusZeroFlowChecked = reader.GetValue<string>(18),
|
||||
ProductionStatusCalibrationChecked = reader.GetValue<string>(19),
|
||||
ParametrizationDoneChecked = reader.GetValue<string>(20),
|
||||
StoreConfigurationDoneChecked = reader.GetValue<string>(21),
|
||||
RebootDoneChecked = reader.GetValue<string>(22),
|
||||
ParametrizationCompareChecked = reader.GetValue<string>(23),
|
||||
RadioCheckId = reader.GetValue<long?>(24),
|
||||
FinalRadioSystemState = reader.GetValue<long?>(25),
|
||||
FinalRadioSystemStateCheck = reader.GetValue<string>(26),
|
||||
PasswordFileInstalledCheck = reader.GetValue<string>(27),
|
||||
AttachmentsChecked = reader.GetValue<string>(28),
|
||||
EOLCompleteDate = reader.GetValue<DateTime?>(29),
|
||||
EOLSoftwareNameAndVersion = reader.GetValue<String>(30),
|
||||
SAPExportDone = reader.GetValue<String>(31),
|
||||
SentinelCompleted = reader.GetValue<String>(32),
|
||||
EOLSoftwareNameAndVersion = reader.GetValue<string>(30),
|
||||
SAPExportDone = reader.GetValue<string>(31),
|
||||
SentinelCompleted = reader.GetValue<string>(32),
|
||||
SentinelCompletedDate = reader.GetValue<DateTime?>(33),
|
||||
});
|
||||
}
|
||||
|
||||
+17
-17
@@ -51,20 +51,20 @@
|
||||
, [AAP].[AuftragNr] DESC")
|
||||
.ExecuteReader(x => new CordonelProductionOrder
|
||||
{
|
||||
Key = x.GetValue<String>(0),
|
||||
Region = x.GetValue<String>(1),
|
||||
Size = x.GetValue<String>(2),
|
||||
IdentNr = x.GetValue<String>(3),
|
||||
AuftragNr = x.GetValue<String>(4),
|
||||
PositionNr = x.GetValue<String>(5),
|
||||
FertigungsauftragNr = x.GetValue<String>(6),
|
||||
Key = x.GetValue<string>(0),
|
||||
Region = x.GetValue<string>(1),
|
||||
Size = x.GetValue<string>(2),
|
||||
IdentNr = x.GetValue<string>(3),
|
||||
AuftragNr = x.GetValue<string>(4),
|
||||
PositionNr = x.GetValue<string>(5),
|
||||
FertigungsauftragNr = x.GetValue<string>(6),
|
||||
})
|
||||
.GetEnumerator();
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
=> this.GetEnumerator();
|
||||
|
||||
public IEnumerable<String> GetPcbs(String ponr)
|
||||
public IEnumerable<string> GetPcbs(string ponr)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [pcb2sn].[MapPcbIdToSerialNumber_PcbId]
|
||||
@@ -77,9 +77,9 @@
|
||||
AS [sn]
|
||||
ON [pcb2sn].[MapPcbIdToSerialNumber_SerialNumber] BETWEEN [sn].[SerienNrVon] AND [sn].[SerienNrBis]")
|
||||
.SetParameter(nameof(ponr), ponr)
|
||||
.ExecuteReader(x => x.GetValue<String>(0));
|
||||
.ExecuteReader(x => x.GetValue<string>(0));
|
||||
|
||||
public IEnumerable<CordonelProductionOrder> Like(String pattern)
|
||||
public IEnumerable<CordonelProductionOrder> Like(string pattern)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT DISTINCT
|
||||
@@ -115,13 +115,13 @@
|
||||
.SetParameter(nameof(pattern), $"%{pattern}%")
|
||||
.ExecuteReader(x => new CordonelProductionOrder
|
||||
{
|
||||
Key = x.GetValue<String>(0),
|
||||
Region = x.GetValue<String>(1),
|
||||
Size = x.GetValue<String>(2),
|
||||
IdentNr = x.GetValue<String>(3),
|
||||
AuftragNr = x.GetValue<String>(4),
|
||||
PositionNr = x.GetValue<String>(5),
|
||||
FertigungsauftragNr = x.GetValue<String>(6),
|
||||
Key = x.GetValue<string>(0),
|
||||
Region = x.GetValue<string>(1),
|
||||
Size = x.GetValue<string>(2),
|
||||
IdentNr = x.GetValue<string>(3),
|
||||
AuftragNr = x.GetValue<string>(4),
|
||||
PositionNr = x.GetValue<string>(5),
|
||||
FertigungsauftragNr = x.GetValue<string>(6),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+23
-23
@@ -17,7 +17,7 @@
|
||||
this.sqlConnection = dbContext.SqlConnection;
|
||||
}
|
||||
|
||||
public CordonelRequirements FindByPcbId(String pcbid)
|
||||
public CordonelRequirements FindByPcbId(string pcbid)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT cr.SpecialId
|
||||
@@ -74,7 +74,7 @@
|
||||
.SetParameter(nameof(pcbid), pcbid)
|
||||
.FirstOrDefault(this.ParseCordonelRequirements);
|
||||
|
||||
public CordonelRequirements FindByPoNo(String pono)
|
||||
public CordonelRequirements FindByPoNo(string pono)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT cr.SpecialId
|
||||
@@ -134,20 +134,20 @@
|
||||
private CordonelRequirements ParseCordonelRequirements(SqlReader reader)
|
||||
=> new CordonelRequirements
|
||||
{
|
||||
SpecialId = reader.GetValue<Int32?>(0),
|
||||
SpecialVersion = reader.GetValue<Int32?>(1),
|
||||
StandardId = reader.GetValue<Int32?>(2),
|
||||
StandardVersion = reader.GetValue<Int32?>(3),
|
||||
Region = reader.GetValue<String>(4),
|
||||
MeterSize = reader.GetValue<String>(5),
|
||||
ProductionOrderNr = reader.GetValue<Int32?>(6),
|
||||
OuterProductionOrderNr = reader.GetValue<Int32?>(7),
|
||||
PcbId = reader.GetValue<Int32?>(8),
|
||||
OuterPcbId = reader.GetValue<Int32?>(9),
|
||||
SkipCalibration = reader.GetValue<Boolean?>(10),
|
||||
SkipRadioCheck = reader.GetValue<Boolean?>(11),
|
||||
FwVersion = reader.GetValue<String>(12),
|
||||
LutCrc = reader.GetValue<String>(13),
|
||||
SpecialId = reader.GetValue<int?>(0),
|
||||
SpecialVersion = reader.GetValue<int?>(1),
|
||||
StandardId = reader.GetValue<int?>(2),
|
||||
StandardVersion = reader.GetValue<int?>(3),
|
||||
Region = reader.GetValue<string>(4),
|
||||
MeterSize = reader.GetValue<string>(5),
|
||||
ProductionOrderNr = reader.GetValue<int?>(6),
|
||||
OuterProductionOrderNr = reader.GetValue<int?>(7),
|
||||
PcbId = reader.GetValue<int?>(8),
|
||||
OuterPcbId = reader.GetValue<int?>(9),
|
||||
SkipCalibration = reader.GetValue<bool?>(10),
|
||||
SkipRadioCheck = reader.GetValue<bool?>(11),
|
||||
FwVersion = reader.GetValue<string>(12),
|
||||
LutCrc = reader.GetValue<string>(13),
|
||||
RequiredLifeTimeYearsAssembly = reader.GetValue<Double?>(14),
|
||||
RequiredLifeTimeYearsShipping = reader.GetValue<Double?>(15),
|
||||
MaxDrainedBatteryLoadPercentAssembly = reader.GetValue<Double?>(16),
|
||||
@@ -156,13 +156,13 @@
|
||||
QuiescentCurrent_uA = reader.GetValue<Double?>(19),
|
||||
EstimatedProductionBatteryLoadPercent = reader.GetValue<Double?>(20),
|
||||
RequirementTimestamp = reader.GetValue<DateTime?>(21),
|
||||
ApprovalName = reader.GetValue<String>(22),
|
||||
ApprovalComment = reader.GetValue<String>(23),
|
||||
IsSpecialActive = reader.GetValue<Boolean?>(24),
|
||||
IsStandardActive = reader.GetValue<Boolean?>(25),
|
||||
IsSpecialApproved = reader.GetValue<Boolean?>(26),
|
||||
IsStandardApproved = reader.GetValue<Boolean?>(27),
|
||||
RegionSizeKey = reader.GetValue<String>(28)
|
||||
ApprovalName = reader.GetValue<string>(22),
|
||||
ApprovalComment = reader.GetValue<string>(23),
|
||||
IsSpecialActive = reader.GetValue<bool?>(24),
|
||||
IsStandardActive = reader.GetValue<bool?>(25),
|
||||
IsSpecialApproved = reader.GetValue<bool?>(26),
|
||||
IsStandardApproved = reader.GetValue<bool?>(27),
|
||||
RegionSizeKey = reader.GetValue<string>(28)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+36
-36
@@ -89,7 +89,7 @@
|
||||
.SetParameter(nameof(model.CreatedBy), model.CreatedBy)
|
||||
.SetParameter(nameof(model.Comment), model.Comment)
|
||||
.SetParameter(nameof(model.IsActive), model.IsActive)
|
||||
.ExecuteScalar(x => x.GetValue<Int32>(0));
|
||||
.ExecuteScalar(x => x.GetValue<int>(0));
|
||||
|
||||
var id = this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
@@ -99,7 +99,7 @@
|
||||
AND ([PcbId] = @{nameof(model.PcbId)} OR [PcbId] IS NULL)")
|
||||
.SetParameter(nameof(model.ProductionOrderNr), model.ProductionOrderNr)
|
||||
.SetParameter(nameof(model.PcbId), model.PcbId)
|
||||
.FirstOrDefault(x => x.GetValue<Int32>(0));
|
||||
.FirstOrDefault(x => x.GetValue<int>(0));
|
||||
|
||||
return this.FirstOrDefault(id);
|
||||
}
|
||||
@@ -127,10 +127,10 @@
|
||||
.SetParameter(nameof(comment), comment)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public CordonelSpecialRequirement Delete(Object id)
|
||||
public CordonelSpecialRequirement Delete(object id)
|
||||
=> throw new NotImplementedException($"{nameof(CordonelSpecialRequirement)} could not be deleted");
|
||||
|
||||
public CordonelSpecialRequirement FirstOrDefault(Object id)
|
||||
public CordonelSpecialRequirement FirstOrDefault(object id)
|
||||
{
|
||||
var requirement = this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
@@ -180,7 +180,7 @@
|
||||
return requirement;
|
||||
}
|
||||
|
||||
public CordonelSpecialRequirement FirstOrDefault(params Object[] ids)
|
||||
public CordonelSpecialRequirement FirstOrDefault(params object[] ids)
|
||||
{
|
||||
var requirement = this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
@@ -232,10 +232,10 @@
|
||||
return requirement;
|
||||
}
|
||||
|
||||
public CordonelSpecialRequirement FirstOrDefaultByPO(String ponr)
|
||||
public CordonelSpecialRequirement FirstOrDefaultByPO(string ponr)
|
||||
{
|
||||
var id = default(Int32?);
|
||||
var nr = default(Int32?);
|
||||
var id = default(int?);
|
||||
var nr = default(int?);
|
||||
_ = this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [Id]
|
||||
@@ -246,8 +246,8 @@
|
||||
.SetParameter(nameof(ponr), ponr)
|
||||
.FirstOrDefault(x =>
|
||||
{
|
||||
id = x.GetValue<Int32?>(0);
|
||||
nr = x.GetValue<Int32?>(0);
|
||||
id = x.GetValue<int?>(0);
|
||||
nr = x.GetValue<int?>(0);
|
||||
|
||||
return false;
|
||||
});
|
||||
@@ -368,7 +368,7 @@
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
=> this.GetEnumerator();
|
||||
|
||||
private IEnumerable<CordonelRequirementsChange> Hostory(Int32 id, Int32 nr)
|
||||
private IEnumerable<CordonelRequirementsChange> Hostory(int id, int nr)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [Id]
|
||||
@@ -387,32 +387,32 @@
|
||||
.SetParameter(nameof(nr), nr)
|
||||
.ExecuteReader(x => new CordonelRequirementsChange
|
||||
{
|
||||
Id = x.GetValue<Int32>(0),
|
||||
Version = x.GetValue<Int32>(1),
|
||||
Id = x.GetValue<int>(0),
|
||||
Version = x.GetValue<int>(1),
|
||||
Timestamp = x.GetValue<DateTime>(2),
|
||||
CreatedBy = x.GetValue<String>(3),
|
||||
ApprovedBy = x.GetValue<String>(4),
|
||||
CreatedBy = x.GetValue<string>(3),
|
||||
ApprovedBy = x.GetValue<string>(4),
|
||||
ApprovedDate = x.GetValue<DateTime?>(5),
|
||||
Comment = x.GetValue<String>(6),
|
||||
IsActive = x.GetValue<Boolean>(7),
|
||||
Comment = x.GetValue<string>(6),
|
||||
IsActive = x.GetValue<bool>(7),
|
||||
});
|
||||
|
||||
private CordonelSpecialRequirement ParseSpecialRequirement(SqlReader reader)
|
||||
=> new CordonelSpecialRequirement
|
||||
{
|
||||
Id = reader.GetValue<Int32>(0),
|
||||
Version = reader.GetValue<Int32>(1),
|
||||
StandardId = reader.GetValue<Int32>(2),
|
||||
StandardVersion = reader.GetValue<Int32>(3),
|
||||
Key = reader.GetValue<String>(4),
|
||||
Region = reader.GetValue<String>(5),
|
||||
MeterSize = reader.GetValue<String>(6),
|
||||
ProductionOrderNr = reader.GetValue<Int32?>(7),
|
||||
PcbId = reader.GetValue<Int32?>(8),
|
||||
FwVersion = reader.GetValue<String>(9),
|
||||
LutCrc = reader.GetValue<String>(10),
|
||||
SkipCalibration = reader.GetValue<Boolean>(11),
|
||||
SkipRadioCheck = reader.GetValue<Boolean>(12),
|
||||
Id = reader.GetValue<int>(0),
|
||||
Version = reader.GetValue<int>(1),
|
||||
StandardId = reader.GetValue<int>(2),
|
||||
StandardVersion = reader.GetValue<int>(3),
|
||||
Key = reader.GetValue<string>(4),
|
||||
Region = reader.GetValue<string>(5),
|
||||
MeterSize = reader.GetValue<string>(6),
|
||||
ProductionOrderNr = reader.GetValue<int?>(7),
|
||||
PcbId = reader.GetValue<int?>(8),
|
||||
FwVersion = reader.GetValue<string>(9),
|
||||
LutCrc = reader.GetValue<string>(10),
|
||||
SkipCalibration = reader.GetValue<bool>(11),
|
||||
SkipRadioCheck = reader.GetValue<bool>(12),
|
||||
RequiredLifeTimeYearsAssembly = reader.GetValue<Double?>(13),
|
||||
RequiredLifeTimeYearsShipping = reader.GetValue<Double?>(14),
|
||||
MaxDrainedBatteryLoadPercentAssembly = reader.GetValue<Double?>(15),
|
||||
@@ -422,15 +422,15 @@
|
||||
QuiescentCurrent_uA = reader.GetValue<Double?>(19),
|
||||
EstimatedProductionBatteryLoadPercent = reader.GetValue<Double?>(20),
|
||||
Timestamp = reader.GetValue<DateTime>(21),
|
||||
CreatedBy = reader.GetValue<String>(22),
|
||||
ApprovedBy = reader.GetValue<String>(23),
|
||||
CreatedBy = reader.GetValue<string>(22),
|
||||
ApprovedBy = reader.GetValue<string>(23),
|
||||
ApprovedDate = reader.GetValue<DateTime?>(24),
|
||||
Comment = reader.GetValue<String>(25),
|
||||
IsActive = reader.GetValue<Boolean>(26),
|
||||
ProductGroup = reader.GetValue<String>(27),
|
||||
Comment = reader.GetValue<string>(25),
|
||||
IsActive = reader.GetValue<bool>(26),
|
||||
ProductGroup = reader.GetValue<string>(27),
|
||||
};
|
||||
|
||||
private CordonelStandardRequirement StandardRequirement(Int32? standardId)
|
||||
private CordonelStandardRequirement StandardRequirement(int? standardId)
|
||||
=> this.dbContext.StandardRequirements.FirstOrDefault(standardId);
|
||||
}
|
||||
}
|
||||
|
||||
+25
-25
@@ -45,10 +45,10 @@
|
||||
.SetParameter(nameof(comment), comment)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public CordonelStandardRequirement Delete(Object id)
|
||||
public CordonelStandardRequirement Delete(object id)
|
||||
=> throw new NotImplementedException($"{nameof(CordonelStandardRequirement)} could not be deleted");
|
||||
|
||||
public CordonelStandardRequirement FirstOrDefault(Object id)
|
||||
public CordonelStandardRequirement FirstOrDefault(object id)
|
||||
{
|
||||
var requirement = this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
@@ -90,7 +90,7 @@
|
||||
return requirement;
|
||||
}
|
||||
|
||||
public CordonelStandardRequirement FirstOrDefault(params Object[] ids)
|
||||
public CordonelStandardRequirement FirstOrDefault(params object[] ids)
|
||||
{
|
||||
var requirement = this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
@@ -134,7 +134,7 @@
|
||||
return requirement;
|
||||
}
|
||||
|
||||
public CordonelStandardRequirement FirstOrDefaultByPO(String ponr)
|
||||
public CordonelStandardRequirement FirstOrDefaultByPO(string ponr)
|
||||
{
|
||||
var requirement = this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
@@ -270,16 +270,16 @@
|
||||
private CordonelStandardRequirement ParseStandardRequirement(SqlReader reader)
|
||||
=> new CordonelStandardRequirement
|
||||
{
|
||||
Id = reader.GetValue<Int32>(0),
|
||||
Version = reader.GetValue<Int32>(1),
|
||||
Key = reader.GetValue<String>(2),
|
||||
Region = reader.GetValue<String>(3),
|
||||
ProductGroup = reader.GetValue<String>(4),
|
||||
MeterSize = reader.GetValue<String>(5),
|
||||
FwVersion = reader.GetValue<String>(6),
|
||||
LutCrc = reader.GetValue<String>(7),
|
||||
SkipCalibration = reader.GetValue<Boolean?>(8),
|
||||
SkipRadioCheck = reader.GetValue<Boolean?>(9),
|
||||
Id = reader.GetValue<int>(0),
|
||||
Version = reader.GetValue<int>(1),
|
||||
Key = reader.GetValue<string>(2),
|
||||
Region = reader.GetValue<string>(3),
|
||||
ProductGroup = reader.GetValue<string>(4),
|
||||
MeterSize = reader.GetValue<string>(5),
|
||||
FwVersion = reader.GetValue<string>(6),
|
||||
LutCrc = reader.GetValue<string>(7),
|
||||
SkipCalibration = reader.GetValue<bool?>(8),
|
||||
SkipRadioCheck = reader.GetValue<bool?>(9),
|
||||
RequiredLifeTimeYearsAssembly = reader.GetValue<Double>(10),
|
||||
RequiredLifeTimeYearsShipping = reader.GetValue<Double>(11),
|
||||
MaxDrainedBatteryLoadPercentAssembly = reader.GetValue<Double>(12),
|
||||
@@ -289,14 +289,14 @@
|
||||
QuiescentCurrent_uA = reader.GetValue<Double?>(16),
|
||||
EstimatedProductionBatteryLoadPercent = reader.GetValue<Double?>(17),
|
||||
Timestamp = reader.GetValue<DateTime>(18),
|
||||
CreatedBy = reader.GetValue<String>(19),
|
||||
ApprovedBy = reader.GetValue<String>(20),
|
||||
CreatedBy = reader.GetValue<string>(19),
|
||||
ApprovedBy = reader.GetValue<string>(20),
|
||||
ApprovedDate = reader.GetValue<DateTime?>(21),
|
||||
Comment = reader.GetValue<String>(22),
|
||||
IsActive = reader.GetValue<Boolean>(23),
|
||||
Comment = reader.GetValue<string>(22),
|
||||
IsActive = reader.GetValue<bool>(23),
|
||||
};
|
||||
|
||||
private IEnumerable<CordonelRequirementsChange> History(Int32 id, Int32 nr)
|
||||
private IEnumerable<CordonelRequirementsChange> History(int id, int nr)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [Id]
|
||||
@@ -313,14 +313,14 @@
|
||||
.SetParameter(nameof(nr), nr)
|
||||
.ExecuteReader(reader => new CordonelRequirementsChange
|
||||
{
|
||||
Id = reader.GetValue<Int32>(0),
|
||||
Version = reader.GetValue<Int32>(1),
|
||||
Id = reader.GetValue<int>(0),
|
||||
Version = reader.GetValue<int>(1),
|
||||
Timestamp = reader.GetValue<DateTime>(2),
|
||||
CreatedBy = reader.GetValue<String>(3),
|
||||
ApprovedBy = reader.GetValue<String>(4),
|
||||
CreatedBy = reader.GetValue<string>(3),
|
||||
ApprovedBy = reader.GetValue<string>(4),
|
||||
ApprovedDate = reader.GetValue<DateTime?>(5),
|
||||
Comment = reader.GetValue<String>(6),
|
||||
IsActive = reader.GetValue<Boolean>(7),
|
||||
Comment = reader.GetValue<string>(6),
|
||||
IsActive = reader.GetValue<bool>(7),
|
||||
});
|
||||
|
||||
public void Unapprove(int requirementId)
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
public class Pruefer
|
||||
{
|
||||
public Int16 PrueferNr { get; set; }
|
||||
public short PrueferNr { get; set; }
|
||||
|
||||
public String Vorname { get; set; }
|
||||
public string Vorname { get; set; }
|
||||
|
||||
public String Name { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public Boolean IstPruefer { get; set; }
|
||||
public bool IstPruefer { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
public class Prueffehler
|
||||
{
|
||||
public Int32 SerienNr { get; set; }
|
||||
public int SerienNr { get; set; }
|
||||
|
||||
public Int32 PruefgangNr { get; set; }
|
||||
public int PruefgangNr { get; set; }
|
||||
|
||||
public Pruefgang Pruefgang { get; set; }
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
public DateTime AusdruckPruefstationDatum { get; set; }
|
||||
|
||||
public String Info { get; set; }
|
||||
public string Info { get; set; }
|
||||
|
||||
public String Metrolog { get; set; }
|
||||
public string Metrolog { get; set; }
|
||||
|
||||
public Int32 FreigabeMitarbeiter { get; set; }
|
||||
public int FreigabeMitarbeiter { get; set; }
|
||||
|
||||
public DateTime FreigabeDatum { get; set; }
|
||||
|
||||
public Int16 _LWL { get; set; }
|
||||
public short _LWL { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,27 +4,27 @@
|
||||
|
||||
public class Pruefgang
|
||||
{
|
||||
public Int32 PruefgangNr { get; set; }
|
||||
public int PruefgangNr { get; set; }
|
||||
|
||||
public Int16 PruefstationNr { get; set; }
|
||||
public short PruefstationNr { get; set; }
|
||||
|
||||
public Pruefstation Pruefstation { get; set; }
|
||||
|
||||
public Int16 PrueferNr { get; set; }
|
||||
public short PrueferNr { get; set; }
|
||||
|
||||
public Pruefer Pruefer { get; set; }
|
||||
|
||||
public Int32 Pruefzeit { get; set; }
|
||||
public int Pruefzeit { get; set; }
|
||||
|
||||
public Boolean PruefgangLang { get; set; }
|
||||
public bool PruefgangLang { get; set; }
|
||||
|
||||
public DateTime Datum { get; set; }
|
||||
|
||||
public String Typ { get; set; }
|
||||
public string Typ { get; set; }
|
||||
|
||||
public Int16 Nennweite { get; set; }
|
||||
public short Nennweite { get; set; }
|
||||
|
||||
public Byte Nenntemperatur { get; set; }
|
||||
public byte Nenntemperatur { get; set; }
|
||||
|
||||
public Double Lufttemperatur { get; set; }
|
||||
|
||||
@@ -34,25 +34,25 @@
|
||||
|
||||
public Double Vorlauftemperatur { get; set; }
|
||||
|
||||
public Char Einbaulage_alt { get; set; }
|
||||
public char Einbaulage_alt { get; set; }
|
||||
|
||||
public Byte Anzahl { get; set; }
|
||||
public byte Anzahl { get; set; }
|
||||
|
||||
public String Bemerkung { get; set; }
|
||||
public string Bemerkung { get; set; }
|
||||
|
||||
public Int32 DBasePruefgangNr { get; set; }
|
||||
public int DBasePruefgangNr { get; set; }
|
||||
|
||||
public Byte KalibrierID { get; set; }
|
||||
public byte KalibrierID { get; set; }
|
||||
|
||||
public String Metrolog { get; set; }
|
||||
public string Metrolog { get; set; }
|
||||
|
||||
public String FPP { get; set; }
|
||||
public string FPP { get; set; }
|
||||
|
||||
public Boolean Korrigiert { get; set; }
|
||||
public bool Korrigiert { get; set; }
|
||||
|
||||
public String Typzusatz { get; set; }
|
||||
public string Typzusatz { get; set; }
|
||||
|
||||
public Int16 Baulaenge { get; set; }
|
||||
public short Baulaenge { get; set; }
|
||||
|
||||
public PruefgangPP[] Pruefpunkte { get; } = new PruefgangPP[10];
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
public class PruefgangPP
|
||||
{
|
||||
public Int32 Nr { get; set; }
|
||||
public int Nr { get; set; }
|
||||
|
||||
public Int32 PruefgangNr { get; set; }
|
||||
public int PruefgangNr { get; set; }
|
||||
|
||||
public Int32 PruefpunktNr { get; set; }
|
||||
public int PruefpunktNr { get; set; }
|
||||
|
||||
public Double Zeit { get; set; }
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
|
||||
public Double Ist { get; set; }
|
||||
|
||||
public Int32 RefZSerienNr { get; set; }
|
||||
public int RefZSerienNr { get; set; }
|
||||
|
||||
public Double RefFehl { get; set; }
|
||||
|
||||
public Double Ist_V { get; set; }
|
||||
|
||||
public Byte Waage { get; set; }
|
||||
public byte Waage { get; set; }
|
||||
|
||||
public Char Info { get; set; }
|
||||
public char Info { get; set; }
|
||||
|
||||
public Double T_Start { get; set; }
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
|
||||
public class Pruefstation
|
||||
{
|
||||
public Int16 PruefstationNr { get; set; }
|
||||
public short PruefstationNr { get; set; }
|
||||
|
||||
public Int16 PruefstationTyp { get; set; }
|
||||
public short PruefstationTyp { get; set; }
|
||||
|
||||
public Int16 ScanKennung { get; set; }
|
||||
public short ScanKennung { get; set; }
|
||||
|
||||
public String Bemerkung { get; set; }
|
||||
public string Bemerkung { get; set; }
|
||||
|
||||
public Boolean Gesperrt { get; set; }
|
||||
public bool Gesperrt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,83 +5,83 @@
|
||||
|
||||
public class InspectionOrder
|
||||
{
|
||||
public Int16 Id { get; set; }
|
||||
public short Id { get; set; }
|
||||
|
||||
public Int32? Orderno { get; set; }
|
||||
public int? Orderno { get; set; }
|
||||
|
||||
public Int16? Posno { get; set; }
|
||||
public short? Posno { get; set; }
|
||||
|
||||
public Int32? Pono { get; set; }
|
||||
public int? Pono { get; set; }
|
||||
|
||||
public Int32 IdentNr { get; set; }
|
||||
public int IdentNr { get; set; }
|
||||
|
||||
public String Name { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public String Variant { get; set; }
|
||||
public string Variant { get; set; }
|
||||
|
||||
public String SizeName { get; set; }
|
||||
public string SizeName { get; set; }
|
||||
|
||||
public Byte Size { get; set; }
|
||||
public byte Size { get; set; }
|
||||
|
||||
public Byte Range { get; set; }
|
||||
public byte Range { get; set; }
|
||||
|
||||
public Byte Direction { get; set; }
|
||||
public byte Direction { get; set; }
|
||||
|
||||
public Byte IntPart { get; set; }
|
||||
public byte IntPart { get; set; }
|
||||
|
||||
public Int32 Fraction { get; set; }
|
||||
public int Fraction { get; set; }
|
||||
|
||||
public Int16 Crf { get; set; }
|
||||
public short Crf { get; set; }
|
||||
|
||||
public Byte Ppr { get; set; }
|
||||
public byte Ppr { get; set; }
|
||||
|
||||
public Byte MeterUnits { get; set; }
|
||||
public byte MeterUnits { get; set; }
|
||||
|
||||
public Byte FlowUnits { get; set; }
|
||||
public byte FlowUnits { get; set; }
|
||||
|
||||
public Byte FlowRate { get; set; }
|
||||
public byte FlowRate { get; set; }
|
||||
|
||||
public Byte PulseWeight { get; set; }
|
||||
public byte PulseWeight { get; set; }
|
||||
|
||||
public Byte PulseWidth { get; set; }
|
||||
public byte PulseWidth { get; set; }
|
||||
|
||||
public Byte PulseUpdate { get; set; }
|
||||
public byte PulseUpdate { get; set; }
|
||||
|
||||
public Byte AlarmPercistancePeriodDays { get; set; }
|
||||
public byte AlarmPercistancePeriodDays { get; set; }
|
||||
|
||||
public Int32 DataLogIntervalMinutes { get; set; }
|
||||
public int DataLogIntervalMinutes { get; set; }
|
||||
|
||||
public Int16 NumberOfReadingDigits { get; set; }
|
||||
public short NumberOfReadingDigits { get; set; }
|
||||
|
||||
public Int32 OptionalUniDirFields { get; set; }
|
||||
public int OptionalUniDirFields { get; set; }
|
||||
|
||||
public String ReadingPreset { get; set; }
|
||||
public string ReadingPreset { get; set; }
|
||||
|
||||
public String DeviceID { get; set; }
|
||||
public string DeviceID { get; set; }
|
||||
|
||||
public Single LeakAlarmGPM { get; set; }
|
||||
|
||||
public Int64 LeakAlarmTime { get; set; }
|
||||
public long LeakAlarmTime { get; set; }
|
||||
|
||||
public Single HighFlowAlarmGPM { get; set; }
|
||||
|
||||
public Int64 HighFlowAlarmTime { get; set; }
|
||||
public long HighFlowAlarmTime { get; set; }
|
||||
|
||||
public Single ReverseFlowAlarmGPM { get; set; }
|
||||
|
||||
public Int64 ReverseFlowAlarmTime { get; set; }
|
||||
public long ReverseFlowAlarmTime { get; set; }
|
||||
|
||||
public String PartNr { get; set; }
|
||||
public string PartNr { get; set; }
|
||||
|
||||
public String Configiguration { get; set; }
|
||||
public string Configiguration { get; set; }
|
||||
|
||||
public String DescriptionL1 { get; set; }
|
||||
public string DescriptionL1 { get; set; }
|
||||
|
||||
public String DescriptionL2 { get; set; }
|
||||
public string DescriptionL2 { get; set; }
|
||||
|
||||
public String DescriptionL3 { get; set; }
|
||||
public string DescriptionL3 { get; set; }
|
||||
|
||||
public String TestClass { get; set; }
|
||||
public string TestClass { get; set; }
|
||||
|
||||
public List<TestPoint> TestPoints { get; set; }
|
||||
}
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
|
||||
public class TestMeter
|
||||
{
|
||||
public Int32 RunId { get; set; }
|
||||
public int RunId { get; set; }
|
||||
|
||||
public Int16 DefaultId { get; set; }
|
||||
public short DefaultId { get; set; }
|
||||
|
||||
public String PsNr { get; set; }
|
||||
public string PsNr { get; set; }
|
||||
|
||||
public Int32 SlotNr { get; set; }
|
||||
public int SlotNr { get; set; }
|
||||
|
||||
public String BuildInfo { get; set; }
|
||||
public string BuildInfo { get; set; }
|
||||
|
||||
public DateTime AddDate { get; set; }
|
||||
}
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
|
||||
public class TestPoint
|
||||
{
|
||||
public Int16 Id { get; set; }
|
||||
public short Id { get; set; }
|
||||
|
||||
public Int32 Nr { get; set; }
|
||||
public int Nr { get; set; }
|
||||
|
||||
public Single GPM { get; set; }
|
||||
|
||||
public Int16 Rotations { get; set; }
|
||||
public short Rotations { get; set; }
|
||||
|
||||
public Int16 Duration { get; set; }
|
||||
public short Duration { get; set; }
|
||||
|
||||
public Single MinAcc { get; set; }
|
||||
|
||||
|
||||
@@ -4,21 +4,21 @@ namespace LaaProduction.Data.Omni.Models
|
||||
{
|
||||
public class TestRun
|
||||
{
|
||||
public Int32 Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
public Int32 Pruefgang { get; set; }
|
||||
public int Pruefgang { get; set; }
|
||||
|
||||
public Int32 Pruefer { get; set; }
|
||||
public int Pruefer { get; set; }
|
||||
|
||||
public String Pruefklasse { get; set; }
|
||||
public string Pruefklasse { get; set; }
|
||||
|
||||
public Int16 DefaultId { get; set; }
|
||||
public short DefaultId { get; set; }
|
||||
|
||||
public String PSNO { get; set; }
|
||||
public string PSNO { get; set; }
|
||||
|
||||
public Byte Slot { get; set; }
|
||||
public byte Slot { get; set; }
|
||||
|
||||
public String Pcb { get; set; }
|
||||
public string Pcb { get; set; }
|
||||
|
||||
public DateTime AddDate { get; set; }
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
|
||||
public class TestedPoint
|
||||
{
|
||||
public Int32 RunId { get; set; }
|
||||
public int RunId { get; set; }
|
||||
|
||||
public String Pcb { get; set; }
|
||||
public string Pcb { get; set; }
|
||||
|
||||
public Int32 Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
public Int32 Nr{ get; set; }
|
||||
public int Nr{ get; set; }
|
||||
|
||||
public Int32 Rotations { get; set; }
|
||||
public int Rotations { get; set; }
|
||||
|
||||
public Double Duration { get; set; }
|
||||
|
||||
@@ -22,6 +22,6 @@
|
||||
|
||||
public Double ACC { get; set; }
|
||||
|
||||
public String Debug { get; set; }
|
||||
public string Debug { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
|
||||
public class TestedRun
|
||||
{
|
||||
public Int32 RunId { get; set; }
|
||||
public int RunId { get; set; }
|
||||
|
||||
public String Pcb { get; set; }
|
||||
public string Pcb { get; set; }
|
||||
|
||||
public Double[] ACC { get; set; }
|
||||
|
||||
public Double CrrF { get; set; }
|
||||
|
||||
public Boolean Succeeded { get; set; }
|
||||
public bool Succeeded { get; set; }
|
||||
|
||||
public String Debug { get; set; }
|
||||
public string Debug { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{
|
||||
private readonly SqlConnection sql;
|
||||
|
||||
public OmniDbContext(String connectionString, Action<String> sqlErrorHandler)
|
||||
public OmniDbContext(string connectionString, Action<string> sqlErrorHandler)
|
||||
=> this.sql = new SqlConnection(connectionString, sqlErrorHandler);
|
||||
|
||||
public TestRun CreateTestRun(TestRun testRun)
|
||||
@@ -52,7 +52,7 @@
|
||||
.SetParameter(nameof(testRun.ManifacturingDate), testRun.ManifacturingDate)
|
||||
.FirstOrDefault(x =>
|
||||
{
|
||||
testRun.Id = x.GetValue<Int32>(0);
|
||||
testRun.Id = x.GetValue<int>(0);
|
||||
testRun.AddDate = x.GetValue<DateTime>(1);
|
||||
testRun.ManifacturingDate = x.GetValue<DateTime>(2);
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
return testRun;
|
||||
}
|
||||
|
||||
public Int32 CreateTestRun(Int32 psno, Int32 tester, String @class, Int32 count)
|
||||
public int CreateTestRun(int psno, int tester, string @class, int count)
|
||||
{
|
||||
if (psno == 0)
|
||||
{
|
||||
@@ -107,17 +107,17 @@
|
||||
ON [od].[IdentNr] = [id].[IdentNr]
|
||||
WHERE [TestClass] = @{nameof(@class)})
|
||||
AS [x]")
|
||||
.SetParameter(nameof(psno), (Int16)psno)
|
||||
.SetParameter(nameof(tester), (Int16)tester)
|
||||
.SetParameter(nameof(psno), (short)psno)
|
||||
.SetParameter(nameof(tester), (short)tester)
|
||||
.SetParameter(nameof(@class), @class)
|
||||
.SetParameter(nameof(like), like)
|
||||
.SetParameter(nameof(count), (Byte)count)
|
||||
.FirstOrDefault(x => x.GetValue<Int32>(0));
|
||||
.SetParameter(nameof(count), (byte)count)
|
||||
.FirstOrDefault(x => x.GetValue<int>(0));
|
||||
|
||||
return pruefgang;
|
||||
}
|
||||
|
||||
public InspectionOrder GetInspectionOrderForClass(String search)
|
||||
public InspectionOrder GetInspectionOrderForClass(string search)
|
||||
{
|
||||
var inspectionOrder = default(InspectionOrder);
|
||||
var inspectionOrderRows = this.sql
|
||||
@@ -175,40 +175,40 @@
|
||||
{
|
||||
inspectionOrder = new InspectionOrder
|
||||
{
|
||||
Id = x.GetValue<Int16>(0),
|
||||
IdentNr = x.GetValue<Int32>(1),
|
||||
Name = x.GetValue<String>(2),
|
||||
Variant = x.GetValue<String>(3),
|
||||
SizeName = x.GetValue<String>(4),
|
||||
Size = x.GetValue<Byte>(5),
|
||||
Range = x.GetValue<Byte>(6),
|
||||
Direction = x.GetValue<Byte>(7),
|
||||
IntPart = x.GetValue<Byte>(8),
|
||||
Fraction = x.GetValue<Int32>(9),
|
||||
Crf = x.GetValue<Int16>(10),
|
||||
Ppr = x.GetValue<Byte>(11),
|
||||
MeterUnits = x.GetValue<Byte>(12),
|
||||
FlowUnits = x.GetValue<Byte>(13),
|
||||
FlowRate = x.GetValue<Byte>(14),
|
||||
PulseWeight = x.GetValue<Byte>(15),
|
||||
PulseWidth = x.GetValue<Byte>(16),
|
||||
PulseUpdate = x.GetValue<Byte>(17),
|
||||
AlarmPercistancePeriodDays = x.GetValue<Byte>(18),
|
||||
DataLogIntervalMinutes = x.GetValue<Int32>(19),
|
||||
NumberOfReadingDigits = x.GetValue<Int16>(20),
|
||||
OptionalUniDirFields = x.GetValue<Int32>(21),
|
||||
ReadingPreset = x.GetValue<String>(22),
|
||||
DeviceID = x.GetValue<String>(23),
|
||||
Id = x.GetValue<short>(0),
|
||||
IdentNr = x.GetValue<int>(1),
|
||||
Name = x.GetValue<string>(2),
|
||||
Variant = x.GetValue<string>(3),
|
||||
SizeName = x.GetValue<string>(4),
|
||||
Size = x.GetValue<byte>(5),
|
||||
Range = x.GetValue<byte>(6),
|
||||
Direction = x.GetValue<byte>(7),
|
||||
IntPart = x.GetValue<byte>(8),
|
||||
Fraction = x.GetValue<int>(9),
|
||||
Crf = x.GetValue<short>(10),
|
||||
Ppr = x.GetValue<byte>(11),
|
||||
MeterUnits = x.GetValue<byte>(12),
|
||||
FlowUnits = x.GetValue<byte>(13),
|
||||
FlowRate = x.GetValue<byte>(14),
|
||||
PulseWeight = x.GetValue<byte>(15),
|
||||
PulseWidth = x.GetValue<byte>(16),
|
||||
PulseUpdate = x.GetValue<byte>(17),
|
||||
AlarmPercistancePeriodDays = x.GetValue<byte>(18),
|
||||
DataLogIntervalMinutes = x.GetValue<int>(19),
|
||||
NumberOfReadingDigits = x.GetValue<short>(20),
|
||||
OptionalUniDirFields = x.GetValue<int>(21),
|
||||
ReadingPreset = x.GetValue<string>(22),
|
||||
DeviceID = x.GetValue<string>(23),
|
||||
LeakAlarmGPM = x.GetValue<Single>(24),
|
||||
LeakAlarmTime = x.GetValue<Int64>(25),
|
||||
LeakAlarmTime = x.GetValue<long>(25),
|
||||
HighFlowAlarmGPM = x.GetValue<Single>(26),
|
||||
HighFlowAlarmTime = x.GetValue<Int64>(27),
|
||||
HighFlowAlarmTime = x.GetValue<long>(27),
|
||||
ReverseFlowAlarmGPM = x.GetValue<Single>(28),
|
||||
ReverseFlowAlarmTime = x.GetValue<Int64>(29),
|
||||
DescriptionL1 = x.GetValue<String>(30),
|
||||
DescriptionL2 = x.GetValue<String>(31),
|
||||
DescriptionL3 = x.GetValue<String>(32),
|
||||
TestClass = x.GetValue<String>(33)
|
||||
ReverseFlowAlarmTime = x.GetValue<long>(29),
|
||||
DescriptionL1 = x.GetValue<string>(30),
|
||||
DescriptionL2 = x.GetValue<string>(31),
|
||||
DescriptionL3 = x.GetValue<string>(32),
|
||||
TestClass = x.GetValue<string>(33)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -219,11 +219,11 @@
|
||||
|
||||
inspectionOrder.TestPoints.Add(new TestPoint
|
||||
{
|
||||
Id = x.GetValue<Int16>(34),
|
||||
Nr = x.GetValue<Int32>(35),
|
||||
Id = x.GetValue<short>(34),
|
||||
Nr = x.GetValue<int>(35),
|
||||
GPM = x.GetValue<Single>(36),
|
||||
Rotations = x.GetValue<Int16>(37),
|
||||
Duration = x.GetValue<Int16>(38),
|
||||
Rotations = x.GetValue<short>(37),
|
||||
Duration = x.GetValue<short>(38),
|
||||
MinAcc = x.GetValue<Single>(39),
|
||||
MaxAcc = x.GetValue<Single>(40),
|
||||
});
|
||||
@@ -235,7 +235,7 @@
|
||||
return inspectionOrder;
|
||||
}
|
||||
|
||||
public InspectionOrder GetInspectionOrderForPO(Int32 pono)
|
||||
public InspectionOrder GetInspectionOrderForPO(int pono)
|
||||
{
|
||||
var inspectionOrder = default(InspectionOrder);
|
||||
var inspectionOrderRows = this.sql
|
||||
@@ -298,43 +298,43 @@
|
||||
{
|
||||
inspectionOrder = new InspectionOrder
|
||||
{
|
||||
Id = x.GetValue<Int16>(0),
|
||||
Orderno = x.GetValue<Int32?>(1),
|
||||
Posno = x.GetValue<Int16?>(2),
|
||||
Pono = x.GetValue<Int32?>(3),
|
||||
IdentNr = x.GetValue<Int32>(4),
|
||||
Name = x.GetValue<String>(5),
|
||||
Variant = x.GetValue<String>(6),
|
||||
SizeName = x.GetValue<String>(7),
|
||||
Size = x.GetValue<Byte>(8),
|
||||
Range = x.GetValue<Byte>(9),
|
||||
Direction = x.GetValue<Byte>(10),
|
||||
IntPart = x.GetValue<Byte>(11),
|
||||
Fraction = x.GetValue<Int32>(12),
|
||||
Crf = x.GetValue<Int16>(13),
|
||||
Ppr = x.GetValue<Byte>(14),
|
||||
MeterUnits = x.GetValue<Byte>(15),
|
||||
FlowUnits = x.GetValue<Byte>(16),
|
||||
FlowRate = x.GetValue<Byte>(17),
|
||||
PulseWeight = x.GetValue<Byte>(18),
|
||||
PulseWidth = x.GetValue<Byte>(19),
|
||||
PulseUpdate = x.GetValue<Byte>(20),
|
||||
AlarmPercistancePeriodDays = x.GetValue<Byte>(21),
|
||||
DataLogIntervalMinutes = x.GetValue<Int32>(22),
|
||||
NumberOfReadingDigits = x.GetValue<Int16>(23),
|
||||
OptionalUniDirFields = x.GetValue<Int32>(24),
|
||||
ReadingPreset = x.GetValue<String>(25),
|
||||
DeviceID = x.GetValue<String>(26),
|
||||
Id = x.GetValue<short>(0),
|
||||
Orderno = x.GetValue<int?>(1),
|
||||
Posno = x.GetValue<short?>(2),
|
||||
Pono = x.GetValue<int?>(3),
|
||||
IdentNr = x.GetValue<int>(4),
|
||||
Name = x.GetValue<string>(5),
|
||||
Variant = x.GetValue<string>(6),
|
||||
SizeName = x.GetValue<string>(7),
|
||||
Size = x.GetValue<byte>(8),
|
||||
Range = x.GetValue<byte>(9),
|
||||
Direction = x.GetValue<byte>(10),
|
||||
IntPart = x.GetValue<byte>(11),
|
||||
Fraction = x.GetValue<int>(12),
|
||||
Crf = x.GetValue<short>(13),
|
||||
Ppr = x.GetValue<byte>(14),
|
||||
MeterUnits = x.GetValue<byte>(15),
|
||||
FlowUnits = x.GetValue<byte>(16),
|
||||
FlowRate = x.GetValue<byte>(17),
|
||||
PulseWeight = x.GetValue<byte>(18),
|
||||
PulseWidth = x.GetValue<byte>(19),
|
||||
PulseUpdate = x.GetValue<byte>(20),
|
||||
AlarmPercistancePeriodDays = x.GetValue<byte>(21),
|
||||
DataLogIntervalMinutes = x.GetValue<int>(22),
|
||||
NumberOfReadingDigits = x.GetValue<short>(23),
|
||||
OptionalUniDirFields = x.GetValue<int>(24),
|
||||
ReadingPreset = x.GetValue<string>(25),
|
||||
DeviceID = x.GetValue<string>(26),
|
||||
LeakAlarmGPM = x.GetValue<Single>(27),
|
||||
LeakAlarmTime = x.GetValue<Int64>(28),
|
||||
LeakAlarmTime = x.GetValue<long>(28),
|
||||
HighFlowAlarmGPM = x.GetValue<Single>(29),
|
||||
HighFlowAlarmTime = x.GetValue<Int64>(30),
|
||||
HighFlowAlarmTime = x.GetValue<long>(30),
|
||||
ReverseFlowAlarmGPM = x.GetValue<Single>(31),
|
||||
ReverseFlowAlarmTime = x.GetValue<Int64>(32),
|
||||
DescriptionL1 = x.GetValue<String>(33),
|
||||
DescriptionL2 = x.GetValue<String>(34),
|
||||
DescriptionL3 = x.GetValue<String>(35),
|
||||
TestClass = x.GetValue<String>(36)
|
||||
ReverseFlowAlarmTime = x.GetValue<long>(32),
|
||||
DescriptionL1 = x.GetValue<string>(33),
|
||||
DescriptionL2 = x.GetValue<string>(34),
|
||||
DescriptionL3 = x.GetValue<string>(35),
|
||||
TestClass = x.GetValue<string>(36)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -345,11 +345,11 @@
|
||||
|
||||
inspectionOrder.TestPoints.Add(new TestPoint
|
||||
{
|
||||
Id = x.GetValue<Int16>(37),
|
||||
Nr = x.GetValue<Int32>(38),
|
||||
Id = x.GetValue<short>(37),
|
||||
Nr = x.GetValue<int>(38),
|
||||
GPM = x.GetValue<Single>(39),
|
||||
Rotations = x.GetValue<Int16>(40),
|
||||
Duration = x.GetValue<Int16>(41),
|
||||
Rotations = x.GetValue<short>(40),
|
||||
Duration = x.GetValue<short>(41),
|
||||
MinAcc = x.GetValue<Single>(42),
|
||||
MaxAcc = x.GetValue<Single>(43),
|
||||
});
|
||||
@@ -361,7 +361,7 @@
|
||||
return inspectionOrder;
|
||||
}
|
||||
|
||||
public Boolean UpdateTestRun(TestedPoint point)
|
||||
public bool UpdateTestRun(TestedPoint point)
|
||||
=> this.sql
|
||||
.CreateCommand($@"
|
||||
UPDATE [OmniTestRuns]
|
||||
@@ -385,12 +385,12 @@
|
||||
.SetParameter(nameof(point.Debug), point.Debug)
|
||||
.ExecuteNonQuery() == 1;
|
||||
|
||||
public Boolean UpdateTestRun(TestedRun run)
|
||||
public bool UpdateTestRun(TestedRun run)
|
||||
{
|
||||
var accuracies = new Dictionary<String, Double>();
|
||||
var accuracies = new Dictionary<string, Double>();
|
||||
var length = run.ACC?.Length ?? 0;
|
||||
|
||||
for (Int32 i = 0; i < length; i++)
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
accuracies[$"Q{i + 1}_Acc"] = run.ACC[i];
|
||||
}
|
||||
|
||||
+2743
-2743
File diff suppressed because it is too large
Load Diff
@@ -16,9 +16,9 @@
|
||||
private static readonly IIdentity anonymous
|
||||
= new ClaimsIdentity(
|
||||
claims: Array.Empty<Claim>(),
|
||||
authenticationType: String.Empty,
|
||||
nameType: String.Empty,
|
||||
roleType: String.Empty);
|
||||
authenticationType: string.Empty,
|
||||
nameType: string.Empty,
|
||||
roleType: string.Empty);
|
||||
|
||||
private readonly IEmployeesRepository employeesRepository;
|
||||
private readonly ISoftwareRepository softwareRepository;
|
||||
@@ -29,7 +29,7 @@
|
||||
this.softwareRepository = softwareRepository;
|
||||
}
|
||||
|
||||
public Boolean ChangePassword(String password, String bearer)
|
||||
public bool ChangePassword(string password, string bearer)
|
||||
{
|
||||
var tokenData = this.employeesRepository.GetTokenData(bearer);
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
return this.employeesRepository.SetPassword(tokenData.EmployeeId, password);
|
||||
}
|
||||
|
||||
public IPrincipal GetClaimsPrincipal(String token)
|
||||
public IPrincipal GetClaimsPrincipal(string token)
|
||||
{
|
||||
var claimsIdentity = anonymous;
|
||||
var tokenData = this.employeesRepository.GetTokenData(token);
|
||||
@@ -86,9 +86,9 @@
|
||||
return new ClaimsPrincipal(claimsIdentity);
|
||||
}
|
||||
|
||||
public Boolean? Login(LDAPLoginModel model, out String bearer)
|
||||
public bool? Login(LDAPLoginModel model, out string bearer)
|
||||
{
|
||||
bearer = default(String);
|
||||
bearer = default(string);
|
||||
|
||||
var softwareId = this.GetOrCreateSoftwareId(
|
||||
model.Assembly,
|
||||
@@ -113,7 +113,7 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
public String Login(UserLoginModel model)
|
||||
public string Login(UserLoginModel model)
|
||||
{
|
||||
var softwareId = this.GetOrCreateSoftwareId(
|
||||
model.Assembly,
|
||||
@@ -123,29 +123,29 @@
|
||||
|
||||
if (softwareId <= 0)
|
||||
{
|
||||
return default(String);
|
||||
return default(string);
|
||||
}
|
||||
|
||||
var employeeNr = this.employeesRepository.FindEmployeeNr(model.Username, model.Password);
|
||||
|
||||
if (employeeNr <= 0)
|
||||
{
|
||||
return default(String);
|
||||
return default(string);
|
||||
}
|
||||
|
||||
return this.GetOrCreateAuthToken(softwareId, employeeNr);
|
||||
}
|
||||
|
||||
public void ResetPassword(Int16 employeeId)
|
||||
public void ResetPassword(short employeeId)
|
||||
{
|
||||
this.employeesRepository.ResetPassword(employeeId);
|
||||
this.employeesRepository.ResetTokens(employeeId);
|
||||
}
|
||||
|
||||
public void SetPassword(Int16 employeeId, String password)
|
||||
public void SetPassword(short employeeId, string password)
|
||||
=> this.employeesRepository.SetPassword(employeeId, password);
|
||||
|
||||
private Int16 GetOrCreateSoftwareId(String assembly, Int32 major, Int32 minor, Int32 build)
|
||||
private short GetOrCreateSoftwareId(string assembly, int major, int minor, int build)
|
||||
{
|
||||
/// Gets the app id for provided assembly name
|
||||
var softwareId = this.softwareRepository.SoftwareId(assembly);
|
||||
@@ -160,9 +160,9 @@
|
||||
return softwareId;
|
||||
}
|
||||
|
||||
public String GetOrCreateAuthToken(Int16 appId, Int16 userId)
|
||||
public string GetOrCreateAuthToken(short appId, short userId)
|
||||
{
|
||||
var token = default(String);
|
||||
var token = default(string);
|
||||
|
||||
if (appId > 0 && userId > 0)
|
||||
{
|
||||
@@ -174,9 +174,9 @@
|
||||
return token;
|
||||
}
|
||||
|
||||
public Boolean? Register(LDAPRegisterModel model, out String bearer)
|
||||
public bool? Register(LDAPRegisterModel model, out string bearer)
|
||||
{
|
||||
bearer = default(String);
|
||||
bearer = default(string);
|
||||
|
||||
var softwareId = this.GetOrCreateSoftwareId(
|
||||
model.Assembly,
|
||||
|
||||
+5
-5
@@ -7,17 +7,17 @@
|
||||
public class DateTimeAttribute : ValidationAttribute
|
||||
{
|
||||
private readonly DateTimeOptions option;
|
||||
private readonly String otherProperty;
|
||||
private readonly string otherProperty;
|
||||
|
||||
public DateTimeAttribute(DateTimeOptions option, String otherProperty)
|
||||
public DateTimeAttribute(DateTimeOptions option, string otherProperty)
|
||||
{
|
||||
this.option = option;
|
||||
this.otherProperty = $"{otherProperty}";
|
||||
}
|
||||
|
||||
protected override ValidationResult IsValid(Object value, ValidationContext validationContext)
|
||||
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
|
||||
{
|
||||
var validationMessage = default(String);
|
||||
var validationMessage = default(string);
|
||||
|
||||
if (value is DateTime currentDate)
|
||||
{
|
||||
@@ -59,7 +59,7 @@
|
||||
validationMessage = $"The '{validationContext?.DisplayName}' is invalid.";
|
||||
}
|
||||
|
||||
if (String.IsNullOrWhiteSpace(validationMessage))
|
||||
if (string.IsNullOrWhiteSpace(validationMessage))
|
||||
{
|
||||
return ValidationResult.Success;
|
||||
}
|
||||
|
||||
@@ -21,24 +21,24 @@
|
||||
this.rolesRepository = rolesRepository;
|
||||
}
|
||||
|
||||
public Object GetEmployee(Int16 employeeId)
|
||||
public object GetEmployee(short employeeId)
|
||||
{
|
||||
var employee = this.employeesRepository.Find(employeeId);
|
||||
|
||||
if (employee != null)
|
||||
{
|
||||
employee.Roles = this.rolesRepository.All(employeeId) ?? Array.Empty<String>();
|
||||
employee.Functions = this.functionsRepository.EmployeeAll(employeeId) ?? Array.Empty<String>();
|
||||
employee.Roles = this.rolesRepository.All(employeeId) ?? Array.Empty<string>();
|
||||
employee.Functions = this.functionsRepository.EmployeeAll(employeeId) ?? Array.Empty<string>();
|
||||
}
|
||||
|
||||
return employee ?? new Object { };
|
||||
return employee ?? new object { };
|
||||
}
|
||||
|
||||
public IEnumerable<Object> GetEmployees()
|
||||
public IEnumerable<object> GetEmployees()
|
||||
=> this.employeesRepository.All()
|
||||
?? Array.Empty<Employee>();
|
||||
|
||||
public IEnumerable<Object> GetRoles()
|
||||
public IEnumerable<object> GetRoles()
|
||||
=> this.rolesRepository
|
||||
.All()
|
||||
.GroupBy(x => x.Name)
|
||||
@@ -48,15 +48,15 @@
|
||||
Employees = x.Select(e => e.EmployeeId)
|
||||
});
|
||||
|
||||
public IEnumerable<String> GetRoles(Int16 employeeId)
|
||||
=> this.rolesRepository.All(employeeId) ?? Array.Empty<String>();
|
||||
public IEnumerable<string> GetRoles(short employeeId)
|
||||
=> this.rolesRepository.All(employeeId) ?? Array.Empty<string>();
|
||||
|
||||
public IEnumerable<Object> ListEmployees()
|
||||
public IEnumerable<object> ListEmployees()
|
||||
=> this.employeesRepository
|
||||
.All()
|
||||
.Select(x => new { x.EmployeeId, x.FullName });
|
||||
|
||||
public void UpdateEmployeeFunctions(Int16 employeeId, IEnumerable<String> functions)
|
||||
public void UpdateEmployeeFunctions(short employeeId, IEnumerable<string> functions)
|
||||
{
|
||||
this.functionsRepository.Delete(employeeId);
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateEmployeeRoles(Int16 employeeId, IEnumerable<String> roles)
|
||||
public void UpdateEmployeeRoles(short employeeId, IEnumerable<string> roles)
|
||||
{
|
||||
this.rolesRepository.Delete(employeeId);
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateRoleEmployees(String role, IEnumerable<Int16> employees)
|
||||
public void UpdateRoleEmployees(string role, IEnumerable<short> employees)
|
||||
{
|
||||
this.rolesRepository.Delete(role);
|
||||
|
||||
|
||||
@@ -18,25 +18,25 @@
|
||||
this.equipments = equipments;
|
||||
}
|
||||
|
||||
public Int32 Add(PruefmittelPruefung model)
|
||||
public int Add(PruefmittelPruefung model)
|
||||
{
|
||||
model.PruefdatumSoll = model.PruefdatumIst.AddDays(model.Pruefintervall);
|
||||
|
||||
return this.equipments.Add(model);
|
||||
}
|
||||
|
||||
public PruefmittelPruefung FindById(Int32 pruefmittelId)
|
||||
public PruefmittelPruefung FindById(int pruefmittelId)
|
||||
=> this.equipments.FindById(pruefmittelId)
|
||||
?? new PruefmittelPruefung();
|
||||
|
||||
public IEnumerable<Int32> GetDaysInSchedule(PruefmittelPruefung equipment)
|
||||
public IEnumerable<int> GetDaysInSchedule(PruefmittelPruefung equipment)
|
||||
{
|
||||
var matches = Regex.Matches($"{equipment?.Schedule}", "\\d+", RegexOptions.Multiline);
|
||||
var daysInSchedule = new List<Int32>();
|
||||
var daysInSchedule = new List<int>();
|
||||
|
||||
foreach (Match match in matches)
|
||||
{
|
||||
if (match.Success && Int32.TryParse(match.Value, out var day))
|
||||
if (match.Success && int.TryParse(match.Value, out var day))
|
||||
{
|
||||
daysInSchedule.Add(day);
|
||||
}
|
||||
@@ -45,13 +45,13 @@
|
||||
return daysInSchedule;
|
||||
}
|
||||
|
||||
public Int32 Remove(Int32 pruefmittelId)
|
||||
public int Remove(int pruefmittelId)
|
||||
=> this.equipments.Remove(pruefmittelId);
|
||||
|
||||
public IEnumerable<PruefmittelPruefung> SelectAll()
|
||||
=> this.equipments.SelectAll();
|
||||
|
||||
public IEnumerable<PruefmittelPruefung> SelectAll(Int32 softwareId)
|
||||
public IEnumerable<PruefmittelPruefung> SelectAll(int softwareId)
|
||||
{
|
||||
var equipments = this.equipments
|
||||
.SelectAll(softwareId)
|
||||
@@ -72,7 +72,7 @@
|
||||
return equipments;
|
||||
}
|
||||
|
||||
public void SetInspected(Int32 pruefmittelId)
|
||||
public void SetInspected(int pruefmittelId)
|
||||
{
|
||||
var existing = this.equipments.FindById(pruefmittelId);
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
this.equipments.Update(existing);
|
||||
}
|
||||
|
||||
public Int32 Update(PruefmittelPruefung model)
|
||||
public int Update(PruefmittelPruefung model)
|
||||
=> this.equipments.Update(model);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
|
||||
public interface IAccountManager
|
||||
{
|
||||
Boolean ChangePassword(String password, String bearer);
|
||||
bool ChangePassword(string password, string bearer);
|
||||
|
||||
IPrincipal GetClaimsPrincipal(String token);
|
||||
IPrincipal GetClaimsPrincipal(string token);
|
||||
|
||||
Boolean? Login(LDAPLoginModel model, out String bearer);
|
||||
bool? Login(LDAPLoginModel model, out string bearer);
|
||||
|
||||
String Login(UserLoginModel model);
|
||||
string Login(UserLoginModel model);
|
||||
|
||||
void ResetPassword(Int16 employeeId);
|
||||
void ResetPassword(short employeeId);
|
||||
|
||||
void SetPassword(Int16 employeeId, String password);
|
||||
void SetPassword(short employeeId, string password);
|
||||
|
||||
Boolean? Register(LDAPRegisterModel model, out String bearer);
|
||||
bool? Register(LDAPRegisterModel model, out string bearer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
|
||||
public interface IEmployeesManager
|
||||
{
|
||||
Object GetEmployee(Int16 employeeId);
|
||||
object GetEmployee(short employeeId);
|
||||
|
||||
IEnumerable<Object> GetEmployees();
|
||||
IEnumerable<object> GetEmployees();
|
||||
|
||||
IEnumerable<Object> GetRoles();
|
||||
IEnumerable<object> GetRoles();
|
||||
|
||||
IEnumerable<String> GetRoles(Int16 employeeId);
|
||||
IEnumerable<string> GetRoles(short employeeId);
|
||||
|
||||
IEnumerable<Object> ListEmployees();
|
||||
IEnumerable<object> ListEmployees();
|
||||
|
||||
void UpdateEmployeeFunctions(Int16 employeeId, IEnumerable<String> functions);
|
||||
void UpdateEmployeeFunctions(short employeeId, IEnumerable<string> functions);
|
||||
|
||||
void UpdateEmployeeRoles(Int16 employeeId, IEnumerable<String> roles);
|
||||
void UpdateEmployeeRoles(short employeeId, IEnumerable<string> roles);
|
||||
|
||||
void UpdateRoleEmployees(String role, IEnumerable<Int16> employees);
|
||||
void UpdateRoleEmployees(string role, IEnumerable<short> employees);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
|
||||
public interface IEquipmentsManager
|
||||
{
|
||||
Int32 Add(PruefmittelPruefung model);
|
||||
int Add(PruefmittelPruefung model);
|
||||
|
||||
PruefmittelPruefung FindById(Int32 pruefmittelId);
|
||||
PruefmittelPruefung FindById(int pruefmittelId);
|
||||
|
||||
IEnumerable<Int32> GetDaysInSchedule(PruefmittelPruefung equipment);
|
||||
IEnumerable<int> GetDaysInSchedule(PruefmittelPruefung equipment);
|
||||
|
||||
Int32 Remove(Int32 pruefmittelId);
|
||||
int Remove(int pruefmittelId);
|
||||
|
||||
IEnumerable<PruefmittelPruefung> SelectAll();
|
||||
|
||||
IEnumerable<PruefmittelPruefung> SelectAll(Int32 softwareId);
|
||||
IEnumerable<PruefmittelPruefung> SelectAll(int softwareId);
|
||||
|
||||
void SetInspected(Int32 pruefmittelId);
|
||||
void SetInspected(int pruefmittelId);
|
||||
|
||||
Int32 Update(PruefmittelPruefung model);
|
||||
int Update(PruefmittelPruefung model);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
|
||||
public interface ISoftwareManager
|
||||
{
|
||||
void AddVersion(Int16 softwareId, String assemblyName, Int32 majorV, Int32 minorV, Int32 buildV, DateTime validUntil, String description);
|
||||
void AddVersion(short softwareId, string assemblyName, int majorV, int minorV, int buildV, DateTime validUntil, string description);
|
||||
|
||||
void DeleteVersion(Int32 versionId);
|
||||
void DeleteVersion(int versionId);
|
||||
|
||||
void EditVersion(Int32 versionId, DateTime? validUntil, String description);
|
||||
void EditVersion(int versionId, DateTime? validUntil, string description);
|
||||
|
||||
IEnumerable<String> GetFunctions();
|
||||
IEnumerable<string> GetFunctions();
|
||||
|
||||
IEnumerable<String> GetFunctions(String token);
|
||||
IEnumerable<string> GetFunctions(string token);
|
||||
|
||||
IEnumerable<Object> ListSoftwares();
|
||||
IEnumerable<object> ListSoftwares();
|
||||
|
||||
Object SoftwareDeteils(Int32 versionId);
|
||||
object SoftwareDeteils(int versionId);
|
||||
|
||||
void UpdateFunction(Int16 softwareId, Int32 functionId, String function, IEnumerable<Int16> employees);
|
||||
void UpdateFunction(short softwareId, int functionId, string function, IEnumerable<short> employees);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,29 +5,29 @@
|
||||
|
||||
public class Employee
|
||||
{
|
||||
public Int16 EmployeeId { get; set; }
|
||||
public short EmployeeId { get; set; }
|
||||
|
||||
public String FullName { get; set; }
|
||||
public string FullName { get; set; }
|
||||
|
||||
public String Username { get; set; }
|
||||
public string Username { get; set; }
|
||||
|
||||
public Boolean HasPassword { get; set; }
|
||||
public bool HasPassword { get; set; }
|
||||
|
||||
public Int32 RolesCount { get; set; }
|
||||
public int RolesCount { get; set; }
|
||||
|
||||
public IEnumerable<String> Roles { get; set; }
|
||||
public IEnumerable<string> Roles { get; set; }
|
||||
|
||||
public Int32 FunctionsCount { get; set; }
|
||||
public int FunctionsCount { get; set; }
|
||||
|
||||
public IEnumerable<String> Functions { get; set; }
|
||||
public IEnumerable<string> Functions { get; set; }
|
||||
}
|
||||
|
||||
public class EmployeeComparer : IEqualityComparer<Employee>
|
||||
{
|
||||
public Boolean Equals(Employee x, Employee y)
|
||||
public bool Equals(Employee x, Employee y)
|
||||
=> x?.EmployeeId == y?.EmployeeId;
|
||||
|
||||
public Int32 GetHashCode(Employee obj)
|
||||
=> obj?.EmployeeId ?? default(Int32);
|
||||
public int GetHashCode(Employee obj)
|
||||
=> obj?.EmployeeId ?? default(int);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
public class EmployeeFunction
|
||||
{
|
||||
public Int16 EmployeeId { get; set; }
|
||||
public short EmployeeId { get; set; }
|
||||
|
||||
public String Function { get; set; }
|
||||
public string Function { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
public class EmployeeRole
|
||||
{
|
||||
public Int32 EmployeeId { get; set; }
|
||||
public int EmployeeId { get; set; }
|
||||
|
||||
public String Role { get; set; }
|
||||
public string Role { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
public class EmployeeToken
|
||||
{
|
||||
public Int16 AppId { get; set; }
|
||||
public short AppId { get; set; }
|
||||
|
||||
public Int16 EmployeeId { get; set; }
|
||||
public short EmployeeId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,28 +7,28 @@
|
||||
|
||||
public class PruefmittelPruefung
|
||||
{
|
||||
public Int32 PruefmittelId { get; set; }
|
||||
public int PruefmittelId { get; set; }
|
||||
|
||||
[Range(1, Int32.MaxValue)]
|
||||
[Range(1, int.MaxValue)]
|
||||
[Display(Name = "Prüfsoftware")]
|
||||
public Int16 SoftwareId { get; set; }
|
||||
public short SoftwareId { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(100)]
|
||||
[Display(Name = "Prüfmittel Bezeichnung")]
|
||||
public String Pruefmittel { get; set; }
|
||||
public string Pruefmittel { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(30)]
|
||||
[Display(Name = "Prüfmittelnummer")]
|
||||
public String PruefmittelNr { get; set; }
|
||||
public string PruefmittelNr { get; set; }
|
||||
|
||||
[Range(1, Int32.MaxValue)]
|
||||
[Range(1, int.MaxValue)]
|
||||
[Display(Name = "Prüfintervall in Tagen")]
|
||||
public Int32 Pruefintervall { get; set; } = 1;
|
||||
public int Pruefintervall { get; set; } = 1;
|
||||
|
||||
[Display(Name = "Ist die Prüfung erforderlich?")]
|
||||
public Boolean Erforderlich { get; set; } = true;
|
||||
public bool Erforderlich { get; set; } = true;
|
||||
|
||||
[Display(Name = "Zuletzt geprüft am (yyyy-MM-dd)")]
|
||||
[DateTime(DateTimeOptions.SmallerThan, nameof(PruefdatumSoll))]
|
||||
@@ -41,45 +41,45 @@
|
||||
[Required]
|
||||
[StringLength(250)]
|
||||
[Display(Name = "Bemerkung zu der Prüfmittelprüfung.")]
|
||||
public String Bemerkung { get; set; }
|
||||
public string Bemerkung { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(250)]
|
||||
[Display(Name = "Sender E-Mail")]
|
||||
public String EmailFrom { get; set; }
|
||||
public string EmailFrom { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(500)]
|
||||
[Display(Name = "E-Mail-An liste")]
|
||||
public String EmailAn { get; set; }
|
||||
public string EmailAn { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(500)]
|
||||
[Display(Name = "E-Mail-CC liste")]
|
||||
public String InCcAn { get; set; }
|
||||
public string InCcAn { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(150)]
|
||||
[Display(Name = "Betreff")]
|
||||
public String Betreff { get; set; }
|
||||
public string Betreff { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(500)]
|
||||
[Display(Name = "Nachrichtentext")]
|
||||
public String Nachricht { get; set; }
|
||||
public string Nachricht { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(500)]
|
||||
[Display(Name = "Softwaremeldungstext")]
|
||||
public String Meldung { get; set; }
|
||||
public string Meldung { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(50)]
|
||||
[Display(Name = "E-Mailversand Zeitplan")]
|
||||
public String Schedule { get; set; } = "14, 7, 3, 1";
|
||||
public string Schedule { get; set; } = "14, 7, 3, 1";
|
||||
|
||||
public Int32 DaysLeft { get; set; }
|
||||
public int DaysLeft { get; set; }
|
||||
|
||||
public Boolean InSchedule { get; set; }
|
||||
public bool InSchedule { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
public class Role
|
||||
{
|
||||
public String Name { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public Int16 EmployeeId { get; set; }
|
||||
public short EmployeeId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
|
||||
public class SoftwareDetails
|
||||
{
|
||||
public Int16 SoftwareId { get; set; }
|
||||
public short SoftwareId { get; set; }
|
||||
|
||||
public Int32 VersionId { get; set; }
|
||||
public int VersionId { get; set; }
|
||||
|
||||
public String VersionNr { get; set; }
|
||||
public string VersionNr { get; set; }
|
||||
|
||||
public String ValidUntil { get; set; }
|
||||
public string ValidUntil { get; set; }
|
||||
|
||||
public String AssemblyName { get; set; }
|
||||
public string AssemblyName { get; set; }
|
||||
|
||||
public String Description { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public IEnumerable<SoftwareVersion> Versions { get; set; }
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
public class SoftwareFunction
|
||||
{
|
||||
public Int16 SoftwareId { get; set; }
|
||||
public short SoftwareId { get; set; }
|
||||
|
||||
public Int32 FunctionId { get; set; }
|
||||
public int FunctionId { get; set; }
|
||||
|
||||
public String Function { get; set; }
|
||||
public string Function { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,16 @@
|
||||
|
||||
public class SoftwareItem
|
||||
{
|
||||
public Int16 SoftwareId { get; set; }
|
||||
public short SoftwareId { get; set; }
|
||||
|
||||
public Int32 VersionId { get; set; }
|
||||
public int VersionId { get; set; }
|
||||
|
||||
public String AssemblyName { get; set; }
|
||||
public string AssemblyName { get; set; }
|
||||
|
||||
public String CurrentVersion { get; set; }
|
||||
public string CurrentVersion { get; set; }
|
||||
|
||||
public String Description { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public String ValidUntil { get; set; }
|
||||
public string ValidUntil { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
|
||||
public class SoftwareVersion
|
||||
{
|
||||
public Int32 VersionId { get; set; }
|
||||
public int VersionId { get; set; }
|
||||
|
||||
public String VersionNr { get; set; }
|
||||
public string VersionNr { get; set; }
|
||||
|
||||
public String Description { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public String ValidUntil { get; set; }
|
||||
public string ValidUntil { get; set; }
|
||||
|
||||
public Int16 SoftwareId { get; set; }
|
||||
public short SoftwareId { get; set; }
|
||||
|
||||
public String AssemblyName { get; set; }
|
||||
public string AssemblyName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+41
-41
@@ -34,12 +34,12 @@
|
||||
ORDER BY [FullName], [Username]")
|
||||
.ExecuteReader(x => new
|
||||
{
|
||||
EmployeeId = x.GetValue<Int16>(0),
|
||||
FullName = x.GetValue<String>(1),
|
||||
Username = x.GetValue<String>(2),
|
||||
HasPassword = !String.IsNullOrWhiteSpace(x.GetValue<String>(3)),
|
||||
Role = x.GetValue<String>(4),
|
||||
Function = x.GetValue<String>(5)
|
||||
EmployeeId = x.GetValue<short>(0),
|
||||
FullName = x.GetValue<string>(1),
|
||||
Username = x.GetValue<string>(2),
|
||||
HasPassword = !string.IsNullOrWhiteSpace(x.GetValue<string>(3)),
|
||||
Role = x.GetValue<string>(4),
|
||||
Function = x.GetValue<string>(5)
|
||||
})
|
||||
.GroupBy(x => new Employee
|
||||
{
|
||||
@@ -50,16 +50,16 @@
|
||||
}, new EmployeeComparer())
|
||||
.Select(x =>
|
||||
{
|
||||
x.Key.Roles = x.Select(r => r.Role).Distinct().Where(r => !String.IsNullOrWhiteSpace(r));
|
||||
x.Key.Roles = x.Select(r => r.Role).Distinct().Where(r => !string.IsNullOrWhiteSpace(r));
|
||||
x.Key.RolesCount = x.Key.Roles.Count();
|
||||
x.Key.Functions = x.Select(f => f.Function).Distinct().Where(r => !String.IsNullOrWhiteSpace(r));
|
||||
x.Key.Functions = x.Select(f => f.Function).Distinct().Where(r => !string.IsNullOrWhiteSpace(r));
|
||||
x.Key.FunctionsCount = x.Key.Functions.Count();
|
||||
|
||||
return x.Key;
|
||||
})
|
||||
.ToList();
|
||||
|
||||
public void CreateToken(Int16 appId, Int16 userId)
|
||||
public void CreateToken(short appId, short userId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT INTO [MitarbeiterTokens] (
|
||||
@@ -71,16 +71,16 @@
|
||||
.SetParameter(nameof(userId), userId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public Int16 FindEmployeeNr(Int32 employeeId)
|
||||
public short FindEmployeeNr(int employeeId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [MitarbeiterNr]
|
||||
FROM [Mitarbeiter]
|
||||
WHERE [EmployeeId] = @{nameof(employeeId)}")
|
||||
.SetParameter(nameof(employeeId), employeeId)
|
||||
.FirstOrDefault(x => x.GetValue<Int16>(0));
|
||||
.FirstOrDefault(x => x.GetValue<short>(0));
|
||||
|
||||
public Int16 FindEmployeeNr(String username, String password)
|
||||
public short FindEmployeeNr(string username, string password)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [MitarbeiterNr]
|
||||
@@ -90,9 +90,9 @@
|
||||
AND [PasswordHash] = @{nameof(password)}")
|
||||
.SetParameter(nameof(username), username)
|
||||
.SetParameter(nameof(password), password)
|
||||
.FirstOrDefault(x => x.GetValue<Int16>(0));
|
||||
.FirstOrDefault(x => x.GetValue<short>(0));
|
||||
|
||||
public Employee Find(Int16 employeeId)
|
||||
public Employee Find(short employeeId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [M].[MitarbeiterNr] AS [EmployeeId]
|
||||
@@ -104,13 +104,13 @@
|
||||
.SetParameter(nameof(employeeId), employeeId)
|
||||
.FirstOrDefault(x => new Employee
|
||||
{
|
||||
EmployeeId = x.GetValue<Int16>(0),
|
||||
FullName = x.GetValue<String>(1),
|
||||
Username = x.GetValue<String>(2),
|
||||
HasPassword = !String.IsNullOrWhiteSpace(x.GetValue<String>(3))
|
||||
EmployeeId = x.GetValue<short>(0),
|
||||
FullName = x.GetValue<string>(1),
|
||||
Username = x.GetValue<string>(2),
|
||||
HasPassword = !string.IsNullOrWhiteSpace(x.GetValue<string>(3))
|
||||
});
|
||||
|
||||
public Employee GetEmployee(String token)
|
||||
public Employee GetEmployee(string token)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [M].[MitarbeiterNr]
|
||||
@@ -123,12 +123,12 @@
|
||||
.SetParameter(nameof(token), token)
|
||||
.FirstOrDefault(x => new Employee
|
||||
{
|
||||
EmployeeId = x.GetValue<Int16>(0),
|
||||
FullName = x.GetValue<String>(1),
|
||||
Username = x.GetValue<String>(2)
|
||||
EmployeeId = x.GetValue<short>(0),
|
||||
FullName = x.GetValue<string>(1),
|
||||
Username = x.GetValue<string>(2)
|
||||
});
|
||||
|
||||
public String GetToken(Int16 appId, Int16 userId)
|
||||
public string GetToken(short appId, short userId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [Token]
|
||||
@@ -137,9 +137,9 @@
|
||||
AND [UserId] = @{nameof(userId)}")
|
||||
.SetParameter(nameof(appId), appId)
|
||||
.SetParameter(nameof(userId), userId)
|
||||
.FirstOrDefault(x => x.GetValue<String>(0));
|
||||
.FirstOrDefault(x => x.GetValue<string>(0));
|
||||
|
||||
public EmployeeToken GetTokenData(String token)
|
||||
public EmployeeToken GetTokenData(string token)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [AppId]
|
||||
@@ -149,11 +149,11 @@
|
||||
.SetParameter(nameof(token), token)
|
||||
.FirstOrDefault(x => new EmployeeToken
|
||||
{
|
||||
AppId = x.GetValue<Int16>(0),
|
||||
EmployeeId = x.GetValue<Int16>(1)
|
||||
AppId = x.GetValue<short>(0),
|
||||
EmployeeId = x.GetValue<short>(1)
|
||||
});
|
||||
|
||||
public IEnumerable<String> GetUserRoles(String token)
|
||||
public IEnumerable<string> GetUserRoles(string token)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [MR].[Recht]
|
||||
@@ -162,9 +162,9 @@
|
||||
ON [MR].[MitarbeiterNr] = [MT].[UserId]
|
||||
WHERE [MT].[Token] = @{nameof(token)}")
|
||||
.SetParameter(nameof(token), token)
|
||||
.ExecuteReader(x => x.GetValue<String>(0));
|
||||
.ExecuteReader(x => x.GetValue<string>(0));
|
||||
|
||||
public Int16 Insert(Int32 employeeId, String firstName, String lastName, String phone, String email, String username, String domainname, String password)
|
||||
public short Insert(int employeeId, string firstName, string lastName, string phone, string email, string username, string domainname, string password)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT INTO [Mitarbeiter] (
|
||||
@@ -197,9 +197,9 @@
|
||||
.SetParameter(nameof(username), username)
|
||||
.SetParameter(nameof(domainname), domainname)
|
||||
.SetParameter(nameof(password), password)
|
||||
.ExecuteScalar(x => x.GetValue<Int16>(0));
|
||||
.ExecuteScalar(x => x.GetValue<short>(0));
|
||||
|
||||
public void ResetPassword(Int16 employeeId)
|
||||
public void ResetPassword(short employeeId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
UPDATE [Mitarbeiter]
|
||||
@@ -208,7 +208,7 @@
|
||||
.SetParameter(nameof(employeeId), employeeId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public void ResetTokens(Int16 employeeId)
|
||||
public void ResetTokens(short employeeId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
DELETE FROM [MitarbeiterTokens]
|
||||
@@ -216,7 +216,7 @@
|
||||
.SetParameter(nameof(employeeId), employeeId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public Boolean SetPassword(Int16 employeeId, String password)
|
||||
public bool SetPassword(short employeeId, string password)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
UPDATE [Mitarbeiter]
|
||||
@@ -226,7 +226,7 @@
|
||||
.SetParameter(nameof(password), password)
|
||||
.ExecuteNonQuery() == 1;
|
||||
|
||||
public Int16 Update(Int32 employeeId, String firstName, String lastName, String phone, String email, String username, String domainname, String password)
|
||||
public short Update(int employeeId, string firstName, string lastName, string phone, string email, string username, string domainname, string password)
|
||||
{
|
||||
var employeeNr = this.FindEmployeeNr(firstName, lastName, email, domainname);
|
||||
|
||||
@@ -262,11 +262,11 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
return default(Int16);
|
||||
return default(short);
|
||||
}
|
||||
}
|
||||
|
||||
private Int16? FindEmployeeNr(String firstName, String lastName, String email, String domainname)
|
||||
private short? FindEmployeeNr(string firstName, string lastName, string email, string domainname)
|
||||
{
|
||||
var employeeNumbers = this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
@@ -276,7 +276,7 @@
|
||||
AND [Vorname] = @{nameof(firstName)}")
|
||||
.SetParameter(nameof(lastName), lastName)
|
||||
.SetParameter(nameof(firstName), firstName)
|
||||
.ExecuteReader(x => x.GetValue<Int16>(0))
|
||||
.ExecuteReader(x => x.GetValue<short>(0))
|
||||
.ToList();
|
||||
|
||||
if (employeeNumbers.Count != 1)
|
||||
@@ -287,7 +287,7 @@
|
||||
FROM [Mitarbeiter]
|
||||
WHERE [eMail] = @{nameof(email)}")
|
||||
.SetParameter(nameof(email), email)
|
||||
.ExecuteReader(x => x.GetValue<Int16>(0))
|
||||
.ExecuteReader(x => x.GetValue<short>(0))
|
||||
.ToList();
|
||||
|
||||
if (employeeNumbers.Count != 1)
|
||||
@@ -298,7 +298,7 @@
|
||||
FROM [Mitarbeiter]
|
||||
WHERE [DomainUser] = @{nameof(domainname)}")
|
||||
.SetParameter(nameof(domainname), domainname)
|
||||
.ExecuteReader(x => x.GetValue<Int16>(0))
|
||||
.ExecuteReader(x => x.GetValue<short>(0))
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
@@ -309,7 +309,7 @@
|
||||
}
|
||||
else if (employeeNumbers.Count > 1)
|
||||
{
|
||||
return default(Int16);
|
||||
return default(short);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+48
-48
@@ -14,7 +14,7 @@
|
||||
public EquipmentsRepository(SqlConnection sqlConnection)
|
||||
=> this.sqlConnection = sqlConnection;
|
||||
|
||||
public Int32 Add(PruefmittelPruefung model)
|
||||
public int Add(PruefmittelPruefung model)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT
|
||||
@@ -65,9 +65,9 @@
|
||||
.SetParameter(nameof(model.Nachricht), model.Nachricht)
|
||||
.SetParameter(nameof(model.Meldung), model.Meldung)
|
||||
.SetParameter(nameof(model.Schedule), model.Schedule)
|
||||
.ExecuteScalar(x => x.GetValue<Int32>(0));
|
||||
.ExecuteScalar(x => x.GetValue<int>(0));
|
||||
|
||||
public PruefmittelPruefung FindById(Int32 pruefmittelId)
|
||||
public PruefmittelPruefung FindById(int pruefmittelId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [PruefmittelId]
|
||||
@@ -91,25 +91,25 @@
|
||||
.SetParameter(nameof(pruefmittelId), pruefmittelId)
|
||||
.FirstOrDefault(x => new PruefmittelPruefung
|
||||
{
|
||||
PruefmittelId = x.GetValue<Int32>(0),
|
||||
SoftwareId = x.GetValue<Int16>(1),
|
||||
Pruefmittel = x.GetValue<String>(2),
|
||||
PruefmittelNr = x.GetValue<String>(3),
|
||||
Pruefintervall = x.GetValue<Int32>(4),
|
||||
Erforderlich = x.GetValue<Boolean>(5),
|
||||
PruefmittelId = x.GetValue<int>(0),
|
||||
SoftwareId = x.GetValue<short>(1),
|
||||
Pruefmittel = x.GetValue<string>(2),
|
||||
PruefmittelNr = x.GetValue<string>(3),
|
||||
Pruefintervall = x.GetValue<int>(4),
|
||||
Erforderlich = x.GetValue<bool>(5),
|
||||
PruefdatumIst = x.GetValue<DateTime>(6),
|
||||
PruefdatumSoll = x.GetValue<DateTime>(7),
|
||||
Bemerkung = x.GetValue<String>(8),
|
||||
EmailFrom = x.GetValue<String>(9),
|
||||
EmailAn = x.GetValue<String>(10),
|
||||
InCcAn = x.GetValue<String>(11),
|
||||
Betreff = x.GetValue<String>(12),
|
||||
Nachricht = x.GetValue<String>(13),
|
||||
Meldung = x.GetValue<String>(14),
|
||||
Schedule = x.GetValue<String>(15)
|
||||
Bemerkung = x.GetValue<string>(8),
|
||||
EmailFrom = x.GetValue<string>(9),
|
||||
EmailAn = x.GetValue<string>(10),
|
||||
InCcAn = x.GetValue<string>(11),
|
||||
Betreff = x.GetValue<string>(12),
|
||||
Nachricht = x.GetValue<string>(13),
|
||||
Meldung = x.GetValue<string>(14),
|
||||
Schedule = x.GetValue<string>(15)
|
||||
});
|
||||
|
||||
public IEnumerable<PruefmittelPruefung> SelectAll(Int32 softwareId)
|
||||
public IEnumerable<PruefmittelPruefung> SelectAll(int softwareId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [PruefmittelId]
|
||||
@@ -133,25 +133,25 @@
|
||||
.SetParameter(nameof(softwareId), softwareId)
|
||||
.ExecuteReader(x => new PruefmittelPruefung
|
||||
{
|
||||
PruefmittelId = x.GetValue<Int32>(0),
|
||||
SoftwareId = x.GetValue<Int16>(1),
|
||||
Pruefmittel = x.GetValue<String>(2),
|
||||
PruefmittelNr = x.GetValue<String>(3),
|
||||
Pruefintervall = x.GetValue<Int32>(4),
|
||||
Erforderlich = x.GetValue<Boolean>(5),
|
||||
PruefmittelId = x.GetValue<int>(0),
|
||||
SoftwareId = x.GetValue<short>(1),
|
||||
Pruefmittel = x.GetValue<string>(2),
|
||||
PruefmittelNr = x.GetValue<string>(3),
|
||||
Pruefintervall = x.GetValue<int>(4),
|
||||
Erforderlich = x.GetValue<bool>(5),
|
||||
PruefdatumIst = x.GetValue<DateTime>(6),
|
||||
PruefdatumSoll = x.GetValue<DateTime>(7),
|
||||
Bemerkung = x.GetValue<String>(8),
|
||||
EmailFrom = x.GetValue<String>(9),
|
||||
EmailAn = x.GetValue<String>(10),
|
||||
InCcAn = x.GetValue<String>(11),
|
||||
Betreff = x.GetValue<String>(12),
|
||||
Nachricht = x.GetValue<String>(13),
|
||||
Meldung = x.GetValue<String>(14),
|
||||
Schedule = x.GetValue<String>(15)
|
||||
Bemerkung = x.GetValue<string>(8),
|
||||
EmailFrom = x.GetValue<string>(9),
|
||||
EmailAn = x.GetValue<string>(10),
|
||||
InCcAn = x.GetValue<string>(11),
|
||||
Betreff = x.GetValue<string>(12),
|
||||
Nachricht = x.GetValue<string>(13),
|
||||
Meldung = x.GetValue<string>(14),
|
||||
Schedule = x.GetValue<string>(15)
|
||||
});
|
||||
|
||||
public Int32 Remove(Int32 pruefmittelId)
|
||||
public int Remove(int pruefmittelId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
DELETE
|
||||
@@ -182,25 +182,25 @@
|
||||
FROM [PruefmittelPruefung]")
|
||||
.ExecuteReader(x => new PruefmittelPruefung
|
||||
{
|
||||
PruefmittelId = x.GetValue<Int32>(0),
|
||||
SoftwareId = x.GetValue<Int16>(1),
|
||||
Pruefmittel = x.GetValue<String>(2),
|
||||
PruefmittelNr = x.GetValue<String>(3),
|
||||
Pruefintervall = x.GetValue<Int32>(4),
|
||||
Erforderlich = x.GetValue<Boolean>(5),
|
||||
PruefmittelId = x.GetValue<int>(0),
|
||||
SoftwareId = x.GetValue<short>(1),
|
||||
Pruefmittel = x.GetValue<string>(2),
|
||||
PruefmittelNr = x.GetValue<string>(3),
|
||||
Pruefintervall = x.GetValue<int>(4),
|
||||
Erforderlich = x.GetValue<bool>(5),
|
||||
PruefdatumIst = x.GetValue<DateTime>(6),
|
||||
PruefdatumSoll = x.GetValue<DateTime>(7),
|
||||
Bemerkung = x.GetValue<String>(8),
|
||||
EmailFrom = x.GetValue<String>(9),
|
||||
EmailAn = x.GetValue<String>(10),
|
||||
InCcAn = x.GetValue<String>(11),
|
||||
Betreff = x.GetValue<String>(12),
|
||||
Nachricht = x.GetValue<String>(13),
|
||||
Meldung = x.GetValue<String>(14),
|
||||
Schedule = x.GetValue<String>(15)
|
||||
Bemerkung = x.GetValue<string>(8),
|
||||
EmailFrom = x.GetValue<string>(9),
|
||||
EmailAn = x.GetValue<string>(10),
|
||||
InCcAn = x.GetValue<string>(11),
|
||||
Betreff = x.GetValue<string>(12),
|
||||
Nachricht = x.GetValue<string>(13),
|
||||
Meldung = x.GetValue<string>(14),
|
||||
Schedule = x.GetValue<string>(15)
|
||||
});
|
||||
|
||||
public Int32 Update(PruefmittelPruefung model)
|
||||
public int Update(PruefmittelPruefung model)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
UPDATE [PruefmittelPruefung]
|
||||
|
||||
+22
-22
@@ -14,15 +14,15 @@
|
||||
public FunctionsRepository(SqlConnection sqlConnection)
|
||||
=> this.sqlConnection = sqlConnection;
|
||||
|
||||
public void AddEmployeesFunctions(Int32 functionId, IEnumerable<Int16> employees)
|
||||
public void AddEmployeesFunctions(int functionId, IEnumerable<short> employees)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT INTO [UsersFunctions] ([UserId], [SoftwareFunctionId])
|
||||
VALUES {String.Join(", ", employees.Select((x, i) => $"({new System.Data.SqlClient.SqlParameter($"p{i}", x).SqlValue}, @{nameof(functionId)})"))}")
|
||||
VALUES {string.Join(", ", employees.Select((x, i) => $"({new System.Data.SqlClient.SqlParameter($"p{i}", x).SqlValue}, @{nameof(functionId)})"))}")
|
||||
.SetParameter(nameof(functionId), functionId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public Int32 AddFunction(Int16 softwareId, String function)
|
||||
public int AddFunction(short softwareId, string function)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT INTO [SoftwareFunctions] ([AppId], [Function])
|
||||
@@ -30,25 +30,25 @@
|
||||
VALUES (@{nameof(softwareId)}, @{nameof(function)})")
|
||||
.SetParameter(nameof(softwareId), softwareId)
|
||||
.SetParameter(nameof(function), function)
|
||||
.ExecuteScalar(x => x.GetValue<Int32>(0));
|
||||
.ExecuteScalar(x => x.GetValue<int>(0));
|
||||
|
||||
public IEnumerable<String> All()
|
||||
public IEnumerable<string> All()
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT DISTINCT [SF].[Function]
|
||||
FROM [SoftwareFunctions] AS [SF]")
|
||||
.ExecuteReader(x => x.GetValue<String>(0));
|
||||
.ExecuteReader(x => x.GetValue<string>(0));
|
||||
|
||||
public IEnumerable<String> All(Int16 appId)
|
||||
public IEnumerable<string> All(short appId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [SF].[Function]
|
||||
FROM [SoftwareFunctions] AS [SF]
|
||||
WHERE [SF].[AppId] = @{nameof(appId)}")
|
||||
.SetParameter(nameof(appId), appId)
|
||||
.ExecuteReader(x => x.GetValue<String>(0));
|
||||
.ExecuteReader(x => x.GetValue<string>(0));
|
||||
|
||||
public void Delete(Int16 employeeId)
|
||||
public void Delete(short employeeId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
DELETE FROM [UsersFunctions]
|
||||
@@ -56,7 +56,7 @@
|
||||
.SetParameter(nameof(employeeId), employeeId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public void DeleteEmployeesFunctions(Int32 functionId)
|
||||
public void DeleteEmployeesFunctions(int functionId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
DELETE
|
||||
@@ -65,7 +65,7 @@
|
||||
.SetParameter(nameof(functionId), functionId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public void DeleteFunction(Int32 functionId)
|
||||
public void DeleteFunction(int functionId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
DELETE
|
||||
@@ -74,7 +74,7 @@
|
||||
.SetParameter(nameof(functionId), functionId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public IEnumerable<String> EmployeeAll(Int16 employeeId)
|
||||
public IEnumerable<string> EmployeeAll(short employeeId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [SF].[Function]
|
||||
@@ -83,9 +83,9 @@
|
||||
ON [SF].[Id] = [UF].[SoftwareFunctionId]
|
||||
WHERE [UF].[UserId] = @{nameof(employeeId)}")
|
||||
.SetParameter(nameof(employeeId), employeeId)
|
||||
.ExecuteReader(x => x.GetValue<String>(0));
|
||||
.ExecuteReader(x => x.GetValue<string>(0));
|
||||
|
||||
public Boolean Exists(Int32 softwareId, Int32 functionId)
|
||||
public bool Exists(int softwareId, int functionId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT COUNT(1)
|
||||
@@ -94,9 +94,9 @@
|
||||
AND [Id] = @{nameof(functionId)}")
|
||||
.SetParameter(nameof(softwareId), softwareId)
|
||||
.SetParameter(nameof(functionId), functionId)
|
||||
.FirstOrDefault(x => x.GetValue<Int32>(0) > 0);
|
||||
.FirstOrDefault(x => x.GetValue<int>(0) > 0);
|
||||
|
||||
public IEnumerable<String> Find(String token)
|
||||
public IEnumerable<string> Find(string token)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [SF].[Function]
|
||||
@@ -108,9 +108,9 @@
|
||||
AND [MT].[AppId] = [SF].[AppId]
|
||||
AND [MT].[Token] = @{nameof(token)}")
|
||||
.SetParameter(nameof(token), token)
|
||||
.ExecuteReader(x => x.GetValue<String>(0));
|
||||
.ExecuteReader(x => x.GetValue<string>(0));
|
||||
|
||||
public void Insert(Int16 employeeId, IEnumerable<String> functions)
|
||||
public void Insert(short employeeId, IEnumerable<string> functions)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT INTO [UsersFunctions] (
|
||||
@@ -119,11 +119,11 @@
|
||||
SELECT @{nameof(employeeId)}
|
||||
, [Id]
|
||||
FROM [SoftwareFunctions]
|
||||
WHERE [Function] IN ({String.Join(", ", functions.Select(x => $"'{x}'"))})")
|
||||
WHERE [Function] IN ({string.Join(", ", functions.Select(x => $"'{x}'"))})")
|
||||
.SetParameter(nameof(employeeId), employeeId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public void UpdateFunction(Int32 functionId, String function)
|
||||
public void UpdateFunction(int functionId, string function)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
UPDATE [SoftwareFunctions]
|
||||
@@ -133,7 +133,7 @@
|
||||
.SetParameter(nameof(function), function)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public IEnumerable<KeyValuePair<Int16, Int32>> UserFunctionsCount()
|
||||
public IEnumerable<KeyValuePair<short, int>> UserFunctionsCount()
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT DISTINCT
|
||||
@@ -143,6 +143,6 @@
|
||||
JOIN [SoftwareFunctions] AS [SF]
|
||||
ON [SF].[Id] = [UF].[SoftwareFunctionId]
|
||||
GROUP BY [UF].[UserId]")
|
||||
.ExecuteReader(x => new KeyValuePair<Int16, Int32>(x.GetValue<Int16>(0), x.GetValue<Int32>(1)));
|
||||
.ExecuteReader(x => new KeyValuePair<short, int>(x.GetValue<short>(0), x.GetValue<int>(1)));
|
||||
}
|
||||
}
|
||||
|
||||
+13
-13
@@ -9,30 +9,30 @@
|
||||
{
|
||||
IEnumerable<Employee> All();
|
||||
|
||||
void CreateToken(Int16 appId, Int16 userId);
|
||||
void CreateToken(short appId, short userId);
|
||||
|
||||
Int16 FindEmployeeNr(Int32 employeeId);
|
||||
short FindEmployeeNr(int employeeId);
|
||||
|
||||
Int16 FindEmployeeNr(String username, String password);
|
||||
short FindEmployeeNr(string username, string password);
|
||||
|
||||
Employee Find(Int16 employeeId);
|
||||
Employee Find(short employeeId);
|
||||
|
||||
Employee GetEmployee(String token);
|
||||
Employee GetEmployee(string token);
|
||||
|
||||
String GetToken(Int16 appId, Int16 userId);
|
||||
string GetToken(short appId, short userId);
|
||||
|
||||
EmployeeToken GetTokenData(String token);
|
||||
EmployeeToken GetTokenData(string token);
|
||||
|
||||
IEnumerable<String> GetUserRoles(String token);
|
||||
IEnumerable<string> GetUserRoles(string token);
|
||||
|
||||
Int16 Insert(Int32 employeeId, String firstName, String lastName, String phone, String email, String username, String domainname, String password);
|
||||
short Insert(int employeeId, string firstName, string lastName, string phone, string email, string username, string domainname, string password);
|
||||
|
||||
void ResetPassword(Int16 employeeId);
|
||||
void ResetPassword(short employeeId);
|
||||
|
||||
void ResetTokens(Int16 employeeId);
|
||||
void ResetTokens(short employeeId);
|
||||
|
||||
Boolean SetPassword(Int16 employeeId, String password);
|
||||
bool SetPassword(short employeeId, string password);
|
||||
|
||||
Int16 Update(Int32 employeeId, String firstName, String lastName, String phone, String email, String username, String domainname, String password);
|
||||
short Update(int employeeId, string firstName, string lastName, string phone, string email, string username, string domainname, string password);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -7,16 +7,16 @@
|
||||
|
||||
public interface IEquipmentsRepository
|
||||
{
|
||||
Int32 Add(PruefmittelPruefung model);
|
||||
int Add(PruefmittelPruefung model);
|
||||
|
||||
PruefmittelPruefung FindById(Int32 pruefmittelId);
|
||||
PruefmittelPruefung FindById(int pruefmittelId);
|
||||
|
||||
Int32 Remove(Int32 pruefmittelId);
|
||||
int Remove(int pruefmittelId);
|
||||
|
||||
IEnumerable<PruefmittelPruefung> SelectAll();
|
||||
|
||||
IEnumerable<PruefmittelPruefung> SelectAll(Int32 softwareId);
|
||||
IEnumerable<PruefmittelPruefung> SelectAll(int softwareId);
|
||||
|
||||
Int32 Update(PruefmittelPruefung model);
|
||||
int Update(PruefmittelPruefung model);
|
||||
}
|
||||
}
|
||||
|
||||
+13
-13
@@ -5,30 +5,30 @@
|
||||
|
||||
public interface IFunctionsRepository
|
||||
{
|
||||
void AddEmployeesFunctions(Int32 functionId, IEnumerable<Int16> employees);
|
||||
void AddEmployeesFunctions(int functionId, IEnumerable<short> employees);
|
||||
|
||||
Int32 AddFunction(Int16 softwareId, String function);
|
||||
int AddFunction(short softwareId, string function);
|
||||
|
||||
IEnumerable<String> All();
|
||||
IEnumerable<string> All();
|
||||
|
||||
IEnumerable<String> All(Int16 appId);
|
||||
IEnumerable<string> All(short appId);
|
||||
|
||||
void Delete(Int16 employeeId);
|
||||
void Delete(short employeeId);
|
||||
|
||||
void DeleteEmployeesFunctions(Int32 functionId);
|
||||
void DeleteEmployeesFunctions(int functionId);
|
||||
|
||||
void DeleteFunction(Int32 functionId);
|
||||
void DeleteFunction(int functionId);
|
||||
|
||||
IEnumerable<String> EmployeeAll(Int16 employeeId);
|
||||
IEnumerable<string> EmployeeAll(short employeeId);
|
||||
|
||||
Boolean Exists(Int32 softwareId, Int32 functionId);
|
||||
bool Exists(int softwareId, int functionId);
|
||||
|
||||
IEnumerable<String> Find(String token);
|
||||
IEnumerable<string> Find(string token);
|
||||
|
||||
void Insert(Int16 employeeId, IEnumerable<String> functions);
|
||||
void Insert(short employeeId, IEnumerable<string> functions);
|
||||
|
||||
void UpdateFunction(Int32 functionId, String function);
|
||||
void UpdateFunction(int functionId, string function);
|
||||
|
||||
IEnumerable<KeyValuePair<Int16, Int32>> UserFunctionsCount();
|
||||
IEnumerable<KeyValuePair<short, int>> UserFunctionsCount();
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -9,16 +9,16 @@
|
||||
{
|
||||
IEnumerable<Role> All();
|
||||
|
||||
IEnumerable<String> All(Int16 employeeId);
|
||||
IEnumerable<string> All(short employeeId);
|
||||
|
||||
void Delete(Int16 employeeId);
|
||||
void Delete(short employeeId);
|
||||
|
||||
void Insert(Int16 employeeId, IEnumerable<String> roles);
|
||||
void Insert(short employeeId, IEnumerable<string> roles);
|
||||
|
||||
void Insert(String role, IEnumerable<Int16> employees);
|
||||
void Insert(string role, IEnumerable<short> employees);
|
||||
|
||||
void Delete(String role);
|
||||
void Delete(string role);
|
||||
|
||||
IEnumerable<KeyValuePair<Int32, Int32>> UsersRolesCount();
|
||||
IEnumerable<KeyValuePair<int, int>> UsersRolesCount();
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -7,26 +7,26 @@
|
||||
|
||||
public interface ISoftwareRepository
|
||||
{
|
||||
void AddVersion(Int16 softwareId, String assemblyName, Int32 majorV, Int32 minorV, Int32 buildV, DateTime validUntil, String description);
|
||||
void AddVersion(short softwareId, string assemblyName, int majorV, int minorV, int buildV, DateTime validUntil, string description);
|
||||
|
||||
Int16 AppId(String software);
|
||||
short AppId(string software);
|
||||
|
||||
void Delete(Int32 versionId);
|
||||
void Delete(int versionId);
|
||||
|
||||
SoftwareDetails Details(Int32 versionId);
|
||||
SoftwareDetails Details(int versionId);
|
||||
|
||||
void EditVersion(Int32 versionId, DateTime? validUntil, String description);
|
||||
void EditVersion(int versionId, DateTime? validUntil, string description);
|
||||
|
||||
IEnumerable<SoftwareFunction> Functions(Int16 softwareId);
|
||||
IEnumerable<SoftwareFunction> Functions(short softwareId);
|
||||
|
||||
IEnumerable<String> GetSoftwareFunctions(String token);
|
||||
IEnumerable<string> GetSoftwareFunctions(string token);
|
||||
|
||||
Int16 Insert(String assembly, Int32 major, Int32 minor, Int32 build);
|
||||
short Insert(string assembly, int major, int minor, int build);
|
||||
|
||||
IEnumerable<SoftwareItem> List();
|
||||
|
||||
Int16 SoftwareId(String assembly);
|
||||
short SoftwareId(string assembly);
|
||||
|
||||
IEnumerable<SoftwareVersion> Versions(Int16 softwareId);
|
||||
IEnumerable<SoftwareVersion> Versions(short softwareId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,20 +23,20 @@
|
||||
FROM [MitarbeiterRechte]")
|
||||
.ExecuteReader(x => new Role
|
||||
{
|
||||
Name = x.GetValue<String>(0),
|
||||
EmployeeId = (Int16)x.GetValue<Int32>(1)
|
||||
Name = x.GetValue<string>(0),
|
||||
EmployeeId = (short)x.GetValue<int>(1)
|
||||
});
|
||||
|
||||
public IEnumerable<String> All(Int16 employeeId)
|
||||
public IEnumerable<string> All(short employeeId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT DISTINCT [Recht]
|
||||
FROM [MitarbeiterRechte]
|
||||
WHERE [MitarbeiterNr] = @{nameof(employeeId)}")
|
||||
.SetParameter(nameof(employeeId), employeeId)
|
||||
.ExecuteReader(x => x.GetValue<String>(0));
|
||||
.ExecuteReader(x => x.GetValue<string>(0));
|
||||
|
||||
public void Delete(Int16 employeeId)
|
||||
public void Delete(short employeeId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
DELETE FROM [MitarbeiterRechte]
|
||||
@@ -44,23 +44,23 @@
|
||||
.SetParameter(nameof(employeeId), employeeId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public void Insert(Int16 employeeId, IEnumerable<String> roles)
|
||||
public void Insert(short employeeId, IEnumerable<string> roles)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT INTO [MitarbeiterRechte] ([MitarbeiterNr], [Recht])
|
||||
VALUES {String.Join(", ", roles.Select((x, i) => $"(@{nameof(employeeId)}, '{new System.Data.SqlClient.SqlParameter(i.ToString(), x).SqlValue}')"))}")
|
||||
VALUES {string.Join(", ", roles.Select((x, i) => $"(@{nameof(employeeId)}, '{new System.Data.SqlClient.SqlParameter(i.ToString(), x).SqlValue}')"))}")
|
||||
.SetParameter(nameof(employeeId), employeeId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public void Insert(String role, IEnumerable<Int16> employees)
|
||||
public void Insert(string role, IEnumerable<short> employees)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT INTO [MitarbeiterRechte] ([MitarbeiterNr], [Recht])
|
||||
VALUES {String.Join(", ", employees.Select((x, i) => $"('{new System.Data.SqlClient.SqlParameter(i.ToString(), x).SqlValue}', @{nameof(role)})"))}")
|
||||
VALUES {string.Join(", ", employees.Select((x, i) => $"('{new System.Data.SqlClient.SqlParameter(i.ToString(), x).SqlValue}', @{nameof(role)})"))}")
|
||||
.SetParameter(nameof(role), role)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public void Delete(String role)
|
||||
public void Delete(string role)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
DELETE FROM [MitarbeiterRechte]
|
||||
@@ -68,7 +68,7 @@
|
||||
.SetParameter(nameof(role), role)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public IEnumerable<KeyValuePair<Int32, Int32>> UsersRolesCount()
|
||||
public IEnumerable<KeyValuePair<int, int>> UsersRolesCount()
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT DISTINCT
|
||||
@@ -76,6 +76,6 @@
|
||||
, COUNT([Recht])
|
||||
FROM [MitarbeiterRechte]
|
||||
GROUP BY [MitarbeiterNr]")
|
||||
.ExecuteReader(x => new KeyValuePair<Int32, Int32>(x.GetValue<Int32>(0), x.GetValue<Int32>(1)));
|
||||
.ExecuteReader(x => new KeyValuePair<int, int>(x.GetValue<int>(0), x.GetValue<int>(1)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public SoftwareRepository(SqlConnection sqlConnection)
|
||||
=> this.sqlConnection = sqlConnection;
|
||||
|
||||
public void AddVersion(Int16 softwareId, String assemblyName, Int32 majorV, Int32 minorV, Int32 buildV, DateTime validUntil, String description)
|
||||
public void AddVersion(short softwareId, string assemblyName, int majorV, int minorV, int buildV, DateTime validUntil, string description)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT INTO [VersionSoftwareAccess] (
|
||||
@@ -41,16 +41,16 @@
|
||||
.SetParameter(nameof(description), description)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public Int16 AppId(String software)
|
||||
public short AppId(string software)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [AppID]
|
||||
FROM [VersionSoftwareAccess]
|
||||
WHERE [SoftwareAccess_Program] = @{nameof(software)}")
|
||||
.SetParameter(nameof(software), software)
|
||||
.FirstOrDefault(x => x.GetValue<Int16>(0));
|
||||
.FirstOrDefault(x => x.GetValue<short>(0));
|
||||
|
||||
public void Delete(Int32 versionId)
|
||||
public void Delete(int versionId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
DELETE FROM [VersionSoftwareAccess]
|
||||
@@ -58,7 +58,7 @@
|
||||
.SetParameter(nameof(versionId), versionId)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public SoftwareDetails Details(Int32 versionId)
|
||||
public SoftwareDetails Details(int versionId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [AppID]
|
||||
@@ -74,15 +74,15 @@
|
||||
.SetParameter(nameof(versionId), versionId)
|
||||
.FirstOrDefault(x => new SoftwareDetails
|
||||
{
|
||||
SoftwareId = x.GetValue<Int16>(0),
|
||||
AssemblyName = x.GetValue<String>(1),
|
||||
VersionNr = $"{x.GetValue<Int32>(2)}.{x.GetValue<Int32>(3)}.{x.GetValue<Int32>(4)}",
|
||||
VersionId = x.GetValue<Int32>(5),
|
||||
SoftwareId = x.GetValue<short>(0),
|
||||
AssemblyName = x.GetValue<string>(1),
|
||||
VersionNr = $"{x.GetValue<int>(2)}.{x.GetValue<int>(3)}.{x.GetValue<int>(4)}",
|
||||
VersionId = x.GetValue<int>(5),
|
||||
ValidUntil = $"{x.GetValue<DateTime>(6):yyyy-MM-dd}",
|
||||
Description = x.GetValue<String>(7),
|
||||
Description = x.GetValue<string>(7),
|
||||
});
|
||||
|
||||
public void EditVersion(Int32 versionId, DateTime? validUntil, String description)
|
||||
public void EditVersion(int versionId, DateTime? validUntil, string description)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
UPDATE [VersionSoftwareAccess]
|
||||
@@ -94,7 +94,7 @@
|
||||
.SetParameter(nameof(description), description)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public IEnumerable<SoftwareFunction> Functions(Int16 softwareId)
|
||||
public IEnumerable<SoftwareFunction> Functions(short softwareId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [AppId]
|
||||
@@ -105,12 +105,12 @@
|
||||
.SetParameter(nameof(softwareId), softwareId)
|
||||
.ExecuteReader(x => new SoftwareFunction
|
||||
{
|
||||
SoftwareId = x.GetValue<Int16>(0),
|
||||
FunctionId = x.GetValue<Int32>(1),
|
||||
Function = x.GetValue<String>(2)
|
||||
SoftwareId = x.GetValue<short>(0),
|
||||
FunctionId = x.GetValue<int>(1),
|
||||
Function = x.GetValue<string>(2)
|
||||
});
|
||||
|
||||
public IEnumerable<String> GetSoftwareFunctions(String token)
|
||||
public IEnumerable<string> GetSoftwareFunctions(string token)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [SF].[Function]
|
||||
@@ -119,9 +119,9 @@
|
||||
ON [SF].[AppId] = [MT].[AppId]
|
||||
WHERE [MT].[Token] = @{nameof(token)}")
|
||||
.SetParameter(nameof(token), token)
|
||||
.ExecuteReader(x => x.GetValue<String>(0));
|
||||
.ExecuteReader(x => x.GetValue<string>(0));
|
||||
|
||||
public Int16 Insert(String assembly, Int32 major, Int32 minor, Int32 build)
|
||||
public short Insert(string assembly, int major, int minor, int build)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT INTO [VersionSoftwareAccess] (
|
||||
@@ -144,7 +144,7 @@
|
||||
.SetParameter(nameof(major), major)
|
||||
.SetParameter(nameof(minor), minor)
|
||||
.SetParameter(nameof(build), build)
|
||||
.ExecuteScalar(x => x.GetValue<Int16>(0));
|
||||
.ExecuteScalar(x => x.GetValue<short>(0));
|
||||
|
||||
public IEnumerable<SoftwareItem> List()
|
||||
=> this.sqlConnection
|
||||
@@ -174,24 +174,24 @@
|
||||
ORDER BY [Software].[AssemblyName]")
|
||||
.ExecuteReader(x => new SoftwareItem
|
||||
{
|
||||
SoftwareId = x.GetValue<Int16>(0),
|
||||
AssemblyName = x.GetValue<String>(1),
|
||||
CurrentVersion = $"{x.GetValue<Int32>(2)}.{x.GetValue<Int32>(3)}.{x.GetValue<Int32>(4)}",
|
||||
VersionId = x.GetValue<Int32>(5),
|
||||
SoftwareId = x.GetValue<short>(0),
|
||||
AssemblyName = x.GetValue<string>(1),
|
||||
CurrentVersion = $"{x.GetValue<int>(2)}.{x.GetValue<int>(3)}.{x.GetValue<int>(4)}",
|
||||
VersionId = x.GetValue<int>(5),
|
||||
ValidUntil = $"{x.GetValue<DateTime>(6):yyyy-MM-dd}",
|
||||
Description = x.GetValue<String>(7),
|
||||
Description = x.GetValue<string>(7),
|
||||
});
|
||||
|
||||
public Int16 SoftwareId(String assembly)
|
||||
public short SoftwareId(string assembly)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [AppId]
|
||||
FROM [VersionSoftwareAccess]
|
||||
WHERE [SoftwareAccess_Program] = @{nameof(assembly)}")
|
||||
.SetParameter(nameof(assembly), assembly)
|
||||
.FirstOrDefault(x => x.GetValue<Int16>(0));
|
||||
.FirstOrDefault(x => x.GetValue<short>(0));
|
||||
|
||||
public IEnumerable<SoftwareVersion> Versions(Int16 softwareId)
|
||||
public IEnumerable<SoftwareVersion> Versions(short softwareId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [AppId]
|
||||
@@ -207,12 +207,12 @@
|
||||
.SetParameter(nameof(softwareId), softwareId)
|
||||
.ExecuteReader(x => new SoftwareVersion
|
||||
{
|
||||
SoftwareId = x.GetValue<Int16>(0),
|
||||
AssemblyName = x.GetValue<String>(1),
|
||||
VersionId = x.GetValue<Int32>(2),
|
||||
VersionNr = $"{x.GetValue<Int32>(3)}.{x.GetValue<Int32>(4)}.{x.GetValue<Int32>(5)}",
|
||||
SoftwareId = x.GetValue<short>(0),
|
||||
AssemblyName = x.GetValue<string>(1),
|
||||
VersionId = x.GetValue<int>(2),
|
||||
VersionNr = $"{x.GetValue<int>(3)}.{x.GetValue<int>(4)}.{x.GetValue<int>(5)}",
|
||||
ValidUntil = $"{x.GetValue<DateTime>(6):yyyy-MM-dd}",
|
||||
Description = x.GetValue<String>(7),
|
||||
Description = x.GetValue<string>(7),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,28 +18,28 @@
|
||||
this.softwareRepository = softwareRepository;
|
||||
}
|
||||
|
||||
public void AddVersion(Int16 softwareId, String assemblyName, Int32 majorV, Int32 minorV, Int32 buildV, DateTime validUntil, String description)
|
||||
public void AddVersion(short softwareId, string assemblyName, int majorV, int minorV, int buildV, DateTime validUntil, string description)
|
||||
=> this.softwareRepository.AddVersion(softwareId, assemblyName, majorV, minorV, buildV, validUntil, description);
|
||||
|
||||
public void DeleteVersion(Int32 versionId)
|
||||
public void DeleteVersion(int versionId)
|
||||
=> this.softwareRepository.Delete(versionId);
|
||||
|
||||
public void EditVersion(Int32 versionId, DateTime? validUntil, String description)
|
||||
public void EditVersion(int versionId, DateTime? validUntil, string description)
|
||||
=> this.softwareRepository.EditVersion(versionId, validUntil, description);
|
||||
|
||||
public IEnumerable<String> GetFunctions()
|
||||
public IEnumerable<string> GetFunctions()
|
||||
=> this.functionsRepository.All()
|
||||
?? Array.Empty<String>();
|
||||
?? Array.Empty<string>();
|
||||
|
||||
public IEnumerable<String> GetFunctions(String token)
|
||||
public IEnumerable<string> GetFunctions(string token)
|
||||
=> this.functionsRepository.Find(token)
|
||||
?? Array.Empty<String>();
|
||||
?? Array.Empty<string>();
|
||||
|
||||
public IEnumerable<Object> ListSoftwares()
|
||||
public IEnumerable<object> ListSoftwares()
|
||||
=> this.softwareRepository.List()
|
||||
?? Array.Empty<SoftwareItem>();
|
||||
|
||||
public Object SoftwareDeteils(Int32 versionId)
|
||||
public object SoftwareDeteils(int versionId)
|
||||
{
|
||||
var softwareDetails = this.softwareRepository.Details(versionId);
|
||||
|
||||
@@ -52,13 +52,13 @@
|
||||
return softwareDetails;
|
||||
}
|
||||
|
||||
public void UpdateFunction(Int16 softwareId, Int32 functionId, String function, IEnumerable<Int16> employees)
|
||||
public void UpdateFunction(short softwareId, int functionId, string function, IEnumerable<short> employees)
|
||||
{
|
||||
if (this.functionsRepository.Exists(softwareId, functionId))
|
||||
{
|
||||
this.functionsRepository.DeleteEmployeesFunctions(functionId);
|
||||
|
||||
if (String.IsNullOrWhiteSpace(function))
|
||||
if (string.IsNullOrWhiteSpace(function))
|
||||
{
|
||||
this.functionsRepository.DeleteFunction(functionId);
|
||||
}
|
||||
@@ -70,7 +70,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(function))
|
||||
if (!string.IsNullOrWhiteSpace(function))
|
||||
{
|
||||
functionId = this.functionsRepository.AddFunction(softwareId, function);
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
public interface IWildcardRepository
|
||||
{
|
||||
IEnumerable<String> Fields();
|
||||
IEnumerable<string> Fields();
|
||||
|
||||
IEnumerable<WildcardResult> Find(String token, IEnumerable<String> fields);
|
||||
IEnumerable<WildcardResult> Find(string token, IEnumerable<string> fields);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
public WildcardRepository(SqlConnection sqlConnection)
|
||||
=> this.sqlConnection = sqlConnection;
|
||||
|
||||
public IEnumerable<String> Fields()
|
||||
=> new String[]
|
||||
public IEnumerable<string> Fields()
|
||||
=> new string[]
|
||||
{
|
||||
"CustomerNo",
|
||||
"Customer",
|
||||
@@ -36,7 +36,7 @@
|
||||
"GmRadioAddress",
|
||||
};
|
||||
|
||||
public IEnumerable<WildcardResult> Find(String token, IEnumerable<String> fields)
|
||||
public IEnumerable<WildcardResult> Find(string token, IEnumerable<string> fields)
|
||||
=> sqlConnection
|
||||
.CreateCommand($@"
|
||||
DECLARE @serienNr TABLE([Nr] VARCHAR(50));
|
||||
@@ -114,7 +114,7 @@
|
||||
|
||||
foreach (var field in fields)
|
||||
{
|
||||
wildcardResult[field] = reader.GetValue<String>(field);
|
||||
wildcardResult[field] = reader.GetValue<string>(field);
|
||||
}
|
||||
|
||||
return wildcardResult;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
public interface ISearchManager
|
||||
{
|
||||
IEnumerable<String> WildcardFields();
|
||||
IEnumerable<string> WildcardFields();
|
||||
|
||||
IEnumerable<IDictionary<String, Object>> SearchWildcard(String token, IEnumerable<String> selectedFields);
|
||||
IEnumerable<IDictionary<string, object>> SearchWildcard(string token, IEnumerable<string> selectedFields);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,27 +7,27 @@
|
||||
|
||||
public class WildcardInputModel
|
||||
{
|
||||
private String token;
|
||||
private IEnumerable<String> fields = Array.Empty<String>();
|
||||
private string token;
|
||||
private IEnumerable<string> fields = Array.Empty<string>();
|
||||
|
||||
[Required]
|
||||
[StringLength(50, MinimumLength = 1)]
|
||||
[RegularExpression("^[0-9 a-z-A-Z]+$")]
|
||||
public String Token
|
||||
public string Token
|
||||
{
|
||||
get => this.token;
|
||||
set => this.token = value?.Replace(" ", "")?.Trim();
|
||||
}
|
||||
|
||||
public String Fields
|
||||
public string Fields
|
||||
{
|
||||
get => String.Join(",", this.FieldsArray);
|
||||
get => string.Join(",", this.FieldsArray);
|
||||
set => this.FieldsArray = $"{value}".Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
|
||||
internal IEnumerable<String> FieldsArray { get; set; }
|
||||
internal IEnumerable<string> FieldsArray { get; set; }
|
||||
|
||||
internal IEnumerable<String> GetRequiredFields(IEnumerable<String> allFields)
|
||||
internal IEnumerable<string> GetRequiredFields(IEnumerable<string> allFields)
|
||||
{
|
||||
if (this.fields.Any())
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class WildcardResult : Dictionary<String, Object>
|
||||
public class WildcardResult : Dictionary<string, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
public SearchManager(IWildcardRepository wildcardRepository)
|
||||
=> this.wildcardRepository = wildcardRepository;
|
||||
|
||||
public IEnumerable<IDictionary<String, Object>> SearchWildcard(String token, IEnumerable<String> selectedFields)
|
||||
public IEnumerable<IDictionary<string, object>> SearchWildcard(string token, IEnumerable<string> selectedFields)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(token))
|
||||
if (string.IsNullOrWhiteSpace(token))
|
||||
{
|
||||
return Array.Empty<IDictionary<String, Object>>();
|
||||
return Array.Empty<IDictionary<string, object>>();
|
||||
}
|
||||
|
||||
token = token.Replace(" ", String.Empty).Trim();
|
||||
selectedFields = selectedFields ?? Array.Empty<String>();
|
||||
token = token.Replace(" ", string.Empty).Trim();
|
||||
selectedFields = selectedFields ?? Array.Empty<string>();
|
||||
|
||||
if (selectedFields.Any())
|
||||
{
|
||||
@@ -35,7 +35,7 @@
|
||||
return this.wildcardRepository.Find(token, selectedFields);
|
||||
}
|
||||
|
||||
public IEnumerable<String> WildcardFields()
|
||||
public IEnumerable<string> WildcardFields()
|
||||
=> this.wildcardRepository.Fields();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
public AccountService(SqlConnection sqlConnection)
|
||||
=> this.sqlConnection = sqlConnection;
|
||||
|
||||
public Employee FindEmployee(Int16 userId)
|
||||
public Employee FindEmployee(short userId)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [Vorname] + ' ' + [Name]
|
||||
@@ -25,17 +25,17 @@
|
||||
.SetParameter(nameof(userId), userId)
|
||||
.FirstOrDefault(x => new Employee
|
||||
{
|
||||
Name = x.GetValue<String>(0).Trim(),
|
||||
Name = x.GetValue<string>(0).Trim(),
|
||||
Permissions = this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT DISTINCT [Recht]
|
||||
FROM [MitarbeiterRechte]
|
||||
WHERE [MitarbeiterNr] = @{nameof(userId)}")
|
||||
.SetParameter(nameof(userId), userId)
|
||||
.ExecuteReader(p => p.GetValue<String>(0))
|
||||
.ExecuteReader(p => p.GetValue<string>(0))
|
||||
});
|
||||
|
||||
public IEnumerable<String> FindUserFunctions(Int16 appId, String username, String password)
|
||||
public IEnumerable<string> FindUserFunctions(short appId, string username, string password)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT [SF].[Function]
|
||||
@@ -50,9 +50,9 @@
|
||||
.SetParameter(nameof(username), username)
|
||||
.SetParameter(nameof(password), password)
|
||||
.SetParameter(nameof(appId), appId)
|
||||
.ExecuteReader(x => x.GetValue<String>(0));
|
||||
.ExecuteReader(x => x.GetValue<string>(0));
|
||||
|
||||
public Int16 Login(String username, String password)
|
||||
public short Login(string username, string password)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
SELECT TOP 1 [MitarbeiterNr]
|
||||
@@ -61,9 +61,9 @@
|
||||
AND [PasswordHash] LIKE @{nameof(password)}")
|
||||
.SetParameter(nameof(username), username)
|
||||
.SetParameter(nameof(password), password)
|
||||
.FirstOrDefault(reader => reader.GetValue<Int16>(0));
|
||||
.FirstOrDefault(reader => reader.GetValue<short>(0));
|
||||
|
||||
public Int32 ResetPassword(String username)
|
||||
public int ResetPassword(string username)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
UPDATE [Mitarbeiter]
|
||||
@@ -72,7 +72,7 @@
|
||||
.SetParameter(nameof(username), username)
|
||||
.ExecuteNonQuery();
|
||||
|
||||
public Int32 ResetPassword(String username, String password)
|
||||
public int ResetPassword(string username, string password)
|
||||
=> this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
UPDATE [Mitarbeiter]
|
||||
@@ -85,9 +85,9 @@
|
||||
|
||||
public static class AccountExtensions
|
||||
{
|
||||
public static String ComputeHash(this HashAlgorithm hashAlgorithm, String value)
|
||||
public static string ComputeHash(this HashAlgorithm hashAlgorithm, string value)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(value))
|
||||
if (!string.IsNullOrWhiteSpace(value))
|
||||
{
|
||||
var bytes = Encoding.UTF8.GetBytes(value);
|
||||
var hash = hashAlgorithm.ComputeHash(bytes);
|
||||
@@ -99,7 +99,7 @@
|
||||
return value;
|
||||
}
|
||||
|
||||
public static String ComputeHash(this String value)
|
||||
public static string ComputeHash(this string value)
|
||||
=> SHA256.Create().ComputeHash(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
public Result Add(ProductionApproval approval)
|
||||
{
|
||||
var message = String.Empty;
|
||||
var message = string.Empty;
|
||||
var rowsAffected = this.sqlConnection
|
||||
.CreateCommand($@"
|
||||
INSERT INTO [Cordonel_Special_Requirements] (
|
||||
@@ -66,7 +66,7 @@
|
||||
{
|
||||
result.WithMessage("Die Genehmigung wurde erfolgreich hinzugefügt.");
|
||||
}
|
||||
else if (String.IsNullOrWhiteSpace(message))
|
||||
else if (string.IsNullOrWhiteSpace(message))
|
||||
{
|
||||
result.WithMessage("Die Genehmigung wurde nicht hinzugefügt.");
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
|
||||
public interface IAccountService
|
||||
{
|
||||
Employee FindEmployee(Int16 userId);
|
||||
Employee FindEmployee(short userId);
|
||||
|
||||
IEnumerable<String> FindUserFunctions(Int16 appId, String username, String password);
|
||||
IEnumerable<string> FindUserFunctions(short appId, string username, string password);
|
||||
|
||||
Int16 Login(String username, String password);
|
||||
short Login(string username, string password);
|
||||
|
||||
Int32 ResetPassword(String username, String password);
|
||||
int ResetPassword(string username, string password);
|
||||
|
||||
Int32 ResetPassword(String username);
|
||||
int ResetPassword(string username);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
public interface IHttpService
|
||||
{
|
||||
Task<HttpResponseModel> GetAsync(String path);
|
||||
Task<HttpResponseModel> GetAsync(string path);
|
||||
|
||||
Task<HttpResponseModel> OptionsAsync(String path);
|
||||
Task<HttpResponseModel> OptionsAsync(string path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
public interface IOrdersService
|
||||
{
|
||||
OrdersFoundModel FindOrders(String search);
|
||||
OrdersFoundModel FindOrders(string search);
|
||||
|
||||
OrderPositions FindPositions(String id);
|
||||
OrderPositions FindPositions(string id);
|
||||
|
||||
ProductionOrders FindProductionOrders(String productionNr);
|
||||
ProductionOrders FindProductionOrders(string productionNr);
|
||||
|
||||
String GetUserEmail(String name);
|
||||
string GetUserEmail(string name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,22 +9,22 @@
|
||||
|
||||
public interface IProtocolService
|
||||
{
|
||||
Boolean DeleteFile(Int32 fileId);
|
||||
bool DeleteFile(int fileId);
|
||||
|
||||
String FileContent(Int32? fileId);
|
||||
string FileContent(int? fileId);
|
||||
|
||||
OrderClientModel FindOrder(Int32 orderId);
|
||||
OrderClientModel FindOrder(int orderId);
|
||||
|
||||
IEnumerable<KeyValuePair<Int32, String>> FindOrdersById(Int32 orderno);
|
||||
IEnumerable<KeyValuePair<int, string>> FindOrdersById(int orderno);
|
||||
|
||||
IEnumerable<KeyValuePair<Int32, String>> FindOrdersByClient(String clientName);
|
||||
IEnumerable<KeyValuePair<int, string>> FindOrdersByClient(string clientName);
|
||||
|
||||
IDictionary<Int32, String> GetFiles(Int32 orderId);
|
||||
IDictionary<int, string> GetFiles(int orderId);
|
||||
|
||||
IEnumerable<TestStatus> LoadTestResults(Int32 orderId);
|
||||
IEnumerable<TestStatus> LoadTestResults(int orderId);
|
||||
|
||||
Boolean OrderCompleted(Int32 orderNr);
|
||||
bool OrderCompleted(int orderNr);
|
||||
|
||||
Int32 SaveFile(Stream fileStream, Int32 clientId, Int32 orderId);
|
||||
int SaveFile(Stream fileStream, int clientId, int orderId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
|
||||
HeliumReportModel LoadHeliumPressureReport(HeliumReportModel model = null);
|
||||
|
||||
IEnumerable<HeliumPressurePoint> LoadHeliumPressureResults(Int32 testId);
|
||||
IEnumerable<HeliumPressurePoint> LoadHeliumPressureResults(int testId);
|
||||
|
||||
Byte[] LoadHeliumPressureReportAsCSV(HeliumReportModel model);
|
||||
byte[] LoadHeliumPressureReportAsCSV(HeliumReportModel model);
|
||||
|
||||
KottmannReportModel LoadKottmannPressureReport(KottmannReportModel model = null);
|
||||
|
||||
Byte[] LoadKottmannPressureReportAsCSV(KottmannReportModel model);
|
||||
byte[] LoadKottmannPressureReportAsCSV(KottmannReportModel model);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
public interface IShipmentsService
|
||||
{
|
||||
OrderScanModel DeletePalletEntry(Int32 id);
|
||||
OrderScanModel DeletePalletEntry(int id);
|
||||
|
||||
Byte[] LoadBatchBuffer(OrderScanModel model);
|
||||
byte[] LoadBatchBuffer(OrderScanModel model);
|
||||
|
||||
PalletsBatchModel LoadBatchModel(OrderScanModel model);
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
public BatchPrintModel(PalletsBatchModel batchModel)
|
||||
=> this.batchModel = batchModel;
|
||||
|
||||
public String ClientName
|
||||
public string ClientName
|
||||
=> this.batchModel.Customer;
|
||||
|
||||
public Int32 OrderNr
|
||||
public int OrderNr
|
||||
=> this.batchModel.OrderNr;
|
||||
|
||||
public Int32 PalletNr
|
||||
public int PalletNr
|
||||
=> this.batchModel
|
||||
.Positions
|
||||
?.FirstOrDefault()
|
||||
@@ -25,7 +25,7 @@
|
||||
?.FirstOrDefault()
|
||||
?.PalletNr ?? 0;
|
||||
|
||||
public Int32 ProductionOrderNr
|
||||
public int ProductionOrderNr
|
||||
=> this.batchModel.ProductionOrderNr;
|
||||
|
||||
public IEnumerable<PalletPosition> Positions
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
public class Employee
|
||||
{
|
||||
public String Name { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public Boolean IsValid
|
||||
=> !String.IsNullOrWhiteSpace(this.Name);
|
||||
public bool IsValid
|
||||
=> !string.IsNullOrWhiteSpace(this.Name);
|
||||
|
||||
public IEnumerable<String> Permissions { get; set; }
|
||||
= Array.Empty<String>();
|
||||
public IEnumerable<string> Permissions { get; set; }
|
||||
= Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
|
||||
public class HttpResponseModel
|
||||
{
|
||||
public Boolean Succeeded { get; internal set; }
|
||||
public bool Succeeded { get; internal set; }
|
||||
|
||||
public String Content { get; internal set; }
|
||||
public string Content { get; internal set; }
|
||||
|
||||
public String Error { get; internal set; }
|
||||
public string Error { get; internal set; }
|
||||
|
||||
public T Deserialize<T>() where T : new ()
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(this.Content))
|
||||
if (!string.IsNullOrWhiteSpace(this.Content))
|
||||
{
|
||||
return JsonConvert.DeserializeObject<T>(this.Content);
|
||||
}
|
||||
|
||||
@@ -6,16 +6,16 @@
|
||||
{
|
||||
public DateTime EntryDate { get; set; }
|
||||
|
||||
public Int32 OrderNr { get; set; }
|
||||
public int OrderNr { get; set; }
|
||||
|
||||
public Int32 PosNr { get; set; }
|
||||
public int PosNr { get; set; }
|
||||
|
||||
public Int32 SerialNr { get; set; }
|
||||
public int SerialNr { get; set; }
|
||||
|
||||
public String CustomSerial { get; set; }
|
||||
public string CustomSerial { get; set; }
|
||||
|
||||
public String Term { get; set; }
|
||||
public string Term { get; set; }
|
||||
|
||||
public String Type { get; set; }
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
|
||||
public class OrderClientModel
|
||||
{
|
||||
public Int32? OrderId { get; set; }
|
||||
public int? OrderId { get; set; }
|
||||
|
||||
public Int32? ClientId { get; set; }
|
||||
public int? ClientId { get; set; }
|
||||
|
||||
public String ClientName { get; set; }
|
||||
public string ClientName { get; set; }
|
||||
|
||||
public Int32 Files { get; set; }
|
||||
public int Files { get; set; }
|
||||
|
||||
public Int16[] SelectedPositions { get; set; }
|
||||
public short[] SelectedPositions { get; set; }
|
||||
|
||||
public IDictionary<Int16, Boolean> Positions { get; set; }
|
||||
public IDictionary<short, bool> Positions { get; set; }
|
||||
|
||||
public IEnumerable<TestStatus> Results { get; set; }
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
|
||||
public class OrderFiles
|
||||
{
|
||||
public Int32 OrderId { get; set; }
|
||||
public int OrderId { get; set; }
|
||||
|
||||
public Int32 FileId { get; set; }
|
||||
public int FileId { get; set; }
|
||||
|
||||
public String FileContent { get; set; }
|
||||
public string FileContent { get; set; }
|
||||
|
||||
public IEnumerable<Int32> Files { get; set; }
|
||||
public IEnumerable<int> Files { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
public class OrderIdentity
|
||||
{
|
||||
public Int32 OrderNr { get; set; }
|
||||
public int OrderNr { get; set; }
|
||||
|
||||
public Int32 PositionNr { get; set; }
|
||||
public int PositionNr { get; set; }
|
||||
|
||||
public Int32 SerialNr { get; set; }
|
||||
public int SerialNr { get; set; }
|
||||
|
||||
public String CustomerSerialNr { get; set; }
|
||||
public string CustomerSerialNr { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,29 +5,29 @@
|
||||
|
||||
public class OrderInfoModel
|
||||
{
|
||||
public Int32 OrderNr { get; set; }
|
||||
public int OrderNr { get; set; }
|
||||
|
||||
public Int32 ProductionOrderNr { get; set; }
|
||||
public int ProductionOrderNr { get; set; }
|
||||
|
||||
public String Customer { get; set; }
|
||||
public string Customer { get; set; }
|
||||
|
||||
public String Nr
|
||||
public string Nr
|
||||
=> this.OrderNr > 0
|
||||
? $"{this.OrderNr}"
|
||||
: this.ProductionOrderNr > 0
|
||||
? $"{this.ProductionOrderNr}"
|
||||
: default(String);
|
||||
: default(string);
|
||||
|
||||
public static readonly OrderInfoComparer Comparer
|
||||
= new OrderInfoComparer();
|
||||
|
||||
public class OrderInfoComparer : IEqualityComparer<OrderInfoModel>
|
||||
{
|
||||
public Boolean Equals(OrderInfoModel x, OrderInfoModel y)
|
||||
public bool Equals(OrderInfoModel x, OrderInfoModel y)
|
||||
=> x?.OrderNr == y?.OrderNr;
|
||||
|
||||
public Int32 GetHashCode(OrderInfoModel obj)
|
||||
=> obj?.OrderNr ?? default(Int32);
|
||||
public int GetHashCode(OrderInfoModel obj)
|
||||
=> obj?.OrderNr ?? default(int);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,18 +5,18 @@
|
||||
|
||||
public class OrderModel
|
||||
{
|
||||
public readonly String ScanTitle = "Scanvorgang";
|
||||
public readonly String BtnSerialNr = "Serien-Nr. hinzufügen";
|
||||
public readonly string ScanTitle = "Scanvorgang";
|
||||
public readonly string BtnSerialNr = "Serien-Nr. hinzufügen";
|
||||
|
||||
[Required]
|
||||
public Int32? OrderNr { get; set; }
|
||||
public int? OrderNr { get; set; }
|
||||
|
||||
|
||||
[Display(Name = "Positions-Nr. auswählen")]
|
||||
public Int32? PositionNr { get; set; }
|
||||
public int? PositionNr { get; set; }
|
||||
|
||||
[Required]
|
||||
[Display(Name = "Serien-Nr. scanen oder eingeben")]
|
||||
public String SerialNr { get; set; }
|
||||
public string SerialNr { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -4,14 +4,14 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class OrderPositions : IEnumerable<Int32>
|
||||
public class OrderPositions : IEnumerable<int>
|
||||
{
|
||||
private readonly IEnumerable<Int32> positions;
|
||||
private readonly IEnumerable<int> positions;
|
||||
|
||||
public OrderPositions(IEnumerable<Int32> positions)
|
||||
public OrderPositions(IEnumerable<int> positions)
|
||||
=> this.positions = positions;
|
||||
|
||||
public IEnumerator<Int32> GetEnumerator()
|
||||
public IEnumerator<int> GetEnumerator()
|
||||
=> this.positions.GetEnumerator();
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
|
||||
@@ -7,28 +7,28 @@
|
||||
|
||||
public class OrderScanModel : OrderModel
|
||||
{
|
||||
public String Host { get; set; }
|
||||
public string Host { get; set; }
|
||||
|
||||
public String Place { get; set; }
|
||||
public string Place { get; set; }
|
||||
|
||||
public Int32 PalletsCount { get; set; }
|
||||
public int PalletsCount { get; set; }
|
||||
|
||||
[Display(Name = "Paletten-Nr.")]
|
||||
public Int32? PalletNr { get; set; }
|
||||
public int? PalletNr { get; set; }
|
||||
|
||||
public IEnumerable<Int32> Positions { get; set; }
|
||||
= Array.Empty<Int32>();
|
||||
public IEnumerable<int> Positions { get; set; }
|
||||
= Array.Empty<int>();
|
||||
|
||||
public IDictionary<Int32, Boolean> Pallets { get; set; }
|
||||
= new Dictionary<Int32, Boolean> { { 1, false } };
|
||||
public IDictionary<int, bool> Pallets { get; set; }
|
||||
= new Dictionary<int, bool> { { 1, false } };
|
||||
|
||||
public String PrintUrl
|
||||
public string PrintUrl
|
||||
=> $"~/Shipments/Print?ordernr={this.OrderNr}&positionnr={this.PositionNr}&palletnr={this.PalletNr}";
|
||||
|
||||
public String PalletUrl(Int32? palletNr)
|
||||
public string PalletUrl(int? palletNr)
|
||||
=> $"~/Shipments/Pallet?ordernr={this.OrderNr}&positionnr={this.PositionNr}&palletnr={palletNr}";
|
||||
|
||||
internal void UpdatePallets(IEnumerable<KeyValuePair<Int32, Boolean>> pallets)
|
||||
internal void UpdatePallets(IEnumerable<KeyValuePair<int, bool>> pallets)
|
||||
{
|
||||
this.Pallets = pallets.ToDictionary(x => x.Key, x => x.Value);
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
public class PalletPosition
|
||||
{
|
||||
public Int32 PositionNr { get; set; }
|
||||
public int PositionNr { get; set; }
|
||||
|
||||
public String Description { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public Int32 ItemsCount { get; set; }
|
||||
public int ItemsCount { get; set; }
|
||||
|
||||
public Int32 TotalItemsCount { get; set; }
|
||||
public int TotalItemsCount { get; set; }
|
||||
|
||||
public IEnumerable<SerialNr> Items { get; set; }
|
||||
= Array.Empty<SerialNr>();
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
public class PalletsBatchModel
|
||||
{
|
||||
public String Customer { get; set; }
|
||||
public string Customer { get; set; }
|
||||
|
||||
public Int32 OrderNr { get; set; }
|
||||
public int OrderNr { get; set; }
|
||||
|
||||
public Int32 ProductionOrderNr { get; set; }
|
||||
public int ProductionOrderNr { get; set; }
|
||||
|
||||
public String AdditionalText { get; set; }
|
||||
public string AdditionalText { get; set; }
|
||||
|
||||
public IEnumerable<PalletPosition> Positions { get; set; }
|
||||
= Array.Empty<PalletPosition>();
|
||||
|
||||
@@ -5,34 +5,34 @@
|
||||
|
||||
public class ProductionApproval
|
||||
{
|
||||
public Int32 Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
public Int32? OrderNr { get; set; }
|
||||
public int? OrderNr { get; set; }
|
||||
|
||||
public Int32? PcbId { get; set; }
|
||||
public int? PcbId { get; set; }
|
||||
|
||||
public Boolean SkipRadioCheck { get; set; }
|
||||
public bool SkipRadioCheck { get; set; }
|
||||
|
||||
public Int32? OverrideFwCheck { get; set; }
|
||||
public int? OverrideFwCheck { get; set; }
|
||||
|
||||
public Int32? OverrideLutCheck { get; set; }
|
||||
public int? OverrideLutCheck { get; set; }
|
||||
|
||||
public Int32? RequiredLifeTimeYearsAssembly { get; set; }
|
||||
public int? RequiredLifeTimeYearsAssembly { get; set; }
|
||||
|
||||
public Int32? RequiredLifeTimeYearsShipping { get; set; }
|
||||
public int? RequiredLifeTimeYearsShipping { get; set; }
|
||||
|
||||
public DateTime? KitronProductionDate { get; set; }
|
||||
|
||||
public Double? MaxDrainedBatteryLoadPercent { get; set; }
|
||||
|
||||
public Int32? MaxStorageMonths { get; set; }
|
||||
public int? MaxStorageMonths { get; set; }
|
||||
|
||||
public DateTime ApprovalDate { get; set; }
|
||||
|
||||
public String ApproverName { get; set; }
|
||||
public string ApproverName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MinLength(10)]
|
||||
public String ApprovalComment { get; set; }
|
||||
public string ApprovalComment { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class ProductionOrders : IEnumerable<Int32>
|
||||
public class ProductionOrders : IEnumerable<int>
|
||||
{
|
||||
private readonly IEnumerable<Int32> productionOrders;
|
||||
private readonly IEnumerable<int> productionOrders;
|
||||
|
||||
public ProductionOrders(IEnumerable<Int32> productionOrders)
|
||||
public ProductionOrders(IEnumerable<int> productionOrders)
|
||||
=> this.productionOrders = productionOrders;
|
||||
|
||||
public IEnumerator<Int32> GetEnumerator()
|
||||
public IEnumerator<int> GetEnumerator()
|
||||
=> this.productionOrders.GetEnumerator();
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
|
||||
+11
-11
@@ -8,43 +8,43 @@
|
||||
{
|
||||
[Display(Name = "Auftrag Nr")]
|
||||
[Column("[APS].[AuftragNr]")]
|
||||
public Int32? AuftragNr { get; set; }
|
||||
public int? AuftragNr { get; set; }
|
||||
|
||||
[Display(Name = "Position Nr")]
|
||||
[Column("[APS].[PositionNr]")]
|
||||
public Int16? PosNr { get; set; }
|
||||
public short? PosNr { get; set; }
|
||||
|
||||
[Display(Name = "Serial Nr")]
|
||||
[Column("[APS].[SerienNr]")]
|
||||
public Int32? SerialNr { get; set; }
|
||||
public int? SerialNr { get; set; }
|
||||
|
||||
[Display(Name = "Kundenserial Nr")]
|
||||
[Column("[APS].[KundeneigeneSerienNr]")]
|
||||
public String CustomerSerialNr { get; set; }
|
||||
public string CustomerSerialNr { get; set; }
|
||||
|
||||
[Display(Name = "IdentNr")]
|
||||
[Column("[ID].[IdentNr]")]
|
||||
public Int32? IdentNr { get; set; }
|
||||
public int? IdentNr { get; set; }
|
||||
|
||||
[Display(Name = "PcbId")]
|
||||
[Column("[CPSTR].[PcbId]")]
|
||||
public Int32 PcbId { get; set; }
|
||||
public int PcbId { get; set; }
|
||||
|
||||
[Display(Name = "Typ")]
|
||||
[Column("[ID].[Typ]")]
|
||||
public String TypeI { get; set; }
|
||||
public string TypeI { get; set; }
|
||||
|
||||
[Display(Name = "Zusatz")]
|
||||
[Column("[ID].[Typzusatz]")]
|
||||
public String TypeII { get; set; }
|
||||
public string TypeII { get; set; }
|
||||
|
||||
[Display(Name = "Nennweite")]
|
||||
[Column("[ID].[Nennweite]")]
|
||||
public Int32? Nennweite { get; set; }
|
||||
public int? Nennweite { get; set; }
|
||||
|
||||
[Display(Name = "Baulänge")]
|
||||
[Column("[ID].[Baulaenge]")]
|
||||
public Int32? Baulaenge { get; set; }
|
||||
public int? Baulaenge { get; set; }
|
||||
|
||||
[Display(Name = "AVG Pressure")]
|
||||
[Column("[CPSTR].[AvgPressureInBar]")]
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
[Display(Name = "Test passed")]
|
||||
[Column("[CPSTR].[TestPassed]")]
|
||||
public Boolean TestPassed { get; set; }
|
||||
public bool TestPassed { get; set; }
|
||||
|
||||
[Display(Name = "Test Date")]
|
||||
[Column("[CPSTR].[TestDate]")]
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
public static implicit operator CordonelPressureSensorModel(CordonelPressureSensorFilter filter)
|
||||
=> new CordonelPressureSensorModel { Filter = filter };
|
||||
|
||||
public String Display(Expression<Func<CordonelPressureSensorItem, Object>> expression)
|
||||
public string Display(Expression<Func<CordonelPressureSensorItem, object>> expression)
|
||||
=> ReportModelExtensions.Display(expression);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
public class HeliumPressurePoint
|
||||
{
|
||||
public Int32 TestId { get; set; }
|
||||
public int TestId { get; set; }
|
||||
|
||||
public Int32 PointNr { get; set; }
|
||||
public int PointNr { get; set; }
|
||||
|
||||
public Decimal Result { get; set; }
|
||||
}
|
||||
|
||||
@@ -8,71 +8,71 @@
|
||||
{
|
||||
[Display(Name = "Auftrag Nr.")]
|
||||
[Column("[POS].[AuftragNr]")]
|
||||
public Int32 AuftragNr { get; set; }
|
||||
public int AuftragNr { get; set; }
|
||||
|
||||
[Display(Name = "Fertigung Nr.")]
|
||||
[Column("[PT].[CordonelPressureTest_FertigungsAuftragsNr]")]
|
||||
public Int32 FertigungNr { get; set; }
|
||||
public int FertigungNr { get; set; }
|
||||
|
||||
[Display(Name = "Pos.")]
|
||||
[Column("[POS].[PositionNr]")]
|
||||
public Int16 PositionNr { get; set; }
|
||||
public short PositionNr { get; set; }
|
||||
|
||||
[Display(Name = "Serial Nr.")]
|
||||
[Column("[PCB2SN].[MapPcbIdToSerialNumber_SerialNumber]")]
|
||||
public Int32 SerialNr { get; set; }
|
||||
public int SerialNr { get; set; }
|
||||
|
||||
[Display(Name = "Ident Nr.")]
|
||||
[Column("[ID].[IdentNr]")]
|
||||
public Int32 IdentNr { get; set; }
|
||||
public int IdentNr { get; set; }
|
||||
|
||||
[Display(Name = "He Id")]
|
||||
[Column("[PT_HE].[CordonelPressureTestHe_Id]")]
|
||||
public Int32 HeId { get; set; }
|
||||
public int HeId { get; set; }
|
||||
|
||||
[Display(Name = "He TestId")]
|
||||
[Column("[PT_HE].[CordonelPressureTestHe_TestID]")]
|
||||
public Int32 HeTestId { get; set; }
|
||||
public int HeTestId { get; set; }
|
||||
|
||||
[Display(Name = "Pcb Id")]
|
||||
[Column("[PT].[CordonelPressureTest_PcbId]")]
|
||||
public Int32 PcbId { get; set; }
|
||||
public int PcbId { get; set; }
|
||||
|
||||
[Display(Name = "Nennweite")]
|
||||
[Column("[ID].[Nennweite]")]
|
||||
public Int32? Nennweite { get; set; }
|
||||
public int? Nennweite { get; set; }
|
||||
|
||||
[Display(Name = "Baulänge")]
|
||||
[Column("[ID].[Baulaenge]")]
|
||||
public Int32? Baulaenge { get; set; }
|
||||
public int? Baulaenge { get; set; }
|
||||
|
||||
[Display(Name = "Typ")]
|
||||
[Column("[ID].[Typ]")]
|
||||
public String Typ { get; set; }
|
||||
public string Typ { get; set; }
|
||||
|
||||
[Display(Name = "Druck")]
|
||||
[Column("[ID].[Druck]")]
|
||||
public Int32? Druck { get; set; }
|
||||
public int? Druck { get; set; }
|
||||
|
||||
[Display(Name = "°C")]
|
||||
[Column("[ID].[Temperatur]")]
|
||||
public Int32? Temperatur { get; set; }
|
||||
public int? Temperatur { get; set; }
|
||||
|
||||
[Display(Name = "Lake Rate")]
|
||||
[Column("[PT_HE].[CordonelPressureTestHe_LeakRate]")]
|
||||
public String HeLakeRate { get; set; }
|
||||
public string HeLakeRate { get; set; }
|
||||
|
||||
[Display(Name = "He Druck")]
|
||||
[Column("[PT_HE].[CordonelPressureTestHe_TestPressure]")]
|
||||
public String HeTestPressure { get; set; }
|
||||
public string HeTestPressure { get; set; }
|
||||
|
||||
[Display(Name = "Valid")]
|
||||
[Column("[PT].[CordonelPressureTest_Valid]")]
|
||||
public Boolean IsValid { get; set; }
|
||||
public bool IsValid { get; set; }
|
||||
|
||||
[Display(Name = "Text")]
|
||||
[Column("[PT].[CordonelPressureTest_Text]")]
|
||||
public String Text { get; set; }
|
||||
public string Text { get; set; }
|
||||
|
||||
[Display(Name = "Datum")]
|
||||
[Column("[PT].[CordonelPressureTest_Date]")]
|
||||
@@ -80,6 +80,6 @@
|
||||
|
||||
[Display(Name = "Tester")]
|
||||
[Column("[PT_HE].[CordonelPressureTestHe_TesterName]")]
|
||||
public String Tester { get; set; }
|
||||
public string Tester { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
public static implicit operator HeliumReportModel(HeliumReportFilter filter)
|
||||
=> new HeliumReportModel { Filter = filter };
|
||||
|
||||
public String Display(Expression<Func<HeliumReportItem, Object>> expression)
|
||||
public string Display(Expression<Func<HeliumReportItem, object>> expression)
|
||||
=> ReportModelExtensions.Display(expression);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,27 +8,27 @@
|
||||
{
|
||||
[Display(Name = "Fertigung Nr.")]
|
||||
[Column("[DP].[FertigungsauftragNr]")]
|
||||
public Int32? FertigungsNr { get; set; }
|
||||
public int? FertigungsNr { get; set; }
|
||||
|
||||
[Display(Name = "Serial Nr.")]
|
||||
[Column("[PCB2SN].[MapPcbIdToSerialNumber_SerialNumber]")]
|
||||
public Int32 SerialNr { get; set; }
|
||||
public int SerialNr { get; set; }
|
||||
|
||||
[Display(Name = "Pcb Id")]
|
||||
[Column("[PT].[CordonelPressureTest_PcbId]")]
|
||||
public Int32 PcbId { get; set; }
|
||||
public int PcbId { get; set; }
|
||||
|
||||
[Display(Name = "Nennweite")]
|
||||
[Column("[ID].[Nennweite]")]
|
||||
public Int32? Nennweite { get; set; }
|
||||
public int? Nennweite { get; set; }
|
||||
|
||||
[Display(Name = "Baulaenge")]
|
||||
[Column("[ID].[Baulaenge]")]
|
||||
public Int32? Baulaenge { get; set; }
|
||||
public int? Baulaenge { get; set; }
|
||||
|
||||
[Display(Name = "Typ")]
|
||||
[Column("[ID].[Typ]")]
|
||||
public String Typ { get; set; }
|
||||
public string Typ { get; set; }
|
||||
|
||||
[Display(Name = "Start Druck")]
|
||||
[Column("[DP].[StartDruck]")]
|
||||
@@ -40,11 +40,11 @@
|
||||
|
||||
[Display(Name = "Zeit")]
|
||||
[Column("[DP].[Pruefzeit]")]
|
||||
public Int32 DruckZeit { get; set; }
|
||||
public int DruckZeit { get; set; }
|
||||
|
||||
[Display(Name = "Dicht")]
|
||||
[Column("[DP].[Dicht]")]
|
||||
public Boolean Dicht { get; set; }
|
||||
public bool Dicht { get; set; }
|
||||
|
||||
[Display(Name = "Datum")]
|
||||
[Column("[DP].[Datum]")]
|
||||
@@ -52,6 +52,6 @@
|
||||
|
||||
[Display(Name = "Bemerkung")]
|
||||
[Column("[DP].[Bemerkung]")]
|
||||
public String Bemerkung { get; internal set; }
|
||||
public string Bemerkung { get; internal set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
public static implicit operator KottmannReportModel(KottmannReportFilter filter)
|
||||
=> new KottmannReportModel { Filter = filter };
|
||||
|
||||
public String Display(Expression<Func<KottmannReportItem, Object>> expression)
|
||||
public string Display(Expression<Func<KottmannReportItem, object>> expression)
|
||||
=> ReportModelExtensions.Display(expression);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
|
||||
foreach (var property in this)
|
||||
{
|
||||
if (String.IsNullOrWhiteSpace(property.Like))
|
||||
if (string.IsNullOrWhiteSpace(property.Like))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (property.Type == PropertyType.Date)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(property.Like))
|
||||
if (!string.IsNullOrWhiteSpace(property.Like))
|
||||
{
|
||||
var dateTokens = property
|
||||
.Like
|
||||
@@ -81,7 +81,7 @@
|
||||
else if (property.Type == PropertyType.Bool)
|
||||
{
|
||||
var propertyName = $"{property.Property}_{property.Index}";
|
||||
var propertyValue = Int32.TryParse(property.Like, out Int32 bit) ? bit : 0;
|
||||
var propertyValue = int.TryParse(property.Like, out int bit) ? bit : 0;
|
||||
|
||||
sqlExpression.Add($"{property.Column} = @{propertyName}", propertyName, property.Like);
|
||||
}
|
||||
|
||||
@@ -4,38 +4,38 @@
|
||||
|
||||
public class ReportFilterProperty
|
||||
{
|
||||
public Int32 Index { get; set; }
|
||||
public int Index { get; set; }
|
||||
|
||||
public PropertyType Type { get; set; }
|
||||
|
||||
public String Property { get; set; }
|
||||
public string Property { get; set; }
|
||||
|
||||
public String Column { get; set; }
|
||||
public string Column { get; set; }
|
||||
|
||||
public String Like { get; set; }
|
||||
public string Like { get; set; }
|
||||
|
||||
public Int32 OrderBy { get; set; }
|
||||
public int OrderBy { get; set; }
|
||||
|
||||
|
||||
public String TypeName
|
||||
public string TypeName
|
||||
=> $"Filter[{this.Index}].{nameof(this.Type)}";
|
||||
|
||||
public String IndexName
|
||||
public string IndexName
|
||||
=> $"Filter[{this.Index}].{nameof(this.Index)}";
|
||||
|
||||
public String PropertyName
|
||||
public string PropertyName
|
||||
=> $"Filter[{this.Index}].{nameof(this.Property)}";
|
||||
|
||||
public String ColumnName
|
||||
public string ColumnName
|
||||
=> $"Filter[{this.Index}].{nameof(this.Column)}";
|
||||
|
||||
public String LikeName
|
||||
public string LikeName
|
||||
=> $"Filter[{this.Index}].{nameof(this.Like)}";
|
||||
|
||||
public String OrderByName
|
||||
public string OrderByName
|
||||
=> $"Filter[{this.Index}].{nameof(this.OrderBy)}";
|
||||
|
||||
public String OrderById
|
||||
public string OrderById
|
||||
=> $"Filter_{this.Index}_{nameof(this.OrderBy)}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,16 +8,16 @@
|
||||
|
||||
public static class ReportModelExtensions
|
||||
{
|
||||
public static ReportFilterProperty Text<T>(this T model, Expression<Func<T, Object>> expression, Int32 index, Int32 orderBy = 0)
|
||||
public static ReportFilterProperty Text<T>(this T model, Expression<Func<T, object>> expression, int index, int orderBy = 0)
|
||||
=> model.Property(expression, index, PropertyType.Text, orderBy);
|
||||
|
||||
public static ReportFilterProperty DateTime<T>(this T model, Expression<Func<T, Object>> expression, Int32 index, Int32 orderBy = 0)
|
||||
public static ReportFilterProperty DateTime<T>(this T model, Expression<Func<T, object>> expression, int index, int orderBy = 0)
|
||||
=> model.Property(expression, index, PropertyType.Date, orderBy);
|
||||
|
||||
public static ReportFilterProperty Boolean<T>(this T model, Expression<Func<T, Object>> expression, Int32 index, Int32 orderBy = 0)
|
||||
public static ReportFilterProperty Boolean<T>(this T model, Expression<Func<T, object>> expression, int index, int orderBy = 0)
|
||||
=> model.Property(expression, index, PropertyType.Bool, orderBy);
|
||||
|
||||
public static ReportFilterProperty Property<T>(this T model, Expression<Func<T, Object>> expression, Int32 index, PropertyType propertyType, Int32 orderBy)
|
||||
public static ReportFilterProperty Property<T>(this T model, Expression<Func<T, object>> expression, int index, PropertyType propertyType, int orderBy)
|
||||
{
|
||||
var memberInfo = default(MemberInfo);
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
};
|
||||
}
|
||||
|
||||
public static String Display<T>(Expression<Func<T, Object>> expression)
|
||||
public static string Display<T>(Expression<Func<T, object>> expression)
|
||||
{
|
||||
var memberInfo = default(MemberInfo);
|
||||
|
||||
|
||||
@@ -5,35 +5,35 @@
|
||||
|
||||
public class SqlExpression
|
||||
{
|
||||
private readonly ICollection<String> expressions
|
||||
= new List<String>();
|
||||
private readonly ICollection<string> expressions
|
||||
= new List<string>();
|
||||
|
||||
public String Query { get; set; }
|
||||
public string Query { get; set; }
|
||||
|
||||
public IDictionary<String, Object> Parameters { get; set; }
|
||||
= new Dictionary<String, Object>();
|
||||
public IDictionary<string, object> Parameters { get; set; }
|
||||
= new Dictionary<string, object>();
|
||||
|
||||
internal void Add(String expression)
|
||||
internal void Add(string expression)
|
||||
=> this.expressions.Add(expression);
|
||||
|
||||
internal void Add(String expression, String propertyName, Object propertyValue)
|
||||
internal void Add(string expression, string propertyName, object propertyValue)
|
||||
{
|
||||
this.Parameters[propertyName] = propertyValue;
|
||||
|
||||
this.expressions.Add(expression);
|
||||
}
|
||||
|
||||
internal SqlExpression BuildOrderBy(String delimiter)
|
||||
internal SqlExpression BuildOrderBy(string delimiter)
|
||||
{
|
||||
this.Query = String.Join(delimiter, this.expressions);
|
||||
this.Query = string.Join(delimiter, this.expressions);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
internal SqlExpression BuildWhere(String delimiter)
|
||||
internal SqlExpression BuildWhere(string delimiter)
|
||||
{
|
||||
this.Query = this.expressions.Count > 0
|
||||
? String.Join(delimiter, this.expressions)
|
||||
? string.Join(delimiter, this.expressions)
|
||||
: "1 = 1";
|
||||
|
||||
return this;
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
|
||||
public class TestStatus
|
||||
{
|
||||
public Int16 PosNr { get; set; }
|
||||
public short PosNr { get; set; }
|
||||
|
||||
public String SerialNr { get; set; }
|
||||
public string SerialNr { get; set; }
|
||||
|
||||
public Boolean? HeliumTest { get; set; }
|
||||
public bool? HeliumTest { get; set; }
|
||||
|
||||
public Boolean? PressureTest { get; set; }
|
||||
public bool? PressureTest { get; set; }
|
||||
|
||||
public Boolean? MetroTest { get; set; }
|
||||
public bool? MetroTest { get; set; }
|
||||
|
||||
public Boolean? RadioTest { get; set; }
|
||||
public bool? RadioTest { get; set; }
|
||||
|
||||
public Boolean Succeeded
|
||||
public bool Succeeded
|
||||
=> (this.HeliumTest ?? false)
|
||||
&& (this.PressureTest ?? false)
|
||||
&& (this.MetroTest ?? false)
|
||||
|
||||
@@ -4,38 +4,38 @@
|
||||
|
||||
public class Result
|
||||
{
|
||||
private readonly Boolean succeeded;
|
||||
private readonly bool succeeded;
|
||||
|
||||
private String message;
|
||||
private string message;
|
||||
|
||||
private Result(Boolean succeeded = true)
|
||||
private Result(bool succeeded = true)
|
||||
{
|
||||
this.succeeded = succeeded;
|
||||
this.message = String.Empty;
|
||||
this.message = string.Empty;
|
||||
}
|
||||
|
||||
private Result(String message = default(String))
|
||||
private Result(string message = default(string))
|
||||
{
|
||||
this.message = message;
|
||||
this.succeeded = String.IsNullOrWhiteSpace(message);
|
||||
this.succeeded = string.IsNullOrWhiteSpace(message);
|
||||
}
|
||||
|
||||
public void WithMessage(String message)
|
||||
public void WithMessage(string message)
|
||||
=> this.message = message;
|
||||
|
||||
public override String ToString()
|
||||
public override string ToString()
|
||||
=> this.message;
|
||||
|
||||
public static implicit operator Result(Boolean succeeded)
|
||||
public static implicit operator Result(bool succeeded)
|
||||
=> new Result(succeeded);
|
||||
|
||||
public static implicit operator Result(String message)
|
||||
public static implicit operator Result(string message)
|
||||
=> new Result(message);
|
||||
|
||||
public static implicit operator Boolean(Result result)
|
||||
public static implicit operator bool(Result result)
|
||||
=> result.succeeded;
|
||||
|
||||
public static implicit operator String(Result result)
|
||||
public static implicit operator string(Result result)
|
||||
=> result.ToString();
|
||||
}
|
||||
}
|
||||
@@ -7,31 +7,31 @@
|
||||
public class SearchWildcardModel
|
||||
{
|
||||
[Display(Name = "Radioadress | PcbId | SerienNr | KundenSerienNr")]
|
||||
public virtual String Token { get; set; }
|
||||
public virtual string Token { get; set; }
|
||||
|
||||
[Display(Name = "Select fields")]
|
||||
public virtual IDictionary<String, Boolean> Fields { get; set; }
|
||||
public virtual IDictionary<string, bool> Fields { get; set; }
|
||||
|
||||
public virtual IEnumerable<IDictionary<String, Object>> Results { get; set; }
|
||||
public virtual IEnumerable<IDictionary<string, object>> Results { get; set; }
|
||||
}
|
||||
|
||||
public class SearchPasswordsModel : SearchWildcardModel
|
||||
{
|
||||
[Display(Name = "Radioadress | PcbId | SerienNr | KundenSerienNr")]
|
||||
public override String Token
|
||||
public override string Token
|
||||
{
|
||||
get => base.Token;
|
||||
set => base.Token = value;
|
||||
}
|
||||
|
||||
[Display(Name = "Select fields")]
|
||||
public override IDictionary<String, Boolean> Fields
|
||||
public override IDictionary<string, bool> Fields
|
||||
{
|
||||
get => base.Fields;
|
||||
set => base.Fields = value;
|
||||
}
|
||||
|
||||
public override IEnumerable<IDictionary<String, Object>> Results
|
||||
public override IEnumerable<IDictionary<string, object>> Results
|
||||
{
|
||||
get => base.Results;
|
||||
set => base.Results = value;
|
||||
|
||||
@@ -7,25 +7,25 @@
|
||||
|
||||
public class WildcardInputModel
|
||||
{
|
||||
private String token;
|
||||
private IEnumerable<String> fields = Array.Empty<String>();
|
||||
private string token;
|
||||
private IEnumerable<string> fields = Array.Empty<string>();
|
||||
|
||||
[Required]
|
||||
[StringLength(50, MinimumLength = 1)]
|
||||
[RegularExpression("^[0-9 a-z-A-Z]+$")]
|
||||
public String Token
|
||||
public string Token
|
||||
{
|
||||
get => this.token;
|
||||
set => this.token = value?.Replace(" ", "")?.Trim();
|
||||
}
|
||||
|
||||
public String Fields
|
||||
public string Fields
|
||||
{
|
||||
get => String.Join(",", this.fields);
|
||||
get => string.Join(",", this.fields);
|
||||
set => this.fields = $"{value}".Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
}
|
||||
|
||||
internal IEnumerable<String> GetRequiredFields(IEnumerable<String> allFields)
|
||||
internal IEnumerable<string> GetRequiredFields(IEnumerable<string> allFields)
|
||||
{
|
||||
if (this.fields.Any())
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class WildcardResult : Dictionary<String, Object>
|
||||
public class WildcardResult : Dictionary<string, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
|
||||
public class SerialNr
|
||||
{
|
||||
public Int32 Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
public Int32 Serial { get; set; }
|
||||
public int Serial { get; set; }
|
||||
|
||||
public Int32 PositionNr { get; set; }
|
||||
public int PositionNr { get; set; }
|
||||
|
||||
public Int32? PalletNr { get; set; }
|
||||
public int? PalletNr { get; set; }
|
||||
|
||||
public String CustomerSerial { get; set; }
|
||||
public string CustomerSerial { get; set; }
|
||||
|
||||
public Boolean IsScanned { get; set; }
|
||||
public bool IsScanned { get; set; }
|
||||
|
||||
public String BarcodeNr => !String.IsNullOrWhiteSpace(this.CustomerSerial) ? this.CustomerSerial : $"{this.Serial}";
|
||||
public string BarcodeNr => !string.IsNullOrWhiteSpace(this.CustomerSerial) ? this.CustomerSerial : $"{this.Serial}";
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user