From e84d6598bdf6f6e102fcee7e19ffee76ec9de7ea Mon Sep 17 00:00:00 2001 From: schereralf <31801379+schereralf@users.noreply.github.com> Date: Sat, 6 Jul 2024 21:48:47 +0200 Subject: [PATCH] ResinPrinters Added option to manually define jobs for scheduling resin printers. --- DispoAdmin/ViewModels/MainWindowViewModel.cs | 2 -- DispoAdmin/ViewModels/OrderWindowViewModel.cs | 5 ++++- DispoAdmin/Views/DispoWindow.xaml.cs | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/DispoAdmin/ViewModels/MainWindowViewModel.cs b/DispoAdmin/ViewModels/MainWindowViewModel.cs index e599fa2..782bf2f 100644 --- a/DispoAdmin/ViewModels/MainWindowViewModel.cs +++ b/DispoAdmin/ViewModels/MainWindowViewModel.cs @@ -339,8 +339,6 @@ public void AddOrder() public void RemoveOrder() { - foreach (PrintJob p in SelectedOrder.PrintJobs) { SelectedOrder.PrintJobs.Remove(p); } - ListOrders.Remove(SelectedOrder); } diff --git a/DispoAdmin/ViewModels/OrderWindowViewModel.cs b/DispoAdmin/ViewModels/OrderWindowViewModel.cs index ac210e8..a0c6e82 100644 --- a/DispoAdmin/ViewModels/OrderWindowViewModel.cs +++ b/DispoAdmin/ViewModels/OrderWindowViewModel.cs @@ -103,8 +103,11 @@ orderby printJob.JobName PrinterID = printJob.PrinterType }; + Printer printJobPrinter = new(); Material printJobMaterial = Materials.FirstOrDefault(m => m.MaterialName.Trim() == printJob.Material.Trim()); - Printer printJobPrinter = Printers.FirstOrDefault(p => p.PrinterID == printJob.PrinterType); + + if (printJob.Material=="UV Resin") printJobPrinter= Printers.FirstOrDefault(p => p.PrinterType == "Resin Printer"); + else printJobPrinter = Printers.FirstOrDefault(p => p.PrinterID == printJob.PrinterType); //The economic calculations are very rudimentary. We assume: // - the amortization period for all printers is provided by the operator, as is the IRR diff --git a/DispoAdmin/Views/DispoWindow.xaml.cs b/DispoAdmin/Views/DispoWindow.xaml.cs index e9dcb18..2ccf4f6 100644 --- a/DispoAdmin/Views/DispoWindow.xaml.cs +++ b/DispoAdmin/Views/DispoWindow.xaml.cs @@ -1,4 +1,5 @@ -using System; + +using System; using System.Collections.Generic; using System.Linq; using System.Windows; @@ -12,8 +13,7 @@ namespace DispoAdmin.Views { - // Interaction logic für DispoWindow.xaml - + // Interaction logic für DispoWindow.xaml. Sorry, but this bit cannot go in a Viewmodel :) public partial class DispoWindow : Window { public int ScheduleWeek;