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 abstract class ControlDevicePollutant : BaseIdentityModel { public virtual string Code { get; set; } public virtual SimpleLookupItem Pollutant { get; set; } public virtual int ControlDeviceId { get; set; } public virtual Decimal? Efficency { get; set; } public ControlDevicePollutant() { Code = string.Empty; } public override void SetContext(string parentContext) { if (!String.IsNullOrEmpty(Code)) { ValidationContxt = String.Format("{0} Pollutant:{1}", parentContext, Code); } else { ValidationContxt = parentContext; } } } }