изменены view-модельки

This commit is contained in:
malimova 2024-06-02 20:11:06 +04:00
parent aaa9b16759
commit 1e2e4b0f21
7 changed files with 67 additions and 39 deletions

View File

@ -1,4 +1,5 @@
using ConfectioneryDataModels.Models;
using ConfectioneryContracts.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -10,10 +11,11 @@ namespace ConfectioneryContracts.ViewModels
{
public class ComponentViewModel : IComponentModel
{
[Column(visible: false)]
public int Id { get; set; }
[DisplayName("Название компонента")]
[Column(title: "Название компонента", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)]
public string ComponentName { get; set; } = string.Empty;
[DisplayName("Цена")]
[Column(title: "Цена", width: 150)]
public double Cost { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using ConfectioneryDataModels.Models;
using ConfectioneryContracts.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -10,18 +11,19 @@ namespace ConfectioneryContracts.ViewModels
{
public class ImplementerViewModel : IImplementerModel
{
[Column(visible: false)]
public int Id { get; set; }
[DisplayName("ФИО исполнителя")]
[Column(title: "ФИО исполнителя", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)]
public string ImplementerFIO { get; set; } = string.Empty;
[DisplayName("Пароль")]
[Column(title: "Пароль", width: 100)]
public string Password { get; set; } = string.Empty;
[DisplayName("Стаж работы")]
[Column(title: "Стаж работы", width: 60)]
public int WorkExperience { get; set; }
[DisplayName("Квалификация")]
[Column(title: "Квалификация", width: 60)]
public int Qualification { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using ConfectioneryDataModels.Models;
using ConfectioneryContracts.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -10,20 +11,23 @@ namespace ConfectioneryContracts.ViewModels
{
public class MessageInfoViewModel : IMessageInfoModel
{
[Column(visible: false)]
public int Id { get; set; }
[Column(visible: false)]
public string MessageId { get; set; } = string.Empty;
[Column(visible: false)]
public int? ClientId { get; set; }
[DisplayName("Отправитель")]
[Column(title: "Отправитель", width: 150)]
public string SenderName { get; set; } = string.Empty;
[DisplayName("Дата письма")]
[Column(title: "Дата письма", width: 120)]
public DateTime DateDelivery { get; set; }
[DisplayName("Заголовок")]
[Column(title: "Заголовок", width: 120)]
public string Subject { get; set; } = string.Empty;
[DisplayName("Текст")]
[Column(title: "Текст", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)]
public string Body { get; set; } = string.Empty;
}
}

View File

@ -1,5 +1,6 @@
using ConfectioneryDataModels.Enums;
using ConfectioneryDataModels.Models;
using ConfectioneryContracts.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -11,28 +12,32 @@ namespace ConfectioneryContracts.ViewModels
{
public class OrderViewModel : IOrderModel
{
[DisplayName("Номер")]
[Column(title: "Номер", width: 90)]
public int Id { get; set; }
[Column(visible: false)]
public int ClientId { get; set; }
[DisplayName("ФИО клиента")]
[Column(title: "ФИО клиента", width: 190)]
public string ClientFIO { get; set; } = string.Empty;
[Column(visible: false)]
public string ClientEmail { get; set; } = string.Empty;
[Column(visible: false)]
public int? ImplementerId { get; set; }
[DisplayName("Исполнитель")]
[Column(title: "Исполнитель", width: 150)]
public string? ImplementerFIO { get; set; } = null;
[Column(visible: false)]
public int PastryId { get; set; }
[DisplayName("Изделие")]
[Column(title: "Изделие", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)]
public string PastryName { get; set; } = string.Empty;
[DisplayName("Количество")]
[Column(title: "Количество", width: 100)]
public int Count { get; set; }
[DisplayName("Сумма")]
[Column(title: "Сумма", width: 120)]
public double Sum { get; set; }
[DisplayName("Статус")]
[Column(title: "Статус", width: 70)]
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
[DisplayName("Дата создания")]
[Column(title: "Дата создания", width: 120)]
public DateTime DateCreate { get; set; } = DateTime.Now;
[DisplayName("Дата выполнения")]
[Column(title: "Дата выполнения", width: 120)]
public DateTime? DateImplement { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using ConfectioneryDataModels.Models;
using ConfectioneryContracts.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@ -10,11 +11,13 @@ namespace ConfectioneryContracts.ViewModels
{
public class PastryViewModel : IPastryModel
{
[Column(visible: false)]
public int Id { get; set; }
[DisplayName("Название изделия")]
[Column(title: "Название изделия", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)]
public string PastryName { get; set; } = string.Empty;
[DisplayName("Цена")]
[Column(title: "Цена", width: 70)]
public double Price { get; set; }
[Column(visible: false)]
public Dictionary<int, (IComponentModel, int)> PastryComponents { get; set; } = new();
}
}

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace ConfectioneryDataModels.Models
{
public interface IClientModel
public interface IClientModel : IId
{
string ClientFIO { get; }
string Email { get; }

View File

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