|
|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
using Caliburn.Micro;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
@ -10,9 +9,9 @@ namespace Gremlin.MVVM
|
|
|
|
|
{
|
|
|
|
|
private string _quoteType = "ein Analysegerät";
|
|
|
|
|
private string _quotePath;
|
|
|
|
|
private List<LineItemViewModel> _lineItemsVM;
|
|
|
|
|
private ContactViewModel _recipient;
|
|
|
|
|
private ContactViewModel _salesRep;
|
|
|
|
|
private ObservableCollection<LineItemViewModel> _lineItemsVM = new();
|
|
|
|
|
private ContactViewModel _recipient = new();
|
|
|
|
|
private ContactViewModel _salesRep = new();
|
|
|
|
|
private string _quoteNumber;
|
|
|
|
|
private int _warranty = 12;
|
|
|
|
|
private int _validity = 60;
|
|
|
|
|
@ -41,7 +40,7 @@ namespace Gremlin.MVVM
|
|
|
|
|
public bool? UseMailTemplate { get => _useMailTemplate; internal set { _useMailTemplate = value; NotifyOfPropertyChange(() => UseMailTemplate); } }
|
|
|
|
|
public bool? ShowDiscounts { get => _showDiscounts; internal set { _showDiscounts = value; NotifyOfPropertyChange(() => ShowDiscounts); } }
|
|
|
|
|
|
|
|
|
|
public List<LineItemViewModel> LineItemsViewModel { get => _lineItemsVM; internal set { _lineItemsVM = value; NotifyOfPropertyChange(() => LineItemsViewModel); } }
|
|
|
|
|
public ObservableCollection<LineItemViewModel> LineItemsViewModel { get => _lineItemsVM; internal set { _lineItemsVM = value; NotifyOfPropertyChange(() => LineItemsViewModel); } }
|
|
|
|
|
public ContactViewModel Recipient { get => _recipient; internal set { _recipient = value; NotifyOfPropertyChange(() => Recipient); } }
|
|
|
|
|
public ContactViewModel SalesRep { get => _salesRep; internal set { _salesRep = value; NotifyOfPropertyChange(() => SalesRep); } }
|
|
|
|
|
public decimal TotalListprice { get => _totalListprice; internal set { _totalListprice = value; NotifyOfPropertyChange(() => TotalListprice); } }
|
|
|
|
|
@ -137,7 +136,18 @@ namespace Gremlin.MVVM
|
|
|
|
|
public void GenerateQuoteNumber()
|
|
|
|
|
{
|
|
|
|
|
Random random = new();
|
|
|
|
|
QuoteNumber = $"DE-83PE89-{DateTime.Now:My}-{random.Next(999999)}";
|
|
|
|
|
QuoteNumber = SalesRep.LastName switch
|
|
|
|
|
{
|
|
|
|
|
"Woitschetzki" => $"DE-83PE89-{DateTime.Now:My}-{random.Next(999999)}",
|
|
|
|
|
"Welsch" => $"DE-83RE32-{DateTime.Now:My}-{random.Next(999999)}",
|
|
|
|
|
_ => $"DE-XXYYXX-{DateTime.Now:My}-{random.Next(999999)}",
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void ReadLineItems()
|
|
|
|
|
{
|
|
|
|
|
LineItemsViewModel = LineItemViewModel.ReadLineItemsFromClipboard();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|