2018-01-26 12:55:32 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
2021-05-27 15:30:04 +00:00
|
|
|
|
namespace SharedDatabase.Entities
|
2018-01-26 12:55:32 +00:00
|
|
|
|
{
|
|
|
|
|
|
public class Record
|
|
|
|
|
|
{
|
|
|
|
|
|
public virtual int Id { get; protected set; }
|
2022-01-08 22:26:51 +00:00
|
|
|
|
public virtual string Name { get; set; } /// Part name (e.g. SAP number)
|
|
|
|
|
|
public virtual string Code { get; set; } /// Serial number or batch number
|
|
|
|
|
|
public virtual int Result { get; set; } /// Operation result: 0=OK, otherwise a non-zero error code
|
|
|
|
|
|
public virtual string Note { get; set; } /// Arbitrary additional information (e.g. Oracle settings)
|
|
|
|
|
|
public virtual StepRecord StepRecord { get; set; } /// Step record with timestamp/workstep/workplace/user info, many-to-one relationship
|
|
|
|
|
|
public virtual ReferenceRecord ReferenceRecord { get; set; } /// Reference record with info identifying the product, many-to-one relationship
|
2018-01-26 12:55:32 +00:00
|
|
|
|
|
2022-01-08 22:26:51 +00:00
|
|
|
|
protected Record() { }
|
2018-01-26 12:55:32 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-01-08 22:26:51 +00:00
|
|
|
|
/// Constructor used when a part barcode is scanned
|
2018-01-26 12:55:32 +00:00
|
|
|
|
/// </summary>
|
2022-01-08 22:26:51 +00:00
|
|
|
|
/// <param name="name">Part name (SAP nr.)</param>
|
|
|
|
|
|
/// <param name="code">Scanned barcode: S/N or a batch nr.</param>
|
|
|
|
|
|
/// <param name="result">0=OK, otherwise a non-zero error code</param>
|
|
|
|
|
|
/// <param name="stepRecord">Step record</param>
|
|
|
|
|
|
/// <param name="referenceRecord">Reference record</param>
|
|
|
|
|
|
/// <param name="note">true = record with workstep info, false = record with part info</param>
|
|
|
|
|
|
public Record(ReferenceRecord referenceRecord, StepRecord stepRecord, string name, string code, int result = 0, string note = null)
|
2018-01-26 12:55:32 +00:00
|
|
|
|
{
|
2022-01-08 22:26:51 +00:00
|
|
|
|
ReferenceRecord = referenceRecord;
|
|
|
|
|
|
StepRecord = stepRecord;
|
|
|
|
|
|
Name = name;
|
|
|
|
|
|
Code = code;
|
|
|
|
|
|
Result = Result;
|
|
|
|
|
|
Note = note;
|
2018-01-26 12:55:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
2022-01-08 22:26:51 +00:00
|
|
|
|
return string.Format("name={0} code={1} rslt={2} note={3}",
|
|
|
|
|
|
Name != null ? Name : "<none>",
|
|
|
|
|
|
Code != null ? Code : "<none>",
|
|
|
|
|
|
Result,
|
|
|
|
|
|
Note != null ? Note : "<none>");
|
2018-01-26 12:55:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|