PIbd-22 Isaeva A.I. Lab work 6 Base #7
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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("ФИО исполнителя")]
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user