You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/Platform/Application/Models/EditBuildingModel.cs

45 lines
1.4 KiB

using Infrastructure.Application;
using Application.Domain.Entities;
using Platform.Areas.IoTCenter.Controllers;
using System;
using System.ComponentModel.DataAnnotations;
using UoN.ExpressiveAnnotations.NetCore.Attributes;
namespace Platform.Application.Models
{
[Display(Name = "建筑")]
public class EditBuildingModel : EditModel
{
[SelectList(nameof(ParentId), nameof(AjaxController.GetBuilding))]
[Display(Name = "机构")]
[Required(ErrorMessage = nameof(RequiredAttribute))]
public Guid? OrganId { get; set; }
[Display(Name = "上级")]
[SelectList]
public Guid? ParentId { get; set; }
[Display(Name = "类型")]
[SelectList]
[Required(ErrorMessage = nameof(RequiredAttribute))]
public string Type { get; set; }
[Display(Name = "名称")]
[MaxLength(24, ErrorMessage = "{0}最大长度为{1}")]
[Required(ErrorMessage = nameof(RequiredAttribute))]
public string Name { get; set; }
[Display(Name = "编号")]
[Required(ErrorMessage = nameof(RequiredAttribute))]
public string Number { get; set; }
[Display(Name = "图片")]
[DataType(DataType.ImageUrl)]
[Required(ErrorMessage = nameof(RequiredAttribute))]
public string Image { get; set; } = "/images/empty.svg";
[Display(Name = "序号")]
public int Order { get; set; }
}
}