Ejemplo n.º 1
0
        public System.Guid AddMusician(MusicGroupsFolder.Musician musician)  // Pridani do databaze hudebnika
        {
            Musician tmpMusician = new Musician()
            {
                MusicianName        = musician.Name,
                MusicianSurname     = musician.Surname,
                MusicianDateBirth   = musician.DateOfBirth,
                MusicianInstrument  = musician.MusicianInstrument,
                MusicianNationality = musician.Nationality,
                MusicianSex         = musician.Sex
            };

            try
            {
                _database.Musicians.InsertOnSubmit(tmpMusician);
                _database.SubmitChanges();
            }
            catch (Exception e)
            {
                ErrorString = e.Message;
                MessageBox.Show("Nepodařilo se přidat hudebníka do databáze!\n\n" + ErrorString);
            }

            return(tmpMusician.MusicianID);
        }
Ejemplo n.º 2
0
 partial void UpdateMusician(Musician instance);
Ejemplo n.º 3
0
 partial void DeleteMusician(Musician instance);
Ejemplo n.º 4
0
 partial void InsertMusician(Musician instance);