ManufacturingPacket.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using InABox.Core;
  6. namespace Comal.Classes
  7. {
  8. public class ManufacturingPacketArea : IFormula<ManufacturingPacket, object>
  9. {
  10. public Expression<Func<ManufacturingPacket, object>> Value => x => x.Height;
  11. public Expression<Func<ManufacturingPacket, object>>[] Modifiers =>
  12. new Expression<Func<ManufacturingPacket, object>>[] { x => x.Width, x => 0.000001m };
  13. public FormulaOperator Operator => FormulaOperator.Multiply;
  14. public FormulaType Type => FormulaType.Virtual;
  15. }
  16. public class ManufacturingPacketVolume : IFormula<ManufacturingPacket, object>
  17. {
  18. public Expression<Func<ManufacturingPacket, object>> Value => x => x.Height;
  19. public Expression<Func<ManufacturingPacket, object>>[] Modifiers => new Expression<Func<ManufacturingPacket, object>>[]
  20. { x => x.Width, x => x.Length, x => 0.000000001m };
  21. public FormulaOperator Operator => FormulaOperator.Multiply;
  22. public FormulaType Type => FormulaType.Virtual;
  23. }
  24. public class ManufacturingPacketTime : CoreAggregate<ManufacturingPacket, ManufacturingPacketStage, TimeSpan>
  25. {
  26. public override Expression<Func<ManufacturingPacketStage, TimeSpan>> Aggregate => x => x.Time;
  27. public override AggregateCalculation Calculation => AggregateCalculation.Sum;
  28. public override Dictionary<Expression<Func<ManufacturingPacketStage, object>>, Expression<Func<ManufacturingPacket, object>>> Links =>
  29. new Dictionary<Expression<Func<ManufacturingPacketStage, object>>, Expression<Func<ManufacturingPacket, object>>>()
  30. {
  31. { ManufacturingPacketStage => ManufacturingPacketStage.Parent.ID, ManufacturingPacket => ManufacturingPacket.ID }
  32. };
  33. }
  34. public class ManufacturingPacketTimeRemaining : CoreAggregate<ManufacturingPacket, ManufacturingPacketStage, TimeSpan>
  35. {
  36. public override Expression<Func<ManufacturingPacketStage, TimeSpan>> Aggregate => x => x.TimeRemaining;
  37. public Expression<Func<ManufacturingPacketStage, Guid>> Link => x => x.Parent.ID;
  38. public override AggregateCalculation Calculation => AggregateCalculation.Sum;
  39. public override Dictionary<Expression<Func<ManufacturingPacketStage, object>>, Expression<Func<ManufacturingPacket, object>>> Links =>
  40. new Dictionary<Expression<Func<ManufacturingPacketStage, object>>, Expression<Func<ManufacturingPacket, object>>>()
  41. {
  42. { ManufacturingPacketStage => ManufacturingPacketStage.Parent.ID, ManufacturingPacket => ManufacturingPacket.ID }
  43. };
  44. }
  45. public class ManufacturingPacketActualTime : CoreAggregate<ManufacturingPacket, ManufacturingHistory, TimeSpan>
  46. {
  47. public override Expression<Func<ManufacturingHistory, TimeSpan>> Aggregate => x => x.WorkDuration;
  48. public override AggregateCalculation Calculation => AggregateCalculation.Sum;
  49. public override Dictionary<Expression<Func<ManufacturingHistory, object>>, Expression<Func<ManufacturingPacket, object>>> Links =>
  50. new Dictionary<Expression<Func<ManufacturingHistory, object>>, Expression<Func<ManufacturingPacket, object>>>()
  51. {
  52. { ManufacturingHistory => ManufacturingHistory.Packet.ID, ManufacturingPacket => ManufacturingPacket.ID }
  53. };
  54. }
  55. [UserTracking("Manufacturing")]
  56. [Caption("Manufacturing")]
  57. public class ManufacturingPacket : Entity, IPersistent, IRemotable, IOneToMany<Setout>, ILicense<ManufacturingLicense>, IIssues, IProblems<ManagedProblem>
  58. {
  59. [TextBoxEditor]
  60. [EditorSequence(1)]
  61. public string Title { get; set; }
  62. [CodeEditor(Visible = Visible.Default, Editable = Editable.Enabled)]
  63. [EditorSequence(2)]
  64. public string Serial { get; set; }
  65. private class SetoutLookup : LookupDefinitionGenerator<Setout, ManufacturingPacket>
  66. {
  67. public override Filter<Setout> DefineFilter(ManufacturingPacket[] items)
  68. {
  69. return new Filter<Setout>(x => x.JobLink.ID).IsEqualTo(items.First().SetoutLink.JobLink.ID);
  70. }
  71. public override Columns<ManufacturingPacket> DefineFilterColumns()
  72. => Columns.None<ManufacturingPacket>().Add(x => x.SetoutLink.JobLink.ID);
  73. }
  74. [LookupDefinition(typeof(SetoutLookup))]
  75. [EditorSequence(3)]
  76. [EntityRelationship(DeleteAction.Cascade)]
  77. [RequiredColumn]
  78. public SetoutLink SetoutLink { get; set; }
  79. private class JobITPLookup : LookupDefinitionGenerator<JobITP, ManufacturingPacket>
  80. {
  81. public override Filter<JobITP> DefineFilter(ManufacturingPacket[] items)
  82. {
  83. if (items.Length == 1)
  84. return new Filter<JobITP>(x => x.Job.ID).IsEqualTo(items.First().SetoutLink.JobLink.ID);
  85. return LookupFactory.DefineFilter<JobITP>();
  86. }
  87. public override Columns<ManufacturingPacket> DefineFilterColumns()
  88. => Columns.None<ManufacturingPacket>().Add(x => x.SetoutLink.JobLink.ID);
  89. }
  90. [EditorSequence(4)]
  91. [LookupDefinition(typeof(JobITPLookup))]
  92. public JobITPLink ITP { get; set; }
  93. [TextBoxEditor]
  94. [EditorSequence(5)]
  95. public string Location { get; set; }
  96. // Used to calculate time & materials
  97. [EditorSequence(7)]
  98. [IntegerEditor]
  99. public int Quantity { get; set; }
  100. [EditorSequence(8)]
  101. [IntegerEditor]
  102. // Determines # of barcodes to print
  103. public int BarcodeQty { get; set; }
  104. [EditorSequence(9)]
  105. [TimestampEditor(Editable = Editable.Hidden)]
  106. public override DateTime Created
  107. {
  108. get => base.Created;
  109. set => base.Created = value;
  110. }
  111. [EditorSequence(10)]
  112. [DateTimeEditor]
  113. public DateTime DueDate { get; set; }
  114. [EditorSequence("Design", 101)]
  115. [EntityRelationship(DeleteAction.Cascade)]
  116. public PDFDocumentLink Drawing { get; set; }
  117. // To be overlaid over the PDF document
  118. [EditorSequence("Design", 102)]
  119. [TextBoxEditor]
  120. public string WaterMark { get; set; }
  121. [EditorSequence("Design", 103)]
  122. public double Height { get; set; }
  123. [EditorSequence("Design", 104)]
  124. public double Width { get; set; }
  125. [EditorSequence("Design", 105)]
  126. public double Length { get; set; }
  127. [EditorSequence("Manufacturing", 200)]
  128. public ManufacturingTemplateLink ManufacturingTemplateLink { get; set; }
  129. [EditorSequence("Manufacturing", 201)]
  130. [TimestampEditor(Editable = Editable.Disabled)]
  131. public DateTime Issued { get; set; }
  132. [EditorSequence("Manufacturing", 202)]
  133. [LoggableProperty]
  134. public bool Priority { get; set; }
  135. [EditorSequence("Manufacturing", 203)]
  136. [LoggableProperty]
  137. public bool Distributed { get; set; }
  138. [EditorSequence("Manufacturing", 204)]
  139. [TextBoxEditor(Editable = Editable.Disabled)]
  140. public string Trolleys { get; set; }
  141. [EditorSequence("Manufacturing", 205)]
  142. [TimestampEditor(Editable = Editable.Hidden)]
  143. public DateTime BarcodePrinted { get; set; }
  144. [EditorSequence("Manufacturing", 206)]
  145. [DateTimeEditor(Editable = Editable.Disabled)]
  146. [SecondaryIndex]
  147. public DateTime Completed { get; set; }
  148. [SecondaryIndex]
  149. [TimestampEditor]
  150. [EditorSequence("Manufacturing", 207)]
  151. public DateTime Archived { get; set; } = DateTime.MinValue;
  152. [NullEditor]
  153. [Obsolete("Replaced with Problem", true)]
  154. public string Issues { get; set; }
  155. [EditorSequence("Issues", 1)]
  156. public ManagedProblem Problem { get; set; }
  157. [CheckBoxEditor]
  158. [EditorSequence("Issues", 2)]
  159. [LoggableProperty]
  160. public bool OnHold { get; set; }
  161. public override string ToString()
  162. {
  163. return string.Format("{0} {1}", SetoutLink.Number, Serial);
  164. }
  165. public static void Progress(IEnumerable<ManufacturingPacket> packets, ManufacturingPacketStage[] Stages)
  166. {
  167. //List<ManufacturingPacketStage> updates = new List<ManufacturingPacketStage>();
  168. foreach (var packet in packets.Where(x => !x.StageLink.Equals(CoreUtils.FullGuid)))
  169. {
  170. var stages = Stages.Where(x => x.Parent.ID.Equals(packet.ID));
  171. long sequence = 0;
  172. var stage = stages.FirstOrDefault(x => x.ID.Equals(packet.StageLink.ID));
  173. if (stage != null)
  174. {
  175. stage.Completed = DateTime.Now;
  176. stage.PercentageComplete = 100.0F;
  177. sequence = stage.Sequence;
  178. }
  179. // Update the pointer to the next stage
  180. stage = stages.Where(x => x.Sequence > sequence).FirstOrDefault();
  181. if (stage != null)
  182. {
  183. stage.QualityStatus = QualityStatus.NotChecked;
  184. stage.QualityNotes = "";
  185. stage.Station = 0;
  186. stage.Started = DateTime.MinValue;
  187. stage.Completed = DateTime.MinValue;
  188. stage.PercentageComplete = 0.0F;
  189. packet.StageLink.ID = stage.ID;
  190. packet.StageLink.Synchronise(stage);
  191. }
  192. else
  193. {
  194. packet.StageLink.ID = CoreUtils.FullGuid;
  195. }
  196. packet.Issued = !packet.StageLink.IsValid() ? DateTime.MinValue : packet.Issued.IsEmpty() ? DateTime.Now : packet.Issued;
  197. packet.Completed = packet.StageLink.ID.Equals(CoreUtils.FullGuid)
  198. ? packet.Completed.IsEmpty() ? DateTime.Now : packet.Completed
  199. : DateTime.MinValue;
  200. }
  201. }
  202. public static void Regress(IEnumerable<ManufacturingPacket> pkts, ManufacturingPacketStage[] stgs)
  203. {
  204. foreach(var packet in pkts)
  205. {
  206. var stages = stgs.Where(x => x.Parent.ID.Equals(packet.ID));
  207. var sequence = long.MaxValue;
  208. var stage = stages.FirstOrDefault(x => x.ID.Equals(packet.StageLink.ID));
  209. if (stage != null)
  210. {
  211. stage.Completed = DateTime.MinValue;
  212. stage.PercentageComplete = 0.0F;
  213. stage.QualityStatus = QualityStatus.NotChecked;
  214. stage.QualityNotes = "";
  215. sequence = stage.Sequence;
  216. }
  217. // Update the pointer to the previous stage
  218. stage = stages.Where(x => x.Sequence < sequence).LastOrDefault();
  219. if (stage != null)
  220. {
  221. stage.QualityStatus = QualityStatus.NotChecked;
  222. stage.QualityNotes = "";
  223. stage.Station = 0;
  224. stage.Started = DateTime.MinValue;
  225. stage.Completed = DateTime.MinValue;
  226. stage.PercentageComplete = 0.0F;
  227. }
  228. packet.StageLink.ID = stage == null ? Guid.Empty : stage.ID;
  229. packet.Issued = !packet.StageLink.IsValid() ? DateTime.MinValue : packet.Issued.IsEmpty() ? DateTime.Now : packet.Issued;
  230. packet.DueDate = packet.Issued.IsEmpty() ? DateTime.MinValue : packet.DueDate;
  231. packet.Completed = packet.StageLink.ID.Equals(CoreUtils.FullGuid)
  232. ? packet.Completed.IsEmpty() ? DateTime.Now : packet.Completed
  233. : DateTime.MinValue;
  234. }
  235. }
  236. #region Aggregates
  237. [EditorSequence(300)]
  238. [DoubleEditor(Editable = Editable.Hidden)]
  239. [Formula(typeof(ManufacturingPacketArea))]
  240. public double Area { get; set; }
  241. [EditorSequence(301)]
  242. [DoubleEditor(Editable = Editable.Hidden)]
  243. [Formula(typeof(ManufacturingPacketVolume))]
  244. public double Volume { get; set; }
  245. [EditorSequence(302)]
  246. [Aggregate(typeof(ManufacturingPacketTime))]
  247. public TimeSpan Time { get; set; }
  248. [EditorSequence(303)]
  249. [Aggregate(typeof(ManufacturingPacketTimeRemaining))]
  250. public TimeSpan TimeRemaining { get; set; }
  251. [EditorSequence(304)]
  252. [Aggregate(typeof(ManufacturingPacketActualTime))]
  253. public TimeSpan ActualTime { get; set; }
  254. #endregion
  255. #region Internal / NullEditor Properties
  256. private class ManufacturingPacketStageLookup : LookupDefinitionGenerator<ManufacturingPacketStage, ManufacturingPacket>
  257. {
  258. public override Filter<ManufacturingPacketStage>? DefineFilter(ManufacturingPacket[] items)
  259. {
  260. if (items.Any())
  261. return new Filter<ManufacturingPacketStage>(x => x.Parent.ID).IsEqualTo(items.First().ID);
  262. return null;
  263. }
  264. public override Columns<ManufacturingPacket> DefineFilterColumns()
  265. => Columns.None<ManufacturingPacket>().Add(x => x.ID);
  266. }
  267. [LookupDefinition(typeof(ManufacturingPacketStageLookup))]
  268. [NullEditor]
  269. public ManufacturingPacketStageLink StageLink { get; set; }
  270. [NullEditor]
  271. public QAFormLink QAForm { get; set; }
  272. // I think ITPs will end up being linked to a stage,
  273. // So this might get obsoleted at some point
  274. private class JobStageLookup : LookupDefinitionGenerator<JobStage, ManufacturingPacket>
  275. {
  276. public override Filter<JobStage> DefineFilter(ManufacturingPacket[] items)
  277. {
  278. if (items.Length == 1)
  279. return new Filter<JobStage>(x => x.Job.ID).IsEqualTo(items.First().SetoutLink.JobLink.ID).And(x => x.IsHeader).IsEqualTo(false);
  280. return new Filter<JobStage>(x => x.ID).IsEqualTo(Guid.Empty);
  281. }
  282. public override Columns<ManufacturingPacket> DefineFilterColumns()
  283. => Columns.None<ManufacturingPacket>().Add(x => x.SetoutLink.JobLink.ID);
  284. }
  285. [LookupDefinition(typeof(JobStageLookup))]
  286. [NullEditor]
  287. public JobStageLink JobStage { get; set; }
  288. [NullEditor]
  289. [EntityRelationship(DeleteAction.SetNull)]
  290. public PurchaseOrderItemLink OrderItem { get; set; }
  291. [NullEditor]
  292. public DateTime EstimatedDate { get; set; }
  293. #endregion
  294. #region Obsolete Properties
  295. // The code of the Linked Manufacturing Template
  296. // Suggested - set to obsolete?
  297. [NullEditor]
  298. [Obsolete("Replaced with ManufacturingTemplateLink.Code", true)]
  299. public string Code { get; set; }
  300. // The Factory to which this packet template belongs
  301. // Suggestion - Set to obsolete?
  302. [NullEditor]
  303. [Obsolete("Replaced with ManufacturingTemplateLink.FactoryLink.ID")]
  304. public string Group { get; set; }
  305. [NullEditor]
  306. [Obsolete("Replaced with BarcodeQty")]
  307. public bool GroupedBarcode { get; set; }
  308. private BarcodeType _barcodetype = BarcodeType.Unspecified;
  309. [NullEditor]
  310. [Obsolete("Replaced with BarcodeQty")]
  311. public BarcodeType BarcodeType
  312. {
  313. get => _barcodetype == BarcodeType.Unspecified ? GroupedBarcode ? BarcodeType.Grouped : BarcodeType.Individual : _barcodetype;
  314. set => _barcodetype = value;
  315. }
  316. // Comes from Setout.Title (Should be Reference)
  317. [NullEditor]
  318. [Obsolete("Replaced with SetoutLink.Reference")]
  319. public string Reference { get; set; }
  320. // Comes from Setout.Location
  321. [NullEditor]
  322. [Obsolete("Replaced with SetoutLink.Description")]
  323. public string Description { get; set; }
  324. [Obsolete("Replaced With ManufacturingTemplateLink")]
  325. [NullEditor]
  326. public Guid ManufacturingItemID { get; set; }
  327. [NullEditor]
  328. [Obsolete("Replaced with ManufacturingPacketLink.Code")]
  329. public string Template { get; set; }
  330. [Obsolete("Replaced With SetoutLink.JobLink")]
  331. [EntityRelationship(DeleteAction.Cascade)]
  332. [NullEditor]
  333. public JobLink JobLink { get; set; }
  334. #endregion
  335. #region Functions
  336. //public void MovePrevious()
  337. //{
  338. // bool bFound = false;
  339. // SetoutStage prev = null;
  340. // foreach (SetoutStage stage in Stages)
  341. // {
  342. // if (bFound)
  343. // {
  344. // stage.Started = DateTime.MinValue;
  345. // stage.Completed = DateTime.MinValue;
  346. // stage.PercentageComplete = 0.0F;
  347. // }
  348. // else if (stage.Completed.IsEmpty())
  349. // {
  350. // stage.Started = DateTime.MinValue;
  351. // stage.Completed = DateTime.MinValue;
  352. // stage.PercentageComplete = 0.0F;
  353. // bFound = true;
  354. // if (prev != null)
  355. // prev.Completed = DateTime.MinValue;
  356. // }
  357. // else
  358. // prev = stage;
  359. // }
  360. // if (prev == null)
  361. // Issued = DateTime.MinValue;
  362. // Completed = DateTime.MinValue;
  363. // Stage = CurrentStage();
  364. //}
  365. //public void MoveNext()
  366. //{
  367. // bool bFound = false;
  368. // bool bComplete = true;
  369. // if (Issued.IsEmpty())
  370. // Issued = DateTime.Now;
  371. // foreach (SetoutStage stage in Stages)
  372. // {
  373. // if (bFound)
  374. // {
  375. // stage.Started = DateTime.MinValue;
  376. // stage.Completed = DateTime.MinValue;
  377. // stage.PercentageComplete = 0.0F;
  378. // bComplete = false;
  379. // }
  380. // else if (stage.Started.IsEmpty())
  381. // {
  382. // //stage.Started = DateTime.Now;
  383. // stage.Completed = DateTime.MinValue;
  384. // stage.PercentageComplete = 0.0F;
  385. // bComplete = false;
  386. // bFound = true;
  387. // }
  388. // else if (stage.Completed.IsEmpty())
  389. // {
  390. // stage.Completed = DateTime.Now;
  391. // stage.PercentageComplete = 100.0F;
  392. // bFound = true;
  393. // }
  394. // }
  395. // //Completed = bComplete ? DateTime.Now : DateTime.MinValue;
  396. // bool bIsComplete = !Stages.Any(x => x.Completed.Equals(DateTime.MinValue));
  397. // if (bIsComplete && Completed.Equals(DateTime.MinValue))
  398. // Completed = DateTime.Now;
  399. // Stage = CurrentStage();
  400. //}
  401. //public Boolean IsComplete()
  402. //{
  403. // if ((!Issued.IsEmpty()) && (Stages != null))
  404. // {
  405. // foreach (SetoutStage stage in Stages)
  406. // {
  407. // if (stage.Completed.IsEmpty())
  408. // return false;
  409. // }
  410. // return true;
  411. // }
  412. // return false;
  413. //}
  414. //public String Status()
  415. //{
  416. // if ((Stages == null) || (!Stages.Any()))
  417. // return "No Template!";
  418. // if (Issued.IsEmpty())
  419. // return "To Be Issued";
  420. // var stage = GetCurrentStage();
  421. // if (stage != null)
  422. // {
  423. // if (!Archived.IsEmpty())
  424. // return "Cancelled";
  425. // else
  426. // return String.Format("{0} ({1:F2}%)", stage.Name, stage.PercentageComplete);
  427. // }
  428. // return "Complete";
  429. //}
  430. //public Guid CurrentStage()
  431. //{
  432. // if (Issued.IsEmpty())
  433. // return Guid.Empty;
  434. // SetoutStage stage = GetCurrentStage();
  435. // if (stage != null)
  436. // return stage.SectionID;
  437. // return CoreUtils.FullGuid;
  438. //}
  439. //public SetoutStage GetCurrentStage()
  440. //{
  441. // if ((!Issued.IsEmpty()) && (Stages != null))
  442. // {
  443. // foreach (SetoutStage stage in Stages)
  444. // {
  445. // if (stage.Completed.IsEmpty())
  446. // return stage;
  447. // }
  448. // }
  449. // return null;
  450. //}
  451. //public void SetStage(Guid id, bool complete = false)
  452. //{
  453. // bool bFound = id == Guid.Empty;
  454. // Issued = (id == Guid.Empty) ? DateTime.MinValue : Issued.IsEmpty() ? DateTime.Now : Issued;
  455. // if (id == CoreUtils.FullGuid)
  456. // {
  457. // foreach (SetoutStage stage in Stages)
  458. // {
  459. // stage.Started = stage.Started.IsEmpty() ? DateTime.Now : stage.Started;
  460. // stage.Completed = stage.Completed.IsEmpty() ? DateTime.Now : stage.Completed;
  461. // stage.PercentageComplete = 100.0F;
  462. // Completed = stage.Completed;
  463. // }
  464. // }
  465. // else
  466. // {
  467. // //Completed = DateTime.MinValue;
  468. // foreach (SetoutStage stage in Stages)
  469. // {
  470. // if (stage.SectionID.Equals(id))
  471. // {
  472. // bFound = true;
  473. // //stage.Started = stage.Started.IsEmpty() ? DateTime.Now : stage.Started;
  474. // stage.Completed = complete ? DateTime.Now : DateTime.MinValue;
  475. // stage.PercentageComplete = stage.Completed.IsEmpty() ? 0.0F : 100.0F;
  476. // }
  477. // else
  478. // {
  479. // if (!bFound)
  480. // {
  481. // // Stages Before this stage - Update Started and Completed if Empty
  482. // if (stage.Started.IsEmpty())
  483. // stage.Started = DateTime.Now;
  484. // if (stage.Completed.IsEmpty())
  485. // stage.Completed = DateTime.Now;
  486. // stage.PercentageComplete = 100.0F;
  487. // }
  488. // else
  489. // {
  490. // // Stages After This Stage - Blank out Started and Completed
  491. // stage.Started = DateTime.MinValue;
  492. // stage.Completed = DateTime.MinValue;
  493. // stage.PercentageComplete = 0.0F;
  494. // }
  495. // }
  496. // }
  497. // }
  498. // bool bIsComplete = !Stages.Any(x => x.Completed.Equals(DateTime.MinValue));
  499. // if (bIsComplete && Completed.Equals(DateTime.MinValue))
  500. // Completed = DateTime.Now;
  501. // Stage = CurrentStage();
  502. //}
  503. #endregion
  504. }
  505. }