Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It sounds to me like each Tool is going to have it's own logic for determining whether PM is required or not. So I would define an IEquipment interface with a couple enums, something like this:</p> <pre><code>public enum RecurrenceType { //Values } public enum RecurrenceFrequency { //Values } public interface IEquipment { bool IsPMRequired(); RecurrenceType RecurrenceType { get; } RecurrenceFrequency RecurrenceFrequency { get; } //You may want to choose something other than object, or eliminate this property object RecurrenceValue { get; set; } } </code></pre> <p>Then each type of equipment would implement the interface, and the logic to determine whether or not PM is required could be implemented:</p> <pre><code>public class Tractor : IEquipment { public bool IsPMRequired() { //Implement logic here specific to a Tractor throw new NotImplementedException(); } public RecurrenceType RecurrenceType { get { throw new NotImplementedException(); } } public RecurrenceFrequency RecurrenceFrequency { get { throw new NotImplementedException(); } } public object RecurrenceValue { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } } </code></pre> <p>Then your logic to use these objects would be something like:</p> <pre><code>List&lt;IEquipment&gt; equipment = new List&lt;IEquipment&gt;(); //Populate equipment List&lt;IEquipment&gt; display = equipment.Where(e =&gt; e.IsPMRequired()).ToList(); //Display the equipment that needs PM </code></pre> <p>It might also make sense to have a base class for Equipment where you put common method/property definitions.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload