optimize CreateQuote

pull/1/head
Sascha Woitschetzki 2022-03-19 15:51:40 +07:00
parent 0696e337ee
commit 3ea1a98c4e
2 changed files with 20 additions and 23 deletions

@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/Gremlin/bin/Debug/net5.0-windows/Gremlin.dll",
"program": "${workspaceFolder}/Gremlin/bin/Debug/net6.0-windows/Gremlin.dll",
"args": [],
"cwd": "${workspaceFolder}/Gremlin",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console

@ -36,7 +36,7 @@ namespace Gremlin.MVVM
private decimal totalVAT;
private decimal totalGross;
public LineItemViewModel SelectedLineItemVM { get => selectedLineItemVM; set { selectedLineItemVM = value; NotifyOfPropertyChange(() => SelectedLineItemVM); } }
public LineItemViewModel SelectedLineItemVM { get => selectedLineItemVM; set { selectedLineItemVM = value; NotifyOfPropertyChange(() => SelectedLineItemVM); } }
public ObservableCollection<LineItemViewModel> LineItemsVM { get => lineItemsVM; set { lineItemsVM = value; NotifyOfPropertyChange(() => LineItemsVM); } }
public ContactViewModel Recipient { get => recipient; set { recipient = value; NotifyOfPropertyChange(() => Recipient); } }
public ContactViewModel SalesRep { get => salesRep; set { salesRep = value; NotifyOfPropertyChange(() => SalesRep); } }
@ -97,29 +97,26 @@ namespace Gremlin.MVVM
};
}
private QuoteViewModel(string quoteNumber, string quoteType, ContactViewModel recipient, ContactViewModel salesRep, bool? brutto, decimal vAT, int warranty, int validity, string quotePath, bool? singlePrices, bool? brochures, bool? dataSheets, bool? mailTemplate, bool? showDiscounts, decimal totalListprice)
{
QuoteNumber = quoteNumber;
QuoteType = quoteType;
Recipient = recipient;
SalesRep = salesRep;
ShowBrutto = brutto;
VAT = vAT;
Warranty = warranty;
Validity = validity;
QuotePath = quotePath;
SinglePrices = singlePrices;
AttachBrochures = brochures;
AttachDataSheets = dataSheets;
UseMailTemplate = mailTemplate;
ShowDiscounts = showDiscounts;
TotalListprice = totalListprice;
}
internal static QuoteViewModel CreateQuote(string quoteNumber, ContactViewModel recipient, ContactViewModel salesRep, decimal vAT = 19, string quoteType = "ein Analysegerät", bool? brutto = true, int warranty = 12, bool? singlePrices = true, bool? brochures = true, bool? dataSheets = true, bool? mailTemplate = true, string quotePath = "", int validity = 60, bool? showDiscounts = true, decimal totalListprice = 0)
{
QuoteViewModel quoteVM = new(quoteNumber, quoteType, recipient, salesRep, brutto, vAT, warranty, validity, quotePath, singlePrices, brochures, dataSheets, mailTemplate, showDiscounts, totalListprice);
quoteVM.LineItemsVM = new();
QuoteViewModel quoteVM = new()
{
QuoteNumber = quoteNumber,
QuoteType = quoteType,
Recipient = recipient,
SalesRep = salesRep,
ShowBrutto = brutto,
VAT = vAT,
Warranty = warranty,
Validity = validity,
QuotePath = quotePath,
SinglePrices = singlePrices,
AttachBrochures = brochures,
AttachDataSheets = dataSheets,
UseMailTemplate = mailTemplate,
ShowDiscounts = showDiscounts,
TotalListprice = totalListprice,
};
ObservableCollection<LineItemViewModel> lineItemsVM = LineItemViewModel.ReadLineItemsFromClipboard();