diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-12-17 14:39:26 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-12-17 14:39:26 +0200 |
| commit | f0f46e7e560cf5e9999e5ba9904634f01176f27e (patch) | |
| tree | 961affaea885d7306faca197a72c20f4811d7b8c /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites | |
| parent | a84ca31290b18ef2a9ec4c197d86573bb13adb03 (diff) | |
| parent | d9ee0b8e11f15c2b3bae068767516bc84a5ca4ed (diff) | |
| download | Tango-f0f46e7e560cf5e9999e5ba9904634f01176f27e.tar.gz Tango-f0f46e7e560cf5e9999e5ba9904634f01176f27e.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs index 92dd8273d..cacda1e8d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Sites/ViewModels/SiteDetailsViewVM.cs @@ -125,6 +125,12 @@ namespace Tango.MachineStudio.Sites.ViewModels using (_notification.PushTaskItem("Saving site details...")) { + //Check if site organization has changed and there are no machines that belongs to this site but different organization. + if (_db.Machines.Any(x => x.SiteGuid == Site.Guid && x.OrganizationGuid != Site.OrganizationGuid)) + { + throw new InvalidOperationException($"One or more machines belongs to this site but not to '{Site.Organization.Name}' organization."); + } + //Remove site rmls. Site.SitesRmls.ToList().Where(x => !Rmls.SynchedSource.ToList().Exists(y => y.Guid == x.RmlGuid)).ToList().ForEach(x => _db.SitesRmls.Remove(x)); Site.SitesCatalogs.ToList().Where(x => !Catalogs.SynchedSource.ToList().Exists(y => y.Guid == x.ColorCatalogGuid)).ToList().ForEach(x => _db.SitesCatalogs.Remove(x)); |
