/// <summary>
        /// Map NHibernate model to DTO
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static MasterInfoDTO MapToDTO(MasterInfo model)
        {
            MasterInfoDTO dto = new MasterInfoDTO();

            dto.InfoCode = model.InfoCode;
            dto.SubinfoCode = model.SubinfoCode;
            dto.SubinfoName = model.SubinfoName;

            return dto;
        }
        /// <summary>
        /// Map DTO to NHibernate model
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static MasterInfo MapFromDTO(MasterInfoDTO dto)
        {
            MasterInfo model = new MasterInfo();

            model.InfoCode = dto.InfoCode;
            model.SubinfoCode = dto.SubinfoCode;
            model.SubinfoName = dto.SubinfoName;

            return model;
        }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            MasterInfo mstInfo = (MasterInfo)obj;

            if (mstInfo.InfoCode == this.InfoCode && mstInfo.SubinfoCode == this.SubinfoCode)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }