Beispiel #1
0
        public void SaveData()
        {
            Artist oArtist = new Artist();
            oArtist.ArtistName = txtArtist.Text;
            oArtist.Description = txtBioInfo.Text;
            oArtist.Genre = txtGenre.Text;
            oArtist.LastUpdate = DateTime.Now;

            using (VinylDBContext db = new VinylDBContext())
            {
                db.Artists.Add(oArtist);
                db.SaveChanges();
            }
        }
Beispiel #2
0
        public void SaveData()
        {
            Album oAlbum = new Album();
            oAlbum.Name = txtAlbumName.Text;
            oAlbum.ArtistID = (ddlArtist.SelectedValue as ArtistDropDownDisplay).ArtistId;
            oAlbum.LastUpdate = DateTime.Now;
            oAlbum.Quantity = 1;
            oAlbum.ReleaseDate = dtpReleaseDate.Value;

            using (VinylDBContext db = new VinylDBContext())
            {
                db.Albums.Add(oAlbum);
                db.SaveChanges();
            }
        }