WIP estimate
This commit is contained in:
parent
3b57246f80
commit
805e5fcb4f
8 changed files with 42 additions and 17 deletions
|
|
@ -10,6 +10,7 @@ namespace BookAStar.ViewModels.EstimateAndBilling
|
|||
using Model;
|
||||
using Model.Social;
|
||||
using Model.Workflow;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
|
||||
class BookQueryViewModel : ViewModel, IBookQueryData
|
||||
|
|
@ -26,6 +27,10 @@ namespace BookAStar.ViewModels.EstimateAndBilling
|
|||
EventDate = data.EventDate;
|
||||
Previsionnal = data.Previsionnal;
|
||||
Id = data.Id;
|
||||
estimates = new ObservableCollection<Estimate>(
|
||||
DataManager.Current.Estimates.Where(
|
||||
e => e.Query.Id == Id
|
||||
));
|
||||
this.data = data;
|
||||
}
|
||||
private BookQueryData data;
|
||||
|
|
@ -47,19 +52,17 @@ namespace BookAStar.ViewModels.EstimateAndBilling
|
|||
return DataManager.Current.EstimationCache.LocalGet(this.Id);
|
||||
}
|
||||
}
|
||||
public Estimate Estimate { get
|
||||
{
|
||||
return DataManager.Current.Estimates.FirstOrDefault(
|
||||
e=>e.Query.Id == Id
|
||||
);
|
||||
private ObservableCollection<Estimate> estimates;
|
||||
public ObservableCollection<Estimate> Estimates {
|
||||
get {
|
||||
return estimates;
|
||||
} }
|
||||
|
||||
|
||||
public bool EstimationDone
|
||||
{
|
||||
get
|
||||
{
|
||||
return Estimate != null;
|
||||
return Estimates != null && Estimates.Count>0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,10 +32,11 @@ namespace BookAStar.ViewModels.EstimateAndBilling
|
|||
{
|
||||
Data.Bill = new List<BillingLine>( Bill );
|
||||
NotifyPropertyChanged("FormattedTotal");
|
||||
NotifyPropertyChanged("Bill");
|
||||
}
|
||||
private Estimate data;
|
||||
public Estimate Data { get { return data; } set {
|
||||
data = value;
|
||||
SetProperty<Estimate>(ref data, value);
|
||||
if (data.AttachedFiles == null) data.AttachedFiles = new List<string>();
|
||||
if (data.AttachedGraphics == null) data.AttachedGraphics = new List<string>();
|
||||
if (data.Bill == null) data.Bill = new List<BillingLine>();
|
||||
|
|
@ -43,6 +44,11 @@ namespace BookAStar.ViewModels.EstimateAndBilling
|
|||
AttachedGraphicList = new ObservableCollection<string>(data.AttachedGraphics);
|
||||
Bill = new ObservableCollection<BillingLine>(data.Bill);
|
||||
Bill.CollectionChanged += Bill_CollectionChanged;
|
||||
Title = Data.Title;
|
||||
Description = Data.Description;
|
||||
NotifyPropertyChanged("FormattedTotal");
|
||||
NotifyPropertyChanged("Query");
|
||||
NotifyPropertyChanged("CLient");
|
||||
} }
|
||||
|
||||
[JsonIgnore]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue