using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.ComponentModel.DataAnnotations; using Sleis.Validation.Attribute; namespace Sleis.Models { public class PublicControlDeviceDetail : BaseModel { public virtual PublicControlDeviceModel ControlDevice { get; set; } public virtual List Pollutants { get; set; } public virtual string EmissionIdentifierName { get; set; } public virtual string UnitProcessIdentifierName { get; set; } public PublicControlDeviceDetail() { ControlDevice = new PublicControlDeviceModel(); Pollutants = new List(); PublicControlDevicePollutant pollutant = new PublicControlDevicePollutant(); Pollutants.Add(pollutant); EmissionIdentifierName = string.Empty; UnitProcessIdentifierName = string.Empty; } public override void SetContext(string parentContext) { if (ControlDevice != null) { ControlDevice.SetContext(parentContext); ValidationContxt = ControlDevice.ValidationContxt; if (Pollutants != null) Pollutants.ForEach(x => x.SetContext(ValidationContxt)); } } } }