forked from ddrilling/AsbCloudServer
ProcessMapPlanBaseDto
This commit is contained in:
parent
7a061404c2
commit
6cf23e3e8c
51
AsbCloudApp/Data/ProcessMaps/ProcessMapPlanBaseDto.cs
Normal file
51
AsbCloudApp/Data/ProcessMaps/ProcessMapPlanBaseDto.cs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace AsbCloudApp.Data.ProcessMaps;
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public abstract class ProcessMapPlanBaseDto : ChangeLogAbstract, IId, IWellRelated, IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id скважины
|
||||||
|
/// </summary>
|
||||||
|
[Range(1, int.MaxValue, ErrorMessage = "Id скважины не может быть меньше 1")]
|
||||||
|
public int IdWell { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Тип секции
|
||||||
|
/// </summary>
|
||||||
|
[Range(1, int.MaxValue, ErrorMessage = "Id секции скважины не может быть меньше 1")]
|
||||||
|
public int IdWellSectionType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Название секции
|
||||||
|
/// </summary>
|
||||||
|
public string? Section { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Глубина по стволу от, м
|
||||||
|
/// <para>
|
||||||
|
/// на начало интервала
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
[Range(0, 99999.9, ErrorMessage = "Глубина не может быть отрицательной")]
|
||||||
|
public double DepthStart { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Глубина по стволу до, м
|
||||||
|
/// <para>
|
||||||
|
/// на конец интервала
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
[Range(0, 99999.9, ErrorMessage = "Глубина не может быть отрицательной")]
|
||||||
|
public double DepthEnd { get; set; }
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public virtual IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
if (DepthEnd <= DepthStart)
|
||||||
|
yield return new("Глубина окончания должна быть больше глубины начала", new string[] { nameof(DepthEnd), nameof(DepthStart) });
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user