internal void Load(ReportReader reader)
 {
     Clear();
     this.DocumentName = reader.GetName();
     this.PageHeight   = reader.GetHeight();
     this.PageWidth    = reader.GetWidth();
     this.ShowSummary  = reader.ShowSummary();
     this.ShowFooter   = reader.ShowFooter();
     this.ShowHeader   = reader.ShowHeader();
     this.PaperHeight  = reader.GetPaperHeight();
     this.PaperWidth   = reader.GetPaperWidth();
     this._cpi         = reader.GetCpi();
     _groups.Load(reader.GetGroups());
     _bands.Load(reader.GetBands());
     foreach (Band band in _bands)
     {
         if (band.GroupId > 0)
         {
             band.Group = Groups[band.GroupId - 1];
         }
     }
     foreach (BaseWidget widget in reader.GetWidgets())
     {
         widget.Owner = this;
         _bands[widget.Row].Add(widget);
     }
 }
예제 #2
0
        // GET: api/Group
        public IEnumerable <Group> Get()
        {
            GroupList groups = new GroupList();

            groups.Load();
            return(groups);
        }
        public void UpdateTest()
        {
            //Load up Guids
            PerformerList performers = new PerformerList();
            Performer     performer  = new Performer();

            performers.Load();
            performer = performers.FirstOrDefault(p => p.FirstName == "Hunter");

            GroupList groups = new GroupList();
            Group     group  = new Group();

            groups.Load();
            group = groups.FirstOrDefault(c => c.Name == "Jazz Ensemble");

            InstrumentList instruments = new InstrumentList();
            Instrument     instrument  = new Instrument();

            instruments.Load();
            instrument = instruments.FirstOrDefault(c => c.Description == "Euphonium");

            GroupMember     groupMember  = new GroupMember();
            GroupMemberList groupMembers = new GroupMemberList();

            groupMembers.Load();
            groupMember           = groupMembers.FirstOrDefault(p => p.GroupId == group.Id && p.PerformerId == performer.Id);
            groupMember.StartDate = Convert.ToDateTime("04/24/3000");
            groupMember.EndDate   = Convert.ToDateTime("04/25/3000");

            groupMember.Instrument = instrument.Id;
            int results = groupMember.Update();

            Assert.IsTrue(results == 1);
        }
예제 #4
0
        public void LoadTest()
        {
            GroupList groups = new GroupList();

            groups.Load();
            Assert.AreEqual(3, groups.Count);
        }
예제 #5
0
        public void DeleteTest()
        {
            Group     group  = new Group();
            GroupList groups = new GroupList();

            groups.Load();
            group = groups.FirstOrDefault(c => c.Name == "BL Test");

            int results = group.Delete();

            Assert.IsTrue(results == 1);
        }
예제 #6
0
        public void LoadById()
        {
            Group     group  = new Group();
            GroupList groups = new GroupList();

            groups.Load();
            group = groups.FirstOrDefault(c => c.Name == "BL Test");

            Group newGroup = new Group {
                Id = group.Id
            };

            newGroup.LoadById();

            Assert.AreEqual(group.Name, newGroup.Name);
        }
        public void LoadById()
        {
            //Load up Guids
            PieceList pieces = new PieceList();
            Piece     piece  = new Piece();

            pieces.Load();
            piece = pieces.FirstOrDefault(p => p.Name == "Rock Music");

            GroupList groups = new GroupList();
            Group     group  = new Group();

            groups.Load();
            group = groups.FirstOrDefault(c => c.Name == "Jazz Ensemble");

            PerformanceList performances = new PerformanceList();
            Performance     performance  = new Performance();

            performances.Load();
            performance = performances.FirstOrDefault(c => c.Name == "Dream Concert");

            DirectorList directors = new DirectorList();
            Director     director  = new Director();

            directors.Load();
            director = directors.FirstOrDefault(c => c.FirstName == "Eric");

            PerformancePiece     performancePiece  = new PerformancePiece();
            PerformancePieceList performancePieces = new PerformancePieceList();

            performancePieces.Load();
            performancePiece         = performancePieces.FirstOrDefault(p => p.GroupId == group.Id && p.PieceId == piece.Id && p.PerformanceId == performance.Id);
            performancePiece.Notes   = "BL Test";
            performancePiece.MP3Path = "BL Test";

            PerformancePiece newperformancePiece = new PerformancePiece {
                Id = performancePiece.Id
            };

            newperformancePiece.LoadById();

            Assert.AreEqual(performancePiece.DirectorId, newperformancePiece.DirectorId);
        }
        public void UpdateTest()
        {
            //Load up Guids
            PieceList pieces = new PieceList();
            Piece     piece  = new Piece();

            pieces.Load();
            piece = pieces.FirstOrDefault(p => p.Name == "Rock Music");

            GroupList groups = new GroupList();
            Group     group  = new Group();

            groups.Load();
            group = groups.FirstOrDefault(c => c.Name == "Jazz Ensemble");

            PerformanceList performances = new PerformanceList();
            Performance     performance  = new Performance();

            performances.Load();
            performance = performances.FirstOrDefault(c => c.Name == "Dream Concert");

            DirectorList directors = new DirectorList();
            Director     director  = new Director();

            directors.Load();
            director = directors.FirstOrDefault(c => c.FirstName == "Eric");

            PerformancePiece     performancePiece  = new PerformancePiece();
            PerformancePieceList performancePieces = new PerformancePieceList();

            performancePieces.Load();
            performancePiece         = performancePieces.FirstOrDefault(p => p.GroupId == group.Id && p.PieceId == piece.Id && p.PerformanceId == performance.Id);
            performancePiece.Notes   = "BL Test";
            performancePiece.MP3Path = "BL Test";

            performancePiece.DirectorId = director.Id;
            int results = performancePiece.Update();

            Assert.IsTrue(results == 1);
        }
        public void LoadById()
        {
            //Load up Guids
            PerformerList performers = new PerformerList();
            Performer     performer  = new Performer();

            performers.Load();
            performer = performers.FirstOrDefault(p => p.FirstName == "Hunter");

            GroupList groups = new GroupList();
            Group     group  = new Group();

            groups.Load();
            group = groups.FirstOrDefault(c => c.Name == "Jazz Ensemble");

            InstrumentList instruments = new InstrumentList();
            Instrument     instrument  = new Instrument();

            instruments.Load();
            instrument = instruments.FirstOrDefault(c => c.Description == "Euphonium");

            GroupMember     groupMember  = new GroupMember();
            GroupMemberList groupMembers = new GroupMemberList();

            groupMembers.Load();
            groupMember           = groupMembers.FirstOrDefault(p => p.GroupId == group.Id && p.PerformerId == performer.Id);
            groupMember.StartDate = Convert.ToDateTime("04/24/3000");
            groupMember.EndDate   = Convert.ToDateTime("04/25/3000");

            GroupMember newgroupmember = new GroupMember {
                Id = groupMember.Id
            };

            newgroupmember.LoadById();

            Assert.AreEqual(groupMember.Instrument, newgroupmember.Instrument);
        }