aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
index 042272960..f0cf87079 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
@@ -486,6 +486,22 @@ namespace Tango.PPC.Jobs.ViewModels
{
LogManager.Log("Saving job...");
+ if (!String.IsNullOrWhiteSpace(CustomersFilter))
+ {
+ if (!Customers.Exists(x => x.Name == CustomersFilter))
+ {
+ var newCustomer = new Customer()
+ {
+ OrganizationGuid = MachineProvider.Machine.OrganizationGuid,
+ Name = CustomersFilter,
+ };
+
+ _db.Customers.Add(newCustomer);
+
+ Job.Customer = newCustomer;
+ }
+ }
+
await _db.SaveChangesAsync();
RaiseMessage(new JobSavedMessage() { Job = Job });