tbf/TracingDB/Entities/Option2.cs
2018-08-28 09:44:39 +02:00

55 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
namespace TracingDB.Entities
{
public class Option2 : Interfaces.IOption
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; 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; }
public virtual LifetimeManagement LifetimeManagement { get; set; }
public virtual bool Enabled { get; set; }
public Option2()
{
Name = string.Empty;
Description = string.Empty;
}
/// <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 GetPart(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.LifetimeManagement = LifetimeManagement;
rslt.StepNumber = 0;
rslt.Process = owningProcess;
rslt.Workstep = null;
return rslt;
}
public override string ToString()
{
return string.Format("{0}. {1} ({2})", ItemNr, Name, Description);
}
}
}