add views
This commit is contained in:
parent
1f8d65b6a1
commit
cdff9cd481
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using CarShowroomDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -6,7 +7,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace CarShowroomContracts.AbstractModels
|
||||
{
|
||||
internal interface ISale
|
||||
internal interface ISale : IId
|
||||
{
|
||||
DateTime SaleTime { get; }
|
||||
int Cost { get; }
|
||||
|
30
CarShowroom/CarShowroomDataModels/Dtos/SaleDto.cs
Normal file
30
CarShowroom/CarShowroomDataModels/Dtos/SaleDto.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using CarShowroomContracts.AbstractModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarShowroomDataModels.Dtos
|
||||
{
|
||||
internal class SaleDto : ISale
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime SaleTime { get; set; }
|
||||
public int Cost { get; set; }
|
||||
public int ClientId { get; set; }
|
||||
public int EmployeeId { get; set; }
|
||||
public List<int> CarIds { get; set; } = new();
|
||||
public List<int> ServiseIds { get; set; } = new();
|
||||
public SaleDto(ISale model)
|
||||
{
|
||||
Id = model.Id;
|
||||
SaleTime = model.SaleTime;
|
||||
Cost = model.Cost;
|
||||
ClientId = model.ClientId;
|
||||
EmployeeId = model.EmployeeId;
|
||||
CarIds = model.CarIds;
|
||||
ServiseIds = model.ServiseIds;
|
||||
}
|
||||
}
|
||||
}
|
32
CarShowroom/CarShowroomDataModels/Views/CarView.cs
Normal file
32
CarShowroom/CarShowroomDataModels/Views/CarView.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using CarShowroomContracts.AbstractModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarShowroomContracts.Dtos
|
||||
{
|
||||
public class CarView : ICar
|
||||
{
|
||||
[DisplayName("Номер машины")]
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Цвет")]
|
||||
public string Color { get; set; }
|
||||
[DisplayName("Дата производства")]
|
||||
public DateTime RealiseDate { get; set; }
|
||||
public int ModelId { get; set; }
|
||||
[DisplayName("Модель")]
|
||||
public string ModelName { get; set; } = string.Empty;
|
||||
[DisplayName("Марка")]
|
||||
public string MakeName { get; set; } = string.Empty;
|
||||
public CarView(ICar model)
|
||||
{
|
||||
Id = model.Id;
|
||||
Color = model.Color;
|
||||
RealiseDate = model.RealiseDate;
|
||||
ModelId = model.ModelId;
|
||||
}
|
||||
}
|
||||
}
|
28
CarShowroom/CarShowroomDataModels/Views/ClientView.cs
Normal file
28
CarShowroom/CarShowroomDataModels/Views/ClientView.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using CarShowroomDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarShowroomContracts.Dtos
|
||||
{
|
||||
public class ClientView : IClient
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("ФИО")]
|
||||
public string Name { get; set; }
|
||||
[DisplayName("Email")]
|
||||
public string Email { get; set; }
|
||||
[DisplayName("Пароль")]
|
||||
public string Password { get; set; }
|
||||
public ClientView(IClient model)
|
||||
{
|
||||
Id = model.Id;
|
||||
Name = model.Name;
|
||||
Email = model.Email;
|
||||
Password = model.Password;
|
||||
}
|
||||
}
|
||||
}
|
28
CarShowroom/CarShowroomDataModels/Views/EmployeeView.cs
Normal file
28
CarShowroom/CarShowroomDataModels/Views/EmployeeView.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using CarShowroomDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarShowroomContracts.Dtos
|
||||
{
|
||||
public class EmployeeView : IEmployee
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("ФИО")]
|
||||
public string Name { get; set; }
|
||||
[DisplayName("Email")]
|
||||
public string Email { get; set; }
|
||||
[DisplayName("Пароль")]
|
||||
public string Password { get; set; }
|
||||
public EmployeeView(IEmployee model)
|
||||
{
|
||||
Id = model.Id;
|
||||
Name = model.Name;
|
||||
Email = model.Email;
|
||||
Password = model.Password;
|
||||
}
|
||||
}
|
||||
}
|
22
CarShowroom/CarShowroomDataModels/Views/MakeView.cs
Normal file
22
CarShowroom/CarShowroomDataModels/Views/MakeView.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using CarShowroomContracts.AbstractModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarShowroomContracts.Dtos
|
||||
{
|
||||
public class MakeView : IMake
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Название марки")]
|
||||
public string Name { get; set; }
|
||||
public MakeView(IMake model)
|
||||
{
|
||||
Id = model.Id;
|
||||
Name = model.Name;
|
||||
}
|
||||
}
|
||||
}
|
29
CarShowroom/CarShowroomDataModels/Views/ModelView.cs
Normal file
29
CarShowroom/CarShowroomDataModels/Views/ModelView.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using CarShowroomContracts.AbstractModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarShowroomContracts.Dtos
|
||||
{
|
||||
public class ModelView : IModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Модель")]
|
||||
public string Name { get; set; }
|
||||
[DisplayName("Цена")]
|
||||
public int Price { get; set; }
|
||||
public int MakeId { get; set; }
|
||||
[DisplayName("Марка")]
|
||||
public string MakeName { get; set; } = string.Empty;
|
||||
public ModelView(IModel model)
|
||||
{
|
||||
Id = model.Id;
|
||||
Name = model.Name;
|
||||
Price = model.Price;
|
||||
MakeId = model.MakeId;
|
||||
}
|
||||
}
|
||||
}
|
41
CarShowroom/CarShowroomDataModels/Views/SaleView.cs
Normal file
41
CarShowroom/CarShowroomDataModels/Views/SaleView.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using CarShowroomContracts.AbstractModels;
|
||||
using CarShowroomContracts.Dtos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarShowroomDataModels.Dtos
|
||||
{
|
||||
internal class SaleView : ISale
|
||||
{
|
||||
[DisplayName("Номер продажи")]
|
||||
public int Id { get; set; }
|
||||
[DisplayName("Время")]
|
||||
public DateTime SaleTime { get; set; }
|
||||
[DisplayName("Сумма")]
|
||||
public int Cost { get; set; }
|
||||
public int ClientId { get; set; }
|
||||
[DisplayName("Клиент")]
|
||||
public string ClientName { get; set; } = string.Empty;
|
||||
public int EmployeeId { get; set; }
|
||||
[DisplayName("Сотрудник")]
|
||||
public string EmployeeName { get; set; } = string.Empty;
|
||||
public List<int> CarIds { get; set; } = new();
|
||||
public List<CarView> Cars { get; set; } = new();
|
||||
public List<int> ServiseIds { get; set; } = new();
|
||||
public List<ServiceView> Servises { get; set; } = new();
|
||||
public SaleView(ISale model)
|
||||
{
|
||||
Id = model.Id;
|
||||
SaleTime = model.SaleTime;
|
||||
Cost = model.Cost;
|
||||
ClientId = model.ClientId;
|
||||
EmployeeId = model.EmployeeId;
|
||||
CarIds = model.CarIds;
|
||||
ServiseIds = model.ServiseIds;
|
||||
}
|
||||
}
|
||||
}
|
22
CarShowroom/CarShowroomDataModels/Views/ServiceView.cs
Normal file
22
CarShowroom/CarShowroomDataModels/Views/ServiceView.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using CarShowroomContracts.AbstractModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarShowroomContracts.Dtos
|
||||
{
|
||||
public class ServiceView : IService
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Cost { get; set; }
|
||||
public ServiceView(IService model)
|
||||
{
|
||||
Id = model.Id;
|
||||
Name = model.Name;
|
||||
Cost = model.Cost;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user