Beispiel #1
0
        private void CompletePath(IContext ctx, Context context, Seating seating)
        {
            seating.SetPathDone();
            ctx.Update(seating);

            context.SetState(ContextState.CheckDone);
            ctx.Update(context);
        }
Beispiel #2
0
        private void AssignSeat(IContext ctx, Context context, Guest guest, Count count)
        {
            var cnt = count.Value;

            var seating = new Seating(cnt, 0, true, 1, guest.Name, 1, guest.Name);
            ctx.Insert(seating);

            var path = new Path(cnt, 1, guest.Name);
            ctx.Insert(path);

            count.Increment();
            ctx.Update(count);

            context.SetState(ContextState.AssignSeats);
            ctx.Update(context);
        }
Beispiel #3
0
        private void AssignSeat(IContext ctx, Context context, Seating seating, Guest guest1, Guest guest2, Count count)
        {
            int rightSeat = seating.RightSeatId;
            int seatId = seating.Id;
            int cnt = count.Value;

            var newSeating = new Seating(cnt, seatId, false, rightSeat, seating.RightGuestName, rightSeat + 1, guest2.Name);
            ctx.Insert(newSeating);

            var path = new Path(cnt, rightSeat + 1, guest2.Name);
            ctx.Insert(path);

            var chosen = new Chosen(seatId, guest2.Name, guest1.Hobby);
            ctx.Insert(chosen);

            count.Increment();
            ctx.Update(count);

            context.SetState(ContextState.MakePath);
            ctx.Update(context);
        }
Beispiel #4
0
 private void MakeNewPath(IContext ctx, Context context, Seating seating, Path path)
 {
     var newPath = new Path(seating.Id, path.SeatId, path.GuestName);
     ctx.Insert(newPath);
 }