ПИбд-23. Гуторов И.А. Лабораторная работа 4 #4

Closed
vasmaae wants to merge 7 commits from LabWork_4 into LabWork_3
6 changed files with 58 additions and 4 deletions
Showing only changes of commit 9763ab2e40 - Show all commits

View File

@ -1,4 +1,5 @@
using PIbd_23_Gutorov_I.A._IT_Company.Entities.Enums;
using System.ComponentModel;
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
@ -6,18 +7,34 @@ public class Contract
{
public int Id { get; private set; }
[Browsable(false)]
public int CustomerID { get; private set; }
[Browsable(false)]
public int ExecutorID { get; private set; }
[DisplayName("Заказчик")]
public int CustomerName { get; private set; }
[DisplayName("Исполнитель")]
public int ExecutorName { get; private set; }
[DisplayName("Тип контракта")]
public ContractCategory Category { get; private set; }
[DisplayName("Дата заключения")]
public DateTime ConclusionDate { get; private set; }
[DisplayName("Дата окончания")]
public DateTime Deadline { get; private set; }
[DisplayName("Сумма платежа")]
public int PaymentAmount { get; private set; }
[DisplayName("Услуги")]
public string Service => Services != null ? string.Join(", ", Services) : string.Empty;
[Browsable(false)]
public IEnumerable<Service> Services { get; private set; } = [];
public static Contract CreateEntity(int id, int customerID, int executorID,

View File

@ -1,13 +1,20 @@
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
using System.ComponentModel;
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
public class Customer
{
public int Id { get; private set; }
[DisplayName("Имя")]
public string Name { get; private set; } = string.Empty;
[DisplayName("Контакты")]
public string Contact { get; private set; } = string.Empty;
public string FullName => $"{Name} {Contact}";
[DisplayName("Адрес")]
public string Address { get; private set; } = string.Empty;
public static Customer CreateEntity(int id, string name, string contact, string address)

View File

@ -1,15 +1,27 @@
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
using System.ComponentModel;
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
public class CustomerExecutorReview
{
public int Id { get; private set; }
[Browsable(false)]
public int CustomerId { get; private set; }
[Browsable(false)]
public int ExecutorId { get; private set; }
[DisplayName("Заказчик")]
public int CustomerName { get; private set; }
[DisplayName("Исполнитель")]
public int ExecutorName { get; private set; }
[DisplayName("Отзыв")]
public string Review { get; private set; } = string.Empty;
[DisplayName("Оценка")]
public int Grade { get; private set; }
public static CustomerExecutorReview CreateElement(int id, int customerId, int executorId, string review, int grade)

View File

@ -1,4 +1,5 @@
using PIbd_23_Gutorov_I.A._IT_Company.Entities.Enums;
using System.ComponentModel;
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
@ -6,10 +7,14 @@ public class Executor
{
public int Id { get; private set; }
[DisplayName("Имя")]
public string Name { get; private set; } = string.Empty;
[DisplayName("Должность")]
public ExecutorPost Post { get; private set; }
public string FullName => $"{Post} {Name}";
public static Executor CreateEntity(int id, string name, ExecutorPost post)
{
return new Executor

View File

@ -1,9 +1,12 @@
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
using System.ComponentModel;
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
public class Service
{
public int Id { get; private set; }
[DisplayName("Описание услуги")]
public string Description { get; private set; } = string.Empty;
public static Service CreateEntity(int id, string description)

View File

@ -1,13 +1,23 @@
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
using System.ComponentModel;
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
public class ServiceContract
{
public int Id { get; private set; }
[Browsable(false)]
public int ServiceId { get; private set; }
[Browsable(false)]
public int ContractId { get; private set; }
[DisplayName("Заказчик")]
public int CustomerName { get; private set; }
[DisplayName("Исполнитель")]
public int ExecutorName { get; private set; }
public static ServiceContract CreateElement(int id, int serviceId, int contractId)
{
return new ServiceContract