|
@@ -1,5 +1,6 @@
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
|
+using System.Linq;
|
|
using System.Linq.Expressions;
|
|
using System.Linq.Expressions;
|
|
using InABox.Core;
|
|
using InABox.Core;
|
|
|
|
|
|
@@ -46,11 +47,12 @@ namespace Comal.Classes
|
|
|
|
|
|
[UserTracking(typeof(Quote))]
|
|
[UserTracking(typeof(Quote))]
|
|
public class QuoteCostSheet : Entity, IRemotable, IPersistent, IQuoteCostSheet, ILicense<QuotesManagementLicense>,
|
|
public class QuoteCostSheet : Entity, IRemotable, IPersistent, IQuoteCostSheet, ILicense<QuotesManagementLicense>,
|
|
- IStringAutoIncrement<QuoteCostSheet>,
|
|
|
|
- IDigitalForm<Quote>,
|
|
|
|
- IDigitalFormInstance<QuoteLink>
|
|
|
|
|
|
+ IStringAutoIncrement<QuoteCostSheet>
|
|
{
|
|
{
|
|
|
|
|
|
|
|
+ [NullEditor]
|
|
|
|
+ public long Sequence { get; set; }
|
|
|
|
+
|
|
#region IAutoIncrement
|
|
#region IAutoIncrement
|
|
|
|
|
|
public Expression<Func<QuoteCostSheet, String>> AutoIncrementField() => x => x.Number;
|
|
public Expression<Func<QuoteCostSheet, String>> AutoIncrementField() => x => x.Number;
|
|
@@ -66,13 +68,34 @@ namespace Comal.Classes
|
|
[NullEditor]
|
|
[NullEditor]
|
|
[Obsolete("Replaced with Parent")]
|
|
[Obsolete("Replaced with Parent")]
|
|
[EntityRelationship(DeleteAction.Cascade)]
|
|
[EntityRelationship(DeleteAction.Cascade)]
|
|
- public QuoteLink Quote
|
|
|
|
|
|
+ public QuoteLink Quote { get; set; }
|
|
|
|
+
|
|
|
|
+ [CodeEditor]
|
|
|
|
+ [EditorSequence(1)]
|
|
|
|
+ public string Number { get; set; }
|
|
|
|
+
|
|
|
|
+ [TextBoxEditor(Visible = Visible.Default)]
|
|
|
|
+ [EditorSequence(2)]
|
|
|
|
+ public string Description { get; set; }
|
|
|
|
+
|
|
|
|
+ private class QuoteCostSheetFormLookup : LookupDefinitionGenerator<QuoteForm, QuoteCostSheet>
|
|
{
|
|
{
|
|
- get => Parent;
|
|
|
|
- set => Parent = value;
|
|
|
|
- }
|
|
|
|
|
|
+ public override Filter<QuoteForm> DefineFilter(QuoteCostSheet[] items)
|
|
|
|
+ {
|
|
|
|
+ if (items?.Any() != true)
|
|
|
|
+ return LookupFactory.DefineFilter<QuoteForm>();
|
|
|
|
+ return new Filter<QuoteForm>(x => x.Parent.ID).IsEqualTo(items.First().Quote.ID);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public override Columns<QuoteCostSheet> DefineFilterColumns()
|
|
|
|
+ => new Columns<QuoteCostSheet>(ColumnTypeFlags.Required);
|
|
|
|
+ }
|
|
|
|
+ [LookupDefinition(typeof(QuoteCostSheetFormLookup))]
|
|
|
|
+ [EditorSequence(3)]
|
|
|
|
+ public QuoteFormLink Form { get; set; }
|
|
|
|
+
|
|
[EntityRelationship(DeleteAction.SetNull)]
|
|
[EntityRelationship(DeleteAction.SetNull)]
|
|
|
|
+ [EditorSequence(4)]
|
|
public CostSheetLink CostSheet { get; set; }
|
|
public CostSheetLink CostSheet { get; set; }
|
|
|
|
|
|
[CurrencyEditor(Visible = Visible.Default, Editable = Editable.Hidden, Summary = Summary.Sum)]
|
|
[CurrencyEditor(Visible = Visible.Default, Editable = Editable.Hidden, Summary = Summary.Sum)]
|
|
@@ -86,80 +109,6 @@ namespace Comal.Classes
|
|
[CurrencyEditor(Visible = Visible.Optional, Editable = Editable.Hidden, Summary = Summary.Sum)]
|
|
[CurrencyEditor(Visible = Visible.Optional, Editable = Editable.Hidden, Summary = Summary.Sum)]
|
|
[Aggregate(typeof(QuoteCostSheetIncTax))]
|
|
[Aggregate(typeof(QuoteCostSheetIncTax))]
|
|
public double IncTax { get; set; }
|
|
public double IncTax { get; set; }
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- [TextBoxEditor(Visible = Visible.Default)]
|
|
|
|
- public string Description { get; set; }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public long Sequence { get; set; }
|
|
|
|
-
|
|
|
|
- #region DigitalFormInstance stuff
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public QAFormLink QAForm { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public string QAData { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public string Number { get; set; }
|
|
|
|
|
|
|
|
- [NullEditor]
|
|
|
|
- public string FormData { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public string? BlobData { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public DateTime QACompleted { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public UserLink QACompletedBy { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public UserLink FormCompletedBy { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public Location Location { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public QuoteLink Parent { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public DigitalFormLink Form { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public DateTime FormStarted { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public TimeSpan FormOpen { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public DateTime FormCompleted { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public DateTime FormProcessed { get; set; }
|
|
|
|
-
|
|
|
|
- [NullEditor]
|
|
|
|
- public DateTime FormCancelled { get; set; }
|
|
|
|
-
|
|
|
|
- public Guid ParentID() => Quote.ID;
|
|
|
|
-
|
|
|
|
- public Type ParentType() => typeof(Quote);
|
|
|
|
-
|
|
|
|
- public IDigitalFormDataModel CreateDataModel(Entity? parent = null)
|
|
|
|
- {
|
|
|
|
- var t = typeof(DigitalFormDataModel<,,>).MakeGenericType(typeof(Quote), typeof(QuoteLink), GetType());
|
|
|
|
- if (parent != null)
|
|
|
|
- return (Activator.CreateInstance(t, parent, this) as IDigitalFormDataModel)!;
|
|
|
|
- return (Activator.CreateInstance(t, Parent.ID, ID) as IDigitalFormDataModel)!;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- # endregion
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|