diff --git a/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelInfoManager.cs b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelInfoManager.cs new file mode 100644 index 0000000..9406da1 --- /dev/null +++ b/FurnitureFactory/FurnitureFactoryBusinessLogic/OfficePackage/HelperModels/ExcelInfoManager.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FurnitureContracts.ViewModel; + +namespace FurnitureFactoryBusinessLogic.OfficePackage.HelperModels +{ + internal class ExcelInfoManager + { + public string FileName { get; set; } = string.Empty; + + public string Title { get; set; } = string.Empty; + + public List InterestLessons { get; set; } = new(); + } +} diff --git a/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/HeadsetStorage.cs b/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/HeadsetStorage.cs index 8c52892..f2e5fcd 100644 --- a/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/HeadsetStorage.cs +++ b/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/HeadsetStorage.cs @@ -9,7 +9,7 @@ using FurnitureContracts.BindingModels; using FurnitureContracts.ViewModel; using FurnitureContracts.SearchModels; using FurnitureContracts.StoragesContracts; -using FurnitureFactoryDataBaseImplements.Models; +using FurnitureFactoryDataBaseImplement.Models; using FurnitureFactoryDataBaseImplement; namespace FurnitureFactoryDataBaseImplements.Implements diff --git a/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/ManagerStorage.cs b/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/ManagerStorage.cs index 519f503..0e9ff6f 100644 --- a/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/ManagerStorage.cs +++ b/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/ManagerStorage.cs @@ -3,7 +3,7 @@ using FurnitureContracts.BindingModels; using FurnitureContracts.SearchModels; using FurnitureContracts.StoragesContracts; using FurnitureContracts.ViewModel; -using FurnitureFactoryDataBaseImplements.Models; +using FurnitureFactoryDataBaseImplement.Models; using System; using System.Collections.Generic; using System.Linq; @@ -51,7 +51,7 @@ namespace FurnitureFactoryDataBaseImplements.Implements } using var context = new FurnitureDataBase(); return context.Managers - .Where(x => x.Name.Contains(model.UserName)) + .Where(x => x.UserName.Contains(model.UserName)) .ToList() .Select(x => x.GetViewModel) .ToList(); diff --git a/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/OrderStorage.cs b/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/OrderStorage.cs index 7876b15..25d453e 100644 --- a/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/OrderStorage.cs +++ b/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/OrderStorage.cs @@ -3,7 +3,7 @@ using FurnitureContracts.BindingModels; using FurnitureContracts.SearchModels; using FurnitureContracts.StoragesContracts; using FurnitureContracts.ViewModel; -using FurnitureFactoryDataBaseImplements.Models; +using FurnitureFactoryDataBaseImplement.Models; using System; using System.Collections.Generic; using System.Linq; @@ -21,7 +21,7 @@ namespace FurnitureFactoryDataBaseImplements.Implements using var context = new FurnitureDataBase(); return context.Orders .Include(x => x.SalesSalons) - .ThenInclude(x => x.SalesSalon) + .ThenInclude(x => x.SalesSalons) .ToList() .Select(x => x.GetViewModel) .ToList(); @@ -38,7 +38,7 @@ namespace FurnitureFactoryDataBaseImplements.Implements { return context.Orders .Include(x => x.SalesSalons) - .ThenInclude(x => x.SalesSalon) + .ThenInclude(x => x.SalesSalons) .Where(x => x.Date >= model.DateFrom && x.Date <= model.DateTo && x.ManagerId == model.ManagerId) .ToList() .Select(x => x.GetViewModel) @@ -46,7 +46,7 @@ namespace FurnitureFactoryDataBaseImplements.Implements } return context.Orders .Include(x => x.SalesSalons) - .ThenInclude(x => x.SalesSalon) + .ThenInclude(x => x.SalesSalons) .Where(x => x.ManagerId == model.ManagerId) .ToList() .Select(x => x.GetViewModel) @@ -63,7 +63,7 @@ namespace FurnitureFactoryDataBaseImplements.Implements using var context = new FurnitureDataBase(); return context.Orders .Include(x => x.SalesSalons) - .ThenInclude(x => x.SalesSalon) + .ThenInclude(x => x.SalesSalons) .FirstOrDefault(x => ((!string.IsNullOrEmpty(model.Title) && x.Title == model.Title) || (model.Id.HasValue && x.Id == model.Id)) && x.ManagerId == model.ManagerId) ?.GetViewModel; @@ -72,7 +72,7 @@ namespace FurnitureFactoryDataBaseImplements.Implements public OrdersViewModel? Insert(OrdersBindingModel model) { using var context = new FurnitureDataBase(); - var newOrder = Order.Create(context, model); + var newOrder = Orders.Create(context, model); if (newOrder == null) { return null; @@ -114,7 +114,7 @@ namespace FurnitureFactoryDataBaseImplements.Implements .FirstOrDefault(rec => rec.Id == model.Id); if (element != null) { - context.SalesSalons.Remove(element); + context.Orders.Remove(element); context.SaveChanges(); return element.GetViewModel; } diff --git a/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/SalesSalonStorage.cs b/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/SalesSalonStorage.cs index eaa7954..fca3da8 100644 --- a/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/SalesSalonStorage.cs +++ b/FurnitureFactory/FurnitureFactoryDataBaseImplement/Implements/SalesSalonStorage.cs @@ -3,7 +3,7 @@ using FurnitureContracts.SearchModels; using FurnitureContracts.StoragesContracts; using FurnitureContracts.ViewModel; using FurnitureFactoryDataBaseImplement; -using FurnitureFactoryDataBaseImplements.Models; +using FurnitureFactoryDataBaseImplement.Models; using System; using System.Collections.Generic; using System.ComponentModel;