diff options
| author | Roy <Roy.mail.net@gmail.com> | 2023-05-02 17:24:55 +0300 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2023-05-02 17:24:55 +0300 |
| commit | a42e9713125bc9675b2978031244918c11c6e956 (patch) | |
| tree | 1cc11cd6bdd284e1884b3c4d420bd6a0fb3d865a /Software/Visual_Studio/Tango.BL | |
| parent | bcec28b0d2d80d26513b0415519f26d83f25c51c (diff) | |
| download | Tango-a42e9713125bc9675b2978031244918c11c6e956.tar.gz Tango-a42e9713125bc9675b2978031244918c11c6e956.zip | |
Eureka Added more baud rates + some bug fixes.
Diffstat (limited to 'Software/Visual_Studio/Tango.BL')
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/Entities/Machine.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.BL/Entities/Machine.cs b/Software/Visual_Studio/Tango.BL/Entities/Machine.cs index 4e998bdc9..01e17cfde 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Machine.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Machine.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations.Schema; +using System.Data.Entity; using System.Linq; using System.Reflection; using System.Text; @@ -176,5 +177,24 @@ namespace Tango.BL.Entities { } + + public async Task<ObservableCollection<SpoolType>> GetSiteSpoolTypes(ObservablesContext db) + { + ObservableCollection<SpoolType> spoolTypes = new ObservableCollection<SpoolType>(); + + spoolTypes = (await db.SitesSpoolTypes.Where(x => x.SiteGuid == SiteGuid).Include(x => x.SpoolType).Select(x => x.SpoolType).ToListAsync()).OrderBy(x => x.LastUpdated).ToObservableCollection(); + + if (spoolTypes.Count == 0) + { + spoolTypes = new ObservableCollection<SpoolType>(); + var standardSpool = await db.SpoolTypes.FirstOrDefaultAsync(x => x.Code == (int)BL.Enumerations.SpoolTypes.StandardSpool); + if (standardSpool != null) + { + spoolTypes.Add(standardSpool); + } + } + + return spoolTypes; + } } } |
