FurnitureFactoryDataBaseImplement Implements fix
This commit is contained in:
parent
a0c8eb42c8
commit
ec8998be3c
@ -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<ReportInterestLessonViewModel> InterestLessons { get; set; } = new();
|
||||
}
|
||||
}
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user