Ejemplo n.º 1
0
        /// <summary>
        /// Cascade set ProjectSearchModel Result
        /// </summary>
        /// <param name="project"></param>
        /// <returns></returns>
        public static ProjectSearchModel SetProjectSearchModelCascade(Project project)
        {
            if (project == null)
            {
                return(null);
            }
            var projectSearchModel = new ProjectSearchModel()
            {
                ProjectId    = project.ProjectId,
                ProjectNo    = project.ProjectNo,
                ProjectName  = project.ProjectName,
                CustomerId   = project.CustomerId,
                Completed    = project.Completed,
                Creator      = project.Creator,
                CreateDate   = project.CreateDate,
                Modifier     = project.Modifier,
                ModifiedDate = project.ModifiedDate,
                Customer     = CustomerOperator.SetCustomerSubSearchModel(project.Customer),
                Scenes       = SceneOperator.SetSceneSearchModelCascade(project.Scenes),
                Groups       = GroupOperator.SetGroupSearchModelCascade(project.Groups),
                Locations    = LocationOperator.SetLocationSearchModelCascade(project.Locations),
                Holidays     = HolidayOperator.SetHolidaySearchModelCascade(project.Holidays)
            };

            return(projectSearchModel);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Cascade set SceneSegmentSearchModel Result
        /// </summary>
        /// <param name="sceneSegment"></param>
        /// <returns></returns>
        public static SceneSegmentSearchModel SetSceneSegmentSearchModelCascade(SceneSegment sceneSegment)
        {
            if (sceneSegment == null)
            {
                return(null);
            }
            var sceneSegmentSearchModel = new SceneSegmentSearchModel
            {
                SceneSegmentId = sceneSegment.SceneSegmentId,
                SceneId        = sceneSegment.SceneId,
                SequenceNo     = sceneSegment.SequenceNo,
                StartTime      = sceneSegment.StartTime,
                Volumn         = sceneSegment.Volumn,
                Creator        = sceneSegment.Creator,
                CreateDate     = sceneSegment.CreateDate,
                Modifier       = sceneSegment.Modifier,
                ModifiedDate   = sceneSegment.ModifiedDate,
                Scene          = SceneOperator.SetSceneSubSearchModel(sceneSegment.Scene)
            };

            return(sceneSegmentSearchModel);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Cascade set GroupSearchModel Result
        /// </summary>
        /// <param name="group"></param>
        /// <returns></returns>
        public static GroupSearchModel SetGroupSearchModelCascade(Group group)
        {
            if (group == null)
            {
                return(null);
            }
            var groupSearchModel = new GroupSearchModel()
            {
                GroupId      = group.GroupId,
                GroupName    = group.GroupName,
                ProjectId    = group.ProjectId,
                SceneId      = group.SceneId,
                Creator      = group.Creator,
                CreateDate   = group.CreateDate,
                Modifier     = group.Modifier,
                ModifiedDate = group.ModifiedDate,
                Project      = ProjectOperator.SetProjectSubSearchModel(group.Project),
                Scene        = SceneOperator.SetSceneSubSearchModel(group.Scene),
                Locations    = group.GroupLocations.Select(v => LocationOperator.SetLocationSearchModelCascade(v.Location))
            };

            return(groupSearchModel);
        }