Ejemplo n.º 1
0
        /// <summary>
        /// Cascade set AlarmMessageSearchModel Result
        /// </summary>
        /// <param name="alarmMessage"></param>
        /// <returns></returns>
        public static AlarmMessageSearchModel SetAlarmMessageSearchModelCascade(AlarmMessage alarmMessage)
        {
            if (alarmMessage == null)
            {
                return(null);
            }
            var alarmMessageSearchModel = new AlarmMessageSearchModel
            {
                AlarmMessageId = alarmMessage.AlarmMessageId,
                ErrorCode      = alarmMessage.ErrorCode,
                Message        = alarmMessage.Message,
                Alarms         = AlarmOperator.SetAlarmSearchModelCascade(alarmMessage.Alarms)
            };

            return(alarmMessageSearchModel);
        }
Ejemplo n.º 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);
        }