Ejemplo n.º 1
0
        GlobalStoryGrid IGlobalStoryGridService.Update(GlobalStoryGrid updated, Guid currentUserId)
        {
            using (var session = _sessionFactory.OpenSession())
            {
                using (var transaction = session.BeginTransaction())
                {
                    var existing = session.Query <GlobalStoryGrid>().First(x => x.Id == updated.Id);
                    existing.Title = updated.Title;
                    existing.ControllingIdeaTheme           = updated.ControllingIdeaTheme;
                    existing.ExternalGenre                  = updated.ExternalGenre;
                    existing.ExternalValueAtStake           = updated.ExternalValueAtStake;
                    existing.InternalGenre                  = updated.InternalGenre;
                    existing.InternalValueAtStake           = updated.InternalValueAtStake;
                    existing.ObjectsOfDesire                = updated.ObjectsOfDesire;
                    existing.PointOfView                    = updated.PointOfView;
                    existing.ObligatoryScenesAndConventions = updated.ObligatoryScenesAndConventions;

                    UpdateSection(updated.BeginningHook, existing.BeginningHook);
                    UpdateSection(updated.MiddleBuild, existing.MiddleBuild);
                    UpdateSection(updated.EndingPayoff, existing.EndingPayoff);

                    session.Update(existing);
                    transaction.Commit();
                    return(existing);
                }
            }
        }
Ejemplo n.º 2
0
        public Guid NewGlobalStoryGrid(Guid projectId)
        {
            var newGlobalStoryGrid = new GlobalStoryGrid();
            var id = _globalStoryGridService.Add(newGlobalStoryGrid, projectId, CurrentUser.Id);

            return(id);
        }
Ejemplo n.º 3
0
        Guid IGlobalStoryGridService.Add(GlobalStoryGrid newGlobalStoryGrid, Guid projectId, Guid currentUserId)
        {
            using (var session = _sessionFactory.OpenSession())
            {
                using (var transaction = session.BeginTransaction())
                {
                    var project = session.Query <Project>().Single(x => x.Id == projectId);
                    newGlobalStoryGrid.Project       = project;
                    newGlobalStoryGrid.Title         = project.Title + " Story Grid";
                    newGlobalStoryGrid.BeginningHook = CreateStoryGridSection(session);
                    newGlobalStoryGrid.MiddleBuild   = CreateStoryGridSection(session);
                    newGlobalStoryGrid.EndingPayoff  = CreateStoryGridSection(session);

                    var id = session.Save(newGlobalStoryGrid);
                    transaction.Commit();
                    return((Guid)id);
                }
            }
        }