116 lines
3.2 KiB
C#
116 lines
3.2 KiB
C#
namespace LaaProduction.Cordonel.Models
|
|
{
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Reflection;
|
|
|
|
public class CSRSearchModel
|
|
{
|
|
[Column("OrderNumber")]
|
|
public int? OrderNumber { get; set; }
|
|
|
|
[Column("PcbId")]
|
|
public int? PcbId { get; set; }
|
|
|
|
[Column("Region")]
|
|
public string Region { get; set; }
|
|
|
|
[Column("MeterSize")]
|
|
public short? MeterSize { get; set; }
|
|
|
|
internal WhereQuery WhereQuery()
|
|
{
|
|
var properties = this
|
|
.GetType()
|
|
.GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
|
var whereQuery = new WhereQuery();
|
|
|
|
foreach (var property in properties)
|
|
{
|
|
var value = property.GetValue(this);
|
|
|
|
if (value is null)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
var column = property
|
|
.GetCustomAttribute<ColumnAttribute>()
|
|
?.Name;
|
|
|
|
if (column is null)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
var name = property.Name;
|
|
|
|
whereQuery.And(column, name, value);
|
|
}
|
|
|
|
return whereQuery;
|
|
}
|
|
}
|
|
|
|
public class CSRModel
|
|
{
|
|
[Display(Name = "ID")]
|
|
public int Id { get; set; }
|
|
|
|
[Display(Name = "Order Nr")]
|
|
public int? OrderNumber { get; set; }
|
|
|
|
[Display(Name = "PCB ID")]
|
|
public int? PcbId { get; set; }
|
|
|
|
[Display(Name = "Region")]
|
|
public string Region { get; set; }
|
|
|
|
[Display(Name = "Meter size")]
|
|
public short? MeterSize { get; set; }
|
|
|
|
[Display(Name = "Firmware V")]
|
|
public string FirmwareV { get; set; }
|
|
|
|
[Display(Name = "LUT V")]
|
|
public string LutV { get; set; }
|
|
|
|
[Display(Name = "Battery lifetime years")]
|
|
public float? BatteryLifetimeYears { get; set; }
|
|
|
|
[Display(Name = "Skip radio parameters check")]
|
|
public bool? SkipRadioParametersCheck { get; set; }
|
|
|
|
[Display(Name = "Override FW V")]
|
|
public int? OverrideFwCheck { get; set; }
|
|
|
|
[Display(Name = "Override LUT V")]
|
|
public int? OverrideLutCheck { get; set; }
|
|
|
|
[Display(Name = "Required lifetime years assembly")]
|
|
public float? RequiredLifeTimeYearsAssembly { get; set; }
|
|
|
|
[Display(Name = "Required lifetime years shipping")]
|
|
public float? RequiredLifeTimeYearsShipping { get; set; }
|
|
|
|
[Display(Name = "Kitron production date")]
|
|
public DateTime? KitronProductionDate { get; set; }
|
|
|
|
[Display(Name = "Max drained battery load %")]
|
|
public float? MaxDrainedBatteryLoadPercent { get; set; }
|
|
|
|
[Display(Name = "Max storage months")]
|
|
public float? MaxStorageMonths { get; set; }
|
|
|
|
[Display(Name = "Date added")]
|
|
public DateTime AddDate { get; set; }
|
|
|
|
[Display(Name = "Created by")]
|
|
public string CreatedBy { get; set; }
|
|
|
|
[Display(Name = "Comments")]
|
|
public string Comment { get; set; }
|
|
}
|
|
}
|