65 lines
1.9 KiB
Plaintext
65 lines
1.9 KiB
Plaintext
using DTS.Common.Interface.Groups;
|
|
using DTS.Common.Interface.Groups.GroupList;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Data;
|
|
|
|
namespace DTS.Common.Classes.Groups
|
|
{
|
|
/// <summary>
|
|
/// represents a record in the GroupHardware table in the db
|
|
/// <inheritdoc cref="IChannelDbRecord"/>
|
|
/// </summary>
|
|
public class GroupHardwareDbRecord : Base.BasePropertyChanged, IGroupHardwareDbRecord
|
|
{
|
|
protected int _id = -1;
|
|
/// <summary>
|
|
/// The database id of the Channel
|
|
/// </summary>
|
|
[Key]
|
|
public int Id
|
|
{
|
|
get => _id;
|
|
set => SetProperty(ref _id, value, "Id");
|
|
}
|
|
|
|
private int _groupId = -1;
|
|
public int GroupId
|
|
{
|
|
get => _groupId;
|
|
set => SetProperty(ref _groupId, value, "GroupId");
|
|
}
|
|
|
|
private int _dasId = -1;
|
|
public int DASId
|
|
{
|
|
get => _dasId;
|
|
set => SetProperty(ref _dasId, value, "DASId");
|
|
}
|
|
|
|
private string _serialNumber = string.Empty;
|
|
public string SerialNumber
|
|
{
|
|
get => _serialNumber;
|
|
set => SetProperty(ref _serialNumber, value, "SerialNumber");
|
|
}
|
|
|
|
public GroupHardwareDbRecord() { }
|
|
public GroupHardwareDbRecord(IGroupHardwareDbRecord copy)
|
|
{
|
|
Id = copy.Id;
|
|
GroupId = copy.GroupId;
|
|
DASId = copy.DASId;
|
|
SerialNumber = copy.SerialNumber;
|
|
}
|
|
public GroupHardwareDbRecord(IDataReader reader)
|
|
{
|
|
Id = Utility.GetInt(reader, "RecordId", -1);
|
|
GroupId = Utility.GetInt(reader, "GroupId", -1);
|
|
DASId = Utility.GetInt(reader, "DASId", -1);
|
|
SerialNumber = Utility.GetString(reader, "SerialNumber");
|
|
}
|
|
}
|
|
}
|