отображение колонок

This commit is contained in:
dex_moth 2024-06-19 14:38:52 +04:00
parent 596f77bcb9
commit 8d048df15b
4 changed files with 22 additions and 15 deletions

View File

@ -94,6 +94,11 @@ namespace FishFactoryBusinessLogic.BusinessLogic
throw new ArgumentNullException(nameof(element)); throw new ArgumentNullException(nameof(element));
} }
if (element.ImplementerId != null && model.ImplementerId != null && model.ImplementerId != element.ImplementerId)
{
throw new InvalidOperationException(nameof(model.ImplementerId));
}
model.CannedId = element.CannedId; model.CannedId = element.CannedId;
model.ClientId = element.ClientId; model.ClientId = element.ClientId;
model.DateCreate = element.DateCreate; model.DateCreate = element.DateCreate;
@ -101,6 +106,7 @@ namespace FishFactoryBusinessLogic.BusinessLogic
model.Status = element.Status; model.Status = element.Status;
model.Count = element.Count; model.Count = element.Count;
model.Sum = element.Sum; model.Sum = element.Sum;
model.ImplementerId = element.ImplementerId.HasValue ? element.ImplementerId : model.ImplementerId;
if (model.Status != orderStatus - 1) if (model.Status != orderStatus - 1)
{ {

View File

@ -4,7 +4,7 @@ namespace FishFactoryContracts.SearchModels
public class ImplementerSearchModel public class ImplementerSearchModel
{ {
public int? Id { get; set; } public int? Id { get; set; }
public string? ImplementerFIO { get; set; } public string? ImplementerFIO { get; set; } = string.Empty;
public string? Password { get; set; } public string? Password { get; set; } = string.Empty;
} }
} }

View File

@ -1,9 +1,9 @@
 using FishFactoryDataModel.Models;
using System.ComponentModel; using System.ComponentModel;
namespace FishFactoryContracts.ViewModels namespace FishFactoryContracts.ViewModels
{ {
public class ImplementerViewModel public class ImplementerViewModel : IImplementerModel
{ {
public int Id { get; set; } public int Id { get; set; }
[DisplayName("ФИО исполнителя")] [DisplayName("ФИО исполнителя")]

View File

@ -1,6 +1,7 @@
using FishFactoryContracts.BindingModels; using FishFactoryContracts.BindingModels;
using FishFactoryContracts.ViewModels; using FishFactoryContracts.ViewModels;
using FishFactoryDataModel.Models; using FishFactoryDataModel.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
namespace FishFactoryDatabaseImplement.Models namespace FishFactoryDatabaseImplement.Models
@ -8,13 +9,13 @@ namespace FishFactoryDatabaseImplement.Models
public class Implementer : IImplementerModel public class Implementer : IImplementerModel
{ {
public int Id { get; private set; } public int Id { get; private set; }
[Required]
public string ImplementerFIO { get; private set; } = string.Empty; public string ImplementerFIO { get; private set; } = string.Empty;
[Required]
public string Password { get; private set; } = string.Empty; public string Password { get; private set; } = string.Empty;
[Required]
public int WorkExperience { get; private set; } = 0; public int WorkExperience { get; private set; } = 0;
[Required]
public int Qualification { get; private set; } = 0; public int Qualification { get; private set; } = 0;
[ForeignKey("ImplementerId")] [ForeignKey("ImplementerId")]
public virtual List<Order> Order { get; set; } = new(); public virtual List<Order> Order { get; set; } = new();