Пример #1
0
 public override void Setup()
 {
     base.Setup();
     DefaultAct        = Act.CreateDefault();
     DefaultNewsletter = Newsletter.CreateDefault();
     DefaultSeries     = Series.CreateDefault();
     RalphJenkins      = new Artist {
         QueryHelper = QueryHelper,
         Forename    = RalphJenkinsForename,
         Surname     = RalphJenkinsSurname,
         Notes       = RalphJenkinsNotes
     };
     Clarissa = new Artist {
         QueryHelper = QueryHelper,
         Forename    = ClarissaForename
     };
     Baker = new Artist {
         QueryHelper = QueryHelper,
         Surname     = BakerSurname
     };
     Role1 = new Role {
         QueryHelper = QueryHelper,
         Name        = Role1Name
     };
     Location1 = new Location {
         QueryHelper = QueryHelper,
         Name        = Location1Name
     };
     Event1 = new Event {
         QueryHelper = QueryHelper,
         Date        = Event1Date
     };
     Set1 = new Set {
         QueryHelper = QueryHelper,
         SetNo       = Set1SetNo
     };
     Piece1 = new TestPiece {
         QueryHelper = QueryHelper,
         PieceNo     = Piece1PieceNo
     };
     Credit1 = new Credit {
         QueryHelper = QueryHelper,
         CreditNo    = Credit1CreditNo
     };
     Credit2 = new Credit {
         QueryHelper = QueryHelper,
         CreditNo    = Credit2CreditNo
     };
     Session.BeginUpdate();
     Session.Persist(DefaultAct);
     Session.Persist(DefaultNewsletter);
     Session.Persist(DefaultSeries);
     Session.Persist(RalphJenkins);
     Session.Persist(Clarissa);
     Session.Persist(Baker);
     Session.Persist(Role1);
     Session.Persist(Location1);
     Data.AddEventTypesPersisted(1, Session);
     Event1.EventType = Data.EventTypes[0];
     Event1.Location  = Location1;
     Session.Persist(Event1);
     Set1.Event = Event1;
     Data.AddGenresPersisted(1, Session);
     Set1.Genre = Data.Genres[0];
     Session.Persist(Set1);
     Piece1.Set = Set1;
     Session.Persist(Piece1);
     Credit1.Artist = RalphJenkins;
     Credit1.Role   = Role1;
     Credit1.Piece  = Piece1;
     Credit2.Artist = RalphJenkins;
     Credit2.Role   = Role1;
     Credit2.Piece  = Piece1;
     Session.Persist(Credit1);
     Session.Persist(Credit2);
     Session.Commit();
     Session.BeginRead();
     RalphJenkins = QueryHelper.Read <Artist>(RalphJenkinsName, Session);
     Clarissa     = QueryHelper.Read <Artist>(ClarissaName, Session);
     Baker        = QueryHelper.Read <Artist>(BakerName, Session);
     Credit1      = QueryHelper.Read <Credit>(Credit1.SimpleKey, Piece1, Session);
     Credit2      = QueryHelper.Read <Credit>(Credit2.SimpleKey, Piece1, Session);
     Session.Commit();
 }
Пример #2
0
 public override void Setup()
 {
     base.Setup();
     DefaultAct        = Act.CreateDefault();
     DefaultNewsletter = Newsletter.CreateDefault();
     DefaultSeries     = Series.CreateDefault();
     Baker             = new Artist {
         QueryHelper = QueryHelper,
         Surname     = BakerName
     };
     Clarissa = new Artist {
         QueryHelper = QueryHelper,
         Forename    = ClarissaName
     };
     Drums = new Role {
         QueryHelper = QueryHelper,
         Name        = DrumsName
     };
     ElectricGuitar = new Role {
         QueryHelper = QueryHelper,
         Name        = ElectricGuitarName
     };
     Location1 = new Location {
         QueryHelper = QueryHelper,
         Name        = Location1Name
     };
     Event1 = new Event {
         QueryHelper = QueryHelper,
         Date        = Event1Date
     };
     Set1 = new Set {
         QueryHelper = QueryHelper,
         SetNo       = Set1SetNo
     };
     Piece1 = new TestPiece {
         QueryHelper = QueryHelper,
         PieceNo     = Piece1PieceNo
     };
     Piece2 = new TestPiece {
         QueryHelper = QueryHelper,
         PieceNo     = Piece2PieceNo
     };
     Credit1 = new Credit {
         QueryHelper = QueryHelper,
         CreditNo    = Credit1CreditNo
     };
     Credit2 = new Credit {
         QueryHelper = QueryHelper,
         CreditNo    = Credit2CreditNo
     };
     Credit3 = new Credit {
         QueryHelper = QueryHelper,
         CreditNo    = Credit3CreditNo
     };
     Session.BeginUpdate();
     Session.Persist(DefaultAct);
     Session.Persist(DefaultNewsletter);
     Session.Persist(DefaultSeries);
     Session.Persist(Baker);
     Session.Persist(Clarissa);
     Session.Persist(Drums);
     Session.Persist(ElectricGuitar);
     Session.Persist(Location1);
     Data.AddEventTypesPersisted(1, Session);
     Event1.EventType = Data.EventTypes[0];
     Event1.Location  = Location1;
     Session.Persist(Event1);
     Set1.Event = Event1;
     Data.AddGenresPersisted(1, Session);
     Set1.Genre = Data.Genres[0];
     Session.Persist(Set1);
     Piece1.Set = Set1;
     Piece2.Set = Set1;
     Session.Persist(Piece1);
     Session.Persist(Piece2);
     Credit1.Piece  = Piece1;
     Credit1.Artist = Baker;
     Credit1.Role   = Drums;
     Credit2.Piece  = Piece1;
     Credit2.Artist = Baker;
     Credit2.Role   = Drums;
     Credit3.Piece  = Piece2;
     Credit3.Artist = Baker;
     Credit3.Role   = Drums;
     Session.Persist(Credit1);
     Session.Persist(Credit2);
     Session.Persist(Credit3);
     Session.Commit();
     Session.BeginRead();
     FetchData();
     Session.Commit();
 }
Пример #3
0
 public override void Setup()
 {
     base.Setup();
     DefaultAct        = Act.CreateDefault();
     DefaultNewsletter = Newsletter.CreateDefault();
     DefaultSeries     = Series.CreateDefault();
     Location1         = new Location {
         QueryHelper = QueryHelper,
         Name        = Location1Name
     };
     EventType1 = new EventType {
         QueryHelper = QueryHelper,
         Name        = EventType1Name
     };
     Event1 = new Event {
         QueryHelper = QueryHelper,
         Date        = Event1Date
     };
     Event2 = new Event {
         QueryHelper = QueryHelper,
         Date        = Event2Date
     };
     Genre1 = new Genre {
         QueryHelper = QueryHelper,
         Name        = Genre1Name
     };
     Act1 = new Act {
         QueryHelper = QueryHelper,
         Name        = Act1Name
     };
     Act2 = new Act {
         QueryHelper = QueryHelper,
         Name        = Act2Name
     };
     Set1 = new Set {
         QueryHelper = QueryHelper,
         SetNo       = Set1SetNo,
         Notes       = Set1Notes,
         IsPublic    = false
     };
     Set1AtEvent2 = new Set {
         QueryHelper = QueryHelper,
         SetNo       = Set1SetNo
     };
     Set2 = new Set {
         QueryHelper = QueryHelper,
         SetNo       = Set2SetNo
     };
     Piece1 = new TestPiece {
         QueryHelper = QueryHelper,
         PieceNo     = Piece1PieceNo
     };
     Piece2 = new TestPiece {
         QueryHelper = QueryHelper,
         PieceNo     = Piece2PieceNo
     };
     Session.BeginUpdate();
     Session.Persist(DefaultAct);
     Session.Persist(DefaultNewsletter);
     Session.Persist(DefaultSeries);
     Session.Persist(EventType1);
     Session.Persist(Location1);
     Event1.Location  = Location1;
     Event2.Location  = Location1;
     Event1.EventType = EventType1;
     Event2.EventType = EventType1;
     Session.Persist(Event1);
     Session.Persist(Event2);
     Session.Persist(Act1);
     Session.Persist(Act2);
     Session.Persist(Genre1);
     Set1.Event         = Event1;
     Set1AtEvent2.Event = Event2;
     Set2.Event         = Event1;
     Set1.Genre         = Genre1;
     Set1AtEvent2.Genre = Genre1;
     Set2.Genre         = Genre1;
     Session.Persist(Set1);
     Session.Persist(Set2);
     Session.Persist(Set1AtEvent2);
     Set1.Act         = Act1;
     Set1AtEvent2.Act = Act2;
     Set2.Act         = Act1;
     Piece1.Set       = Set1;
     Piece2.Set       = Set1;
     Session.Persist(Piece1);
     Session.Persist(Piece2);
     Session.Commit();
     Session.BeginRead();
     FetchData();
     Session.Commit();
 }