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

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,15 +94,21 @@ namespace FishFactoryBusinessLogic.BusinessLogic
throw new ArgumentNullException(nameof(element));
}
model.CannedId = element.CannedId;
if (element.ImplementerId != null && model.ImplementerId != null && model.ImplementerId != element.ImplementerId)
{
throw new InvalidOperationException(nameof(model.ImplementerId));
}
model.CannedId = element.CannedId;
model.ClientId = element.ClientId;
model.DateCreate = element.DateCreate;
model.DateImplement = element.DateImplement;
model.Status = element.Status;
model.Count = element.Count;
model.Sum = element.Sum;
model.ImplementerId = element.ImplementerId.HasValue ? element.ImplementerId : model.ImplementerId;
if (model.Status != orderStatus - 1)
if (model.Status != orderStatus - 1)
{
_logger.LogWarning("Status update to " + orderStatus + " operation failed");
return false;

View File

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

View File

@ -1,9 +1,9 @@

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

View File

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