Создание View-моделей

This commit is contained in:
Мк Игорь 2023-04-01 21:36:28 +04:00
parent d4e22c9915
commit 28ff3d68d1
11 changed files with 159 additions and 1 deletions

View File

@ -12,7 +12,7 @@ namespace CarServiceContracts.Models
/// </summary>
int Count { get; }
/// <summary>
/// Стоимость работы
/// Стоимость
/// </summary>
decimal Cost { get; }
/// <summary>

View File

@ -0,0 +1,18 @@
using CarServiceContracts.Models;
using System.ComponentModel;
namespace CarServiceContracts.ViewModels
{
public class CustomerViewModel : ICustomerModel
{
public int Id { get; set; }
[DisplayName("Логин")]
public string Login { get; set; } = string.Empty;
[DisplayName("Пароль")]
public string Password { get; set; } = string.Empty;
[DisplayName("Имя")]
public string Name { get; set; } = string.Empty;
[DisplayName("Фамилия")]
public string Surname { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,14 @@
using CarServiceContracts.Models;
using System.ComponentModel;
namespace CarServiceContracts.ViewModels
{
public class ItemForRepairViewModel : IItemForRepairModel
{
public int Id { get; set; }
[DisplayName("Количество")]
public int Count { get; set; }
public int ItemId { get; set; }
public int RepairRequestId { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using CarServiceContracts.Models;
using System.ComponentModel;
namespace CarServiceContracts.ViewModels
{
public class ItemViewModel : IItemModel
{
public int Id { get; set; }
[DisplayName("Наименование")]
public string Name { get; set; } = string.Empty;
[DisplayName("Цена")]
public decimal Price { get; set; }
[DisplayName("Количество")]
public int Count { get; set; }
public int WorkerId { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using CarServiceContracts.Models;
using System.ComponentModel;
namespace CarServiceContracts.ViewModels
{
public class RepairRequestViewModel : IRepairRequestModel
{
[DisplayName("Номер заявки")]
public int Id { get; set; }
[DisplayName("Дата создания")]
public DateTime DateCreated { get; set; } = DateTime.Now;
public int VehicleId { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using CarServiceContracts.Models;
using System.ComponentModel;
namespace CarServiceContracts.ViewModels
{
public class VehicleViewModel : IVehicleModel
{
public int Id { get; set; }
[DisplayName("Наименование")]
public string Name { get; set; } = string.Empty;
[DisplayName("Гос. номер")]
public string? Plate { get; set; }
[DisplayName("ВИН номер")]
public string? VIN { get; set; }
public int CustomerId { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using CarServiceContracts.Models;
using System.ComponentModel;
namespace CarServiceContracts.ViewModels
{
public class WorkInRequestViewModel : IWorkInRequestModel
{
public int Id { get; set; }
[DisplayName("Количество работ")]
public int Count { get; set; }
[DisplayName("Стоимость")]
public decimal Cost { get; set; }
public int RepairRequestId { get; set; }
public int WorkId { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using CarServiceContracts.Models;
using System.ComponentModel;
namespace CarServiceContracts.ViewModels
{
public class WorkPaymentViewModel : IWorkPaymentModel
{
public int Id { get; set; }
[DisplayName("Дата оплаты")]
public DateTime DatePayment { get; set; }
[DisplayName("Сумма")]
public decimal Sum { get; set; }
public int WorkInRequestId { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using CarServiceContracts.Models;
using System.ComponentModel;
namespace CarServiceContracts.ViewModels
{
public class WorkViewModel : IWorkModel
{
public int Id { get; set; }
[DisplayName("Наименование")]
public string Name { get; set; } = string.Empty;
[DisplayName("Стоимость работы")]
public decimal Price { get; set; }
[DisplayName("Длительность")]
public decimal Duration { get; set; }
public int WorkerId { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using CarServiceContracts.Models;
using System.ComponentModel;
namespace CarServiceContracts.ViewModels
{
public class WorkerViewModel : IWorkerModel
{
public int Id { get; set; }
[DisplayName("Логин")]
public string Login { get; set; } = string.Empty;
[DisplayName("Пароль")]
public string Password { get; set; } = string.Empty;
[DisplayName("Имя")]
public string Name { get; set; } = string.Empty;
[DisplayName("Фамилия")]
public string Surname { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CarServiceView
{
internal class CustomerViewModel
{
}
}