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 { /// /// represents a record in the GroupHardware table in the db /// /// public class GroupHardwareDbRecord : Base.BasePropertyChanged, IGroupHardwareDbRecord { protected int _id = -1; /// /// The database id of the Channel /// [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"); } } }