add desplay names and set browsable for entities. have not touched other dirs

This commit is contained in:
Ivan Gutorov 2024-12-09 04:20:44 +04:00
parent d644ef51a2
commit 9763ab2e40
6 changed files with 58 additions and 4 deletions

View File

@ -1,4 +1,5 @@
using PIbd_23_Gutorov_I.A._IT_Company.Entities.Enums; using PIbd_23_Gutorov_I.A._IT_Company.Entities.Enums;
using System.ComponentModel;
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities; namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
@ -6,18 +7,34 @@ public class Contract
{ {
public int Id { get; private set; } public int Id { get; private set; }
[Browsable(false)]
public int CustomerID { get; private set; } public int CustomerID { get; private set; }
[Browsable(false)]
public int ExecutorID { get; private set; } 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; } public ContractCategory Category { get; private set; }
[DisplayName("Дата заключения")]
public DateTime ConclusionDate { get; private set; } public DateTime ConclusionDate { get; private set; }
[DisplayName("Дата окончания")]
public DateTime Deadline { get; private set; } public DateTime Deadline { get; private set; }
[DisplayName("Сумма платежа")]
public int PaymentAmount { get; private set; } 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 IEnumerable<Service> Services { get; private set; } = [];
public static Contract CreateEntity(int id, int customerID, int executorID, 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 class Customer
{ {
public int Id { get; private set; } public int Id { get; private set; }
[DisplayName("Имя")]
public string Name { get; private set; } = string.Empty; public string Name { get; private set; } = string.Empty;
[DisplayName("Контакты")]
public string Contact { get; private set; } = string.Empty; public string Contact { get; private set; } = string.Empty;
public string FullName => $"{Name} {Contact}";
[DisplayName("Адрес")]
public string Address { get; private set; } = string.Empty; public string Address { get; private set; } = string.Empty;
public static Customer CreateEntity(int id, string name, string contact, string address) 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 class CustomerExecutorReview
{ {
public int Id { get; private set; } public int Id { get; private set; }
[Browsable(false)]
public int CustomerId { get; private set; } public int CustomerId { get; private set; }
[Browsable(false)]
public int ExecutorId { get; private set; } 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; public string Review { get; private set; } = string.Empty;
[DisplayName("Оценка")]
public int Grade { get; private set; } public int Grade { get; private set; }
public static CustomerExecutorReview CreateElement(int id, int customerId, int executorId, string review, int grade) 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 PIbd_23_Gutorov_I.A._IT_Company.Entities.Enums;
using System.ComponentModel;
namespace PIbd_23_Gutorov_I.A._IT_Company.Entities; namespace PIbd_23_Gutorov_I.A._IT_Company.Entities;
@ -6,10 +7,14 @@ public class Executor
{ {
public int Id { get; private set; } public int Id { get; private set; }
[DisplayName("Имя")]
public string Name { get; private set; } = string.Empty; public string Name { get; private set; } = string.Empty;
[DisplayName("Должность")]
public ExecutorPost Post { get; private set; } public ExecutorPost Post { get; private set; }
public string FullName => $"{Post} {Name}";
public static Executor CreateEntity(int id, string name, ExecutorPost post) public static Executor CreateEntity(int id, string name, ExecutorPost post)
{ {
return new Executor 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 class Service
{ {
public int Id { get; private set; } public int Id { get; private set; }
[DisplayName("Описание услуги")]
public string Description { get; private set; } = string.Empty; public string Description { get; private set; } = string.Empty;
public static Service CreateEntity(int id, string description) 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 class ServiceContract
{ {
public int Id { get; private set; } public int Id { get; private set; }
[Browsable(false)]
public int ServiceId { get; private set; } public int ServiceId { get; private set; }
[Browsable(false)]
public int ContractId { get; private set; } 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) public static ServiceContract CreateElement(int id, int serviceId, int contractId)
{ {
return new ServiceContract return new ServiceContract