Вроде как сделали отчеты
This commit is contained in:
parent
cfbf6479e5
commit
606f8775ed
@ -1,16 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarCenterContracts.BindingModels
|
||||
{
|
||||
public class ReportBindingModel
|
||||
{
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
public DateTime? DateFrom { get; set; }
|
||||
public DateTime? DateTo { get; set; }
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
using CarCenterContracts.BindingModels;
|
||||
using CarCenterContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarCenterContracts.BusinessLogicsContracts
|
||||
{
|
||||
public interface IReportLogic
|
||||
{
|
||||
|
||||
List<ReportBundlingViewModel> GetBundligs(ReportBindingModel model);
|
||||
List<ReportCarViewModel> GetCars(ReportBindingModel model);
|
||||
List<ReportOrderViewModel> GetOrders(ReportBindingModel model);
|
||||
List<ReportPresaleViewModel> GetPresales(ReportBindingModel model);
|
||||
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using CarCenterDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -9,7 +10,8 @@ namespace CarCenterContracts.ViewModels
|
||||
public class ReportBundlingViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public List<(string, int)> Orders { get; set; } = new();
|
||||
public List<(string, int)> Features { get; set; } = new();
|
||||
//Пока не ясно что конкретно передавать в отчет, поэтому передается моделька
|
||||
public List<IOrderModel> Orders { get; set; } = new();
|
||||
public List<IFeatureModel> Features { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using CarCenterDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -9,6 +10,7 @@ namespace CarCenterContracts.ViewModels
|
||||
public class ReportCarViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public List<(string, int)> Presales { get; set; } = new();
|
||||
//Пока не ясно что конкретно передавать в отчет, поэтому передается моделька
|
||||
public List<IPresaleModel> Presales { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using CarCenterDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -9,7 +10,8 @@ namespace CarCenterContracts.ViewModels
|
||||
public class ReportOrderViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public List<(string, int)> Bundlings { get; set; } = new();
|
||||
public List<(string, int)> Requests { get; set; } = new();
|
||||
//Пока не ясно что конкретно передавать в отчет, поэтому передается моделька
|
||||
public List<IBundlingModel> Bundlings { get; set; } = new();
|
||||
public List<IRequestModel> Requests { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using CarCenterDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -9,6 +10,7 @@ namespace CarCenterContracts.ViewModels
|
||||
public class ReportPresaleViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public List<(string, int)> Cars { get; set; } = new();
|
||||
//Пока не ясно что конкретно передавать в отчет, поэтому передается моделька
|
||||
public List<ICarModel> Cars { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ namespace CarCenterDatabaseImplement.Implements
|
||||
using var context = new CarCenterDatabase();
|
||||
if (model.DateFrom.HasValue && model.DateTo.HasValue) // Для отчета списка
|
||||
{
|
||||
//будет применятся в ReportLogic
|
||||
return context.Cars
|
||||
.Include(x => x.Bundlings)
|
||||
.ThenInclude(x => x.Bundling)
|
||||
|
@ -57,6 +57,7 @@ namespace CarCenterDatabaseImplement.Implements
|
||||
|
||||
if (model.DateFrom.HasValue && model.DateTo.HasValue) //для списка Сагиров
|
||||
{
|
||||
//будет применятся в ReportLogic
|
||||
return context.Orders
|
||||
.Include(x => x.Worker)
|
||||
.Include(x => x.Cars)
|
||||
@ -73,6 +74,7 @@ namespace CarCenterDatabaseImplement.Implements
|
||||
}
|
||||
else if (model.Presales.Count > 0) //для отчета Сагиров
|
||||
{
|
||||
//будет применятся в ReportLogic
|
||||
return context.Orders
|
||||
.Include(x => x.Worker)
|
||||
.Include(x => x.Cars)
|
||||
@ -84,6 +86,7 @@ namespace CarCenterDatabaseImplement.Implements
|
||||
}
|
||||
else if (model.Cars.Count > 0) //для отчета Малафеев
|
||||
{
|
||||
//будет применятся в ReportLogic
|
||||
return context.Orders
|
||||
.Include(x => x.Worker)
|
||||
.Include(x => x.Cars)
|
||||
|
Loading…
x
Reference in New Issue
Block a user