Example #1
0
        /// <summary>
        /// Cascade set LogDescriptionSearchModel Result
        /// </summary>
        /// <param name="logDescription"></param>
        /// <returns></returns>
        public static LogDescriptionSearchModel SetLogDescriptionSearchModelCascade(LogDescription logDescription)
        {
            if (logDescription == null)
            {
                return(null);
            }
            var logDescriptionSearchModel = new LogDescriptionSearchModel
            {
                LogDescriptionId = logDescription.LogDescriptionId,
                DescriptionCode  = logDescription.DescriptionCode,
                Description      = logDescription.Description,
                Logs             = LogOperator.SetLogSearchModelCascade(logDescription.Logs)
            };

            return(logDescriptionSearchModel);
        }
Example #2
0
        /// <summary>
        /// Cascade set LocationSearchModel Result
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public static LocationSearchModel SetLocationSearchModelCascade(Location location)
        {
            if (location == null)
            {
                return(null);
            }
            var locationSearchModel = new LocationSearchModel()
            {
                LocationId           = location.LocationId,
                ProjectId            = location.ProjectId,
                Building             = location.Building,
                CommAddress          = location.CommAddress,
                CommMode             = location.CommMode,
                CurrentPosition      = location.CurrentPosition,
                Description          = location.Description,
                DeviceSerialNo       = location.DeviceSerialNo,
                DeviceId             = location.DeviceId,
                DeviceType           = location.DeviceType,
                FavorPositionFirst   = location.FavorPositionFirst,
                FavorPositionrSecond = location.FavorPositionrSecond,
                FavorPositionThird   = location.FavorPositionThird,
                Floor = location.Floor,
                InstallationNumber = location.InstallationNumber,
                Orientation        = location.Orientation,
                RoomNo             = location.RoomNo,
                Creator            = location.Creator,
                CreateDate         = location.CreateDate,
                Modifier           = location.Modifier,
                ModifiedDate       = location.ModifiedDate,
                Groups             = location.GroupLocations.Select(gl => GroupOperator.SetGroupSearchModelCascade(gl.Group)),
                Logs    = LogOperator.SetLogSearchModelCascade(location.Logs),
                Alarms  = AlarmOperator.SetAlarmSearchModelCascade(location.Alarms),
                Project = ProjectOperator.SetProjectSubSearchModel(location.Project),
                Device  = DeviceOperator.SetDeviceSubSearchModel(location.Device)
            };

            return(locationSearchModel);
        }