C# base(基类参数)

public partial class DtoBase
    {
        public DtoBase() { }

        public DtoBase(DataRow dataRow) : this()
        {
            this.Language = DataRowHelper.GetValue(dataRow, this.AliasAs(x => x.Language));
            this.LanguageId = DataRowHelper.GetValue(dataRow, this.AliasAs(x => x.LanguageId));
        }


        /// <summary>
        /// 语言码
        /// </summary>
        [AliasAs("LANGUAGE")]
        public string Language { get; set; }

        /// <summary>        
        ///语言表主键/Id
        /// </summary>
        [StringLength(36, ErrorMessageResourceType = typeof(ErrorMessages), ErrorMessageResourceName = "StringLengthMsg")]
        [AliasAs("LANGUAGE_ID")]
        public string LanguageId { get; set; }
    }
View Code
 /// <summary>
    /// (PUB_DEVICE_PARAMETER_CLASS_DICT) 
    /// </summary>
    public partial class DeviceParameterClassDicDto:DtoBase
    {
        #region Construction
        /// <summary>
        /// (PUB_DEVICE_PARAMETER_CLASS_DICT) 
        /// </summary>
        public DeviceParameterClassDicDto() { }

        /// <summary>
        /// (PUB_DEVICE_PARAMETER_CLASS_DICT) 
        /// </summary>
        public DeviceParameterClassDicDto(DataRow dataRow) : base(dataRow)
        {
            this.Id = DataRowHelper.GetValue(dataRow, this.AliasAs(x => x.Id));
            this.DeviceParameterId = DataRowHelper.GetValue<int>(dataRow, this.AliasAs(x => x.DeviceParameterId));
            this.DeviceParameterName = DataRowHelper.GetValue(dataRow, this.AliasAs(x => x.DeviceParameterName));
            this.ParameterClassId = DataRowHelper.GetValue<int>(dataRow, this.AliasAs(x => x.ParameterClassId));
            this.CreateDateTime = DataRowHelper.GetValue<DateTime?>(dataRow, this.AliasAs(x => x.CreateDateTime));
            this.ChangeDateTime = DataRowHelper.GetValue<DateTime?>(dataRow, this.AliasAs(x => x.ChangeDateTime));
            this.Enabled = DataRowHelper.GetValue<bool?>(dataRow, this.AliasAs(x => x.Enabled));
        }
View Code

通过base(基类参数),将基类值带入子类

posted @ 2021-06-21 11:02  <--青青子衿-->  阅读(252)  评论(0)    收藏  举报
// /**/ // 在页脚Html代码 引入 // function btn_donateClick() { var DivPopup = document.getElementById('Div_popup'); var DivMasklayer = document.getElementById('div_masklayer'); DivMasklayer.style.display = 'block'; DivPopup.style.display = 'block'; var h = Div_popup.clientHeight; with (Div_popup.style) { marginTop = -h / 2 + 'px'; } } function MasklayerClick() { var masklayer = document.getElementById('div_masklayer'); var divImg = document.getElementById("Div_popup"); masklayer.style.display = "none"; divImg.style.display = "none"; } setTimeout( function () { document.getElementById('div_masklayer').onclick = MasklayerClick; document.getElementById('btn_donate').onclick = btn_donateClick; var a_gzw = document.getElementById("guanzhuwo"); a_gzw.href = "javascript:void(0);"; $("#guanzhuwo").attr("onclick","follow('33513f9f-ba13-e011-ac81-842b2b196315');"); }, 900);