2018-07-26 16:55:41 +02:00
|
|
|
|
using System;
|
2018-07-30 17:55:15 +02:00
|
|
|
|
using System.Collections.Generic;
|
2018-07-26 16:55:41 +02:00
|
|
|
|
namespace sharpwawi.models
|
|
|
|
|
{
|
|
|
|
|
public class Part : Entity
|
|
|
|
|
{
|
2018-07-30 17:55:15 +02:00
|
|
|
|
public ISet<Assembly> Assemblies { get; private set; } = new HashSet<Assembly>();
|
2018-07-26 16:55:41 +02:00
|
|
|
|
|
|
|
|
|
public Part()
|
|
|
|
|
{
|
|
|
|
|
}
|
2018-07-30 09:23:18 +02:00
|
|
|
|
|
2018-07-30 17:55:15 +02:00
|
|
|
|
public Part(String key,String name)
|
|
|
|
|
:base(key,name)
|
2018-07-30 09:23:18 +02:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-30 17:55:15 +02:00
|
|
|
|
public int HighestAssemblyRevision {
|
|
|
|
|
get {
|
|
|
|
|
int highest = 0;
|
|
|
|
|
foreach (Assembly assembly in Assemblies)
|
|
|
|
|
if (assembly.Revision > highest)
|
|
|
|
|
highest = assembly.Revision;
|
|
|
|
|
return highest;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Assembly CreateAssembly(){
|
|
|
|
|
Assembly assembly = new Assembly(this);
|
|
|
|
|
Assemblies.Add(assembly);
|
|
|
|
|
return assembly;
|
2018-07-30 09:23:18 +02:00
|
|
|
|
}
|
2018-07-30 17:55:15 +02:00
|
|
|
|
|
2018-07-26 16:55:41 +02:00
|
|
|
|
}
|
|
|
|
|
}
|