63 lines
3.0 KiB
C#
63 lines
3.0 KiB
C#
using static System.String;
|
|
|
|
namespace Gremlin_BlazorServer.Data.EntityClasses;
|
|
|
|
public class CustomDescription : IMetadata {
|
|
//primary key:
|
|
public uint CustomDescriptionId { get; set; }
|
|
|
|
//foreign keys:
|
|
// public uint ProductId { get; set; } = 1;
|
|
public uint AccountId { get; set; } = 1;
|
|
|
|
//navigation properties:
|
|
// public Product? Product { get; set; }
|
|
public Account? Supplier { get; set; }
|
|
|
|
//class properties:
|
|
public string ProductNumber { get; set; } = Empty;
|
|
public string OptionNumber { get; set; } = Empty;
|
|
public string? Heading { get; set; }
|
|
public string? DescriptionText { get; set; }
|
|
public string? CoverletterText { get; set; }
|
|
public string? Notes { get; set; } //Hinweise, Tipps, Caveats, etc. für Konfiguration, Verwendung, Best Practice usw.
|
|
|
|
//Agilent-Specific properties:
|
|
//NONE
|
|
|
|
//metadata:
|
|
public DateTime DataCreationDate { get; set; } = DateTime.Now;
|
|
public DateTime DataModificationDate { get; set; } = DateTime.Now;
|
|
public DateTime DataValidFrom { get; set; } = DateTime.Now;
|
|
public DateTime DataValidUntil { get; set; } = DateTime.MaxValue;
|
|
public string DataModificationByUser { get; set; } = "Gremlin_BlazorServer";
|
|
public uint DataVersionNumber { get; set; }
|
|
public string? DataVersionComment { get; set; }
|
|
public string DataStatus { get; set; } = "Active";
|
|
|
|
public bool Equals(CustomDescription? other) {
|
|
if (other is null) return false;
|
|
return ProductNumber == other.ProductNumber && OptionNumber == other.OptionNumber && Heading == other.Heading &&
|
|
DescriptionText == other.DescriptionText && CoverletterText == other.CoverletterText;
|
|
}
|
|
|
|
public static bool operator ==(CustomDescription? customDescription1, CustomDescription? customDescription2) {
|
|
if (customDescription1 is null || customDescription2 is null) return false;
|
|
return customDescription1.ProductNumber == customDescription2.ProductNumber &&
|
|
customDescription1.OptionNumber == customDescription2.OptionNumber &&
|
|
customDescription1.Heading == customDescription2.Heading &&
|
|
customDescription1.DescriptionText == customDescription2.DescriptionText &&
|
|
customDescription1.CoverletterText == customDescription2.CoverletterText;
|
|
}
|
|
|
|
public static bool operator !=(CustomDescription? customDescription1, CustomDescription? customDescription2)
|
|
{
|
|
if (customDescription1 is null || customDescription2 is null) return false;
|
|
return customDescription1.ProductNumber != customDescription2.ProductNumber &&
|
|
customDescription1.OptionNumber != customDescription2.OptionNumber &&
|
|
customDescription1.Heading != customDescription2.Heading &&
|
|
customDescription1.DescriptionText != customDescription2.DescriptionText &&
|
|
customDescription1.CoverletterText != customDescription2.CoverletterText &&
|
|
customDescription1.Notes != customDescription2.Notes;
|
|
}
|
|
} |