init
This commit is contained in:
@@ -0,0 +1,130 @@
|
||||
using DTS.Common.Base.Classes;
|
||||
using DTS.Common.Interface.TestMetaData;
|
||||
using DTS.Common.Utilities.Logging;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace DTS.Common.Classes.CustomerDetails
|
||||
{
|
||||
public class CustomerDetailsDbRecord : Base.BasePropertyChanged, ICustomerDetailsDbRecord
|
||||
{
|
||||
private int _customerId = -1;
|
||||
[ReadOnly(true)]
|
||||
[Browsable(false)]
|
||||
public int CustomerId
|
||||
{
|
||||
get => _customerId;
|
||||
set => SetProperty(ref _customerId, value, "CustomerId");
|
||||
}
|
||||
private string _name = "";
|
||||
[ReadOnly(true)]
|
||||
[Browsable(false)]
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
set => SetProperty(ref _name, value, "Name");
|
||||
}
|
||||
private string _customerName = "";
|
||||
[DisplayResource("CustomerName")]
|
||||
public string CustomerName
|
||||
{
|
||||
get => _customerName;
|
||||
set => SetProperty(ref _customerName, value, "CustomerName");
|
||||
}
|
||||
private string _customerTestRefNumber = "";
|
||||
[DisplayResource("CustomerTestRefNumber")]
|
||||
public string CustomerTestRefNumber
|
||||
{
|
||||
get => _customerTestRefNumber;
|
||||
set => SetProperty(ref _customerTestRefNumber, value, "CustomerTestRefNumber");
|
||||
}
|
||||
private string _projectRefNumber = "NOVALUE";
|
||||
[DisplayResource("ProjectRefNumber")]
|
||||
public string ProjectRefNumber
|
||||
{
|
||||
get => _projectRefNumber;
|
||||
set => SetProperty(ref _projectRefNumber, value, "ProjectRefNumber");
|
||||
}
|
||||
private string _customerOrderNumber = "NOVALUE";
|
||||
[DisplayResource("CustomerOrderNumber")]
|
||||
public string CustomerOrderNumber
|
||||
{
|
||||
get => _customerOrderNumber;
|
||||
set => SetProperty(ref _customerOrderNumber, value, "CustomerOrderNumber");
|
||||
}
|
||||
private string _customerCostUnit = "NOVALUE";
|
||||
[DisplayResource("CustomerCostUnit")]
|
||||
public string CustomerCostUnit
|
||||
{
|
||||
get => _customerCostUnit;
|
||||
set => SetProperty(ref _customerCostUnit, value, "CustomerCostUnit");
|
||||
}
|
||||
private bool _localOnly = false;
|
||||
[Browsable(false)]
|
||||
[ReadOnly(true)]
|
||||
public bool LocalOnly
|
||||
{
|
||||
get => _localOnly;
|
||||
set => SetProperty(ref _localOnly, value, "LocalOnly");
|
||||
}
|
||||
private DateTime _lastModified = DateTime.MinValue;
|
||||
[Browsable(false)]
|
||||
[ReadOnly(true)]
|
||||
public DateTime LastModified
|
||||
{
|
||||
get => _lastModified;
|
||||
set => SetProperty(ref _lastModified, value, "LastModified");
|
||||
}
|
||||
private string _lastModifiedBy = "";
|
||||
[Browsable(false)]
|
||||
[ReadOnly(true)]
|
||||
public string LastModifiedBy
|
||||
{
|
||||
get => _lastModifiedBy;
|
||||
set => SetProperty(ref _lastModifiedBy, value, "LastModifiedBy");
|
||||
}
|
||||
private int _version = -1;
|
||||
[Browsable(false)]
|
||||
[ReadOnly(true)]
|
||||
public int Version
|
||||
{
|
||||
get => _version;
|
||||
set => SetProperty(ref _version, value, "Version");
|
||||
}
|
||||
public CustomerDetailsDbRecord(ICustomerDetailsDbRecord customerDetailsDbRecord)
|
||||
{
|
||||
Name = customerDetailsDbRecord.Name;
|
||||
CustomerName = customerDetailsDbRecord.CustomerName;
|
||||
CustomerTestRefNumber = customerDetailsDbRecord.CustomerTestRefNumber;
|
||||
ProjectRefNumber = customerDetailsDbRecord.ProjectRefNumber;
|
||||
CustomerOrderNumber = customerDetailsDbRecord.CustomerOrderNumber;
|
||||
CustomerCostUnit = customerDetailsDbRecord.CustomerCostUnit;
|
||||
LocalOnly = customerDetailsDbRecord.LocalOnly;
|
||||
LastModified = customerDetailsDbRecord.LastModified;
|
||||
LastModifiedBy = customerDetailsDbRecord.LastModifiedBy;
|
||||
Version = customerDetailsDbRecord.Version;
|
||||
}
|
||||
public CustomerDetailsDbRecord() { }
|
||||
public CustomerDetailsDbRecord(IDataReader reader)
|
||||
{
|
||||
Name = Utility.GetString(reader, "Name");
|
||||
CustomerName = Utility.GetString(reader, "CustomerName");
|
||||
CustomerTestRefNumber = Utility.GetString(reader, "CustomerTestRefNumber");
|
||||
ProjectRefNumber = Utility.GetString(reader, "ProjectRefNumber");
|
||||
CustomerOrderNumber = Utility.GetString(reader, "CustomerOrderNumber");
|
||||
CustomerCostUnit = Utility.GetString(reader, "CustomerCostUnit");
|
||||
LocalOnly = Utility.GetBool(reader, "LocalOnly");
|
||||
LastModified = Utility.GetDateTime(reader, "LastModified", DateTime.MinValue);
|
||||
LastModifiedBy = Utility.GetString(reader, "LastModifiedBy");
|
||||
Version = Utility.GetInt(reader, "Version");
|
||||
}
|
||||
public bool IsInvalidBlank()
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user