2018-01-26 12:55:32 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
2018-08-28 07:28:58 +00:00
|
|
|
|
namespace TracingDB.Entities
|
2018-01-26 12:55:32 +00:00
|
|
|
|
{
|
|
|
|
|
|
public class Part
|
|
|
|
|
|
{
|
|
|
|
|
|
public virtual int Id { get; protected set; }
|
|
|
|
|
|
public virtual string Name { get; set; }
|
|
|
|
|
|
public virtual string OraDBType { get; set; }
|
|
|
|
|
|
public virtual string Description { get; set; }
|
|
|
|
|
|
public virtual CodeType CodeType { get; set; }
|
|
|
|
|
|
public virtual CodeForm CodeForm { get; set; }
|
|
|
|
|
|
public virtual CodeLocation CodeLocation { get; set; }
|
2020-12-15 10:48:57 +00:00
|
|
|
|
public virtual string DefaultCode { get; set; }
|
2018-01-26 12:55:32 +00:00
|
|
|
|
public virtual LifetimeManagement LifetimeManagement { get; set; }
|
|
|
|
|
|
public virtual int StepNumber { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public virtual Process Process { get; set; }
|
|
|
|
|
|
public virtual Workstep Workstep { get; set; }
|
|
|
|
|
|
|
2020-12-15 10:48:57 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create a copy of a part (1) belongig to another process, (2) not assigned to any workstep yet.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="process">Process owning the cloned part</param>
|
|
|
|
|
|
/// <returns>Cloned part</returns>
|
|
|
|
|
|
public virtual Part Clone(Process owningProcess)
|
|
|
|
|
|
{
|
|
|
|
|
|
Part rslt = new Part();
|
|
|
|
|
|
|
|
|
|
|
|
rslt.Name = Name;
|
|
|
|
|
|
rslt.OraDBType = OraDBType;
|
|
|
|
|
|
rslt.Description = Description;
|
|
|
|
|
|
rslt.CodeType = CodeType;
|
|
|
|
|
|
rslt.CodeForm = CodeForm;
|
|
|
|
|
|
rslt.CodeLocation = CodeLocation;
|
|
|
|
|
|
rslt.DefaultCode = DefaultCode;
|
|
|
|
|
|
rslt.LifetimeManagement = LifetimeManagement;
|
|
|
|
|
|
rslt.StepNumber = StepNumber;
|
|
|
|
|
|
|
|
|
|
|
|
rslt.Process = owningProcess;
|
|
|
|
|
|
rslt.Workstep = null;
|
|
|
|
|
|
|
|
|
|
|
|
return rslt;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-01-26 12:55:32 +00:00
|
|
|
|
|
2018-08-01 06:44:16 +00:00
|
|
|
|
public Part()
|
2018-01-26 12:55:32 +00:00
|
|
|
|
{
|
|
|
|
|
|
Name = string.Empty;
|
|
|
|
|
|
Description = string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-03-01 13:16:04 +00:00
|
|
|
|
public Part(string name, Process process, string description)
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = name;
|
|
|
|
|
|
Description = description;
|
|
|
|
|
|
Process = process;
|
|
|
|
|
|
Workstep = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2018-01-26 12:55:32 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Constructor used when the part is added to a process
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="name"></param>
|
|
|
|
|
|
/// <param name="codeType"></param>
|
|
|
|
|
|
/// <param name="codeForm"></param>
|
|
|
|
|
|
/// <param name="process"></param>
|
|
|
|
|
|
public Part(string name, Process process, CodeType codeType, CodeForm codeForm, CodeLocation codeLocation)
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = name;
|
|
|
|
|
|
OraDBType = string.Empty;
|
|
|
|
|
|
Description = string.Empty;
|
|
|
|
|
|
CodeType = codeType;
|
|
|
|
|
|
CodeForm = codeForm;
|
|
|
|
|
|
CodeLocation = codeLocation;
|
2020-12-15 10:48:57 +00:00
|
|
|
|
DefaultCode = string.Empty;
|
2018-01-26 12:55:32 +00:00
|
|
|
|
StepNumber = 0;
|
|
|
|
|
|
|
|
|
|
|
|
Process = process;
|
|
|
|
|
|
Workstep = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
2019-03-01 13:16:04 +00:00
|
|
|
|
return string.Format("{0} ({1}: {2})", Name, StepNumber, Description);
|
2018-01-26 12:55:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|