Пример #1
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();
            }
        }
Пример #2
0
 public void SetupData(Album p_oAlbum)
 {
     txtAlbumName.Text = p_oAlbum.Name;
     dtpReleaseDate.Value = p_oAlbum.ReleaseDate.Value;
     ddlArtist.SelectedValue = p_oAlbum.Artist;
 }
Пример #3
0
 public AlbumEdit(Album p_oAlbum)
 {
     SetupData(p_oAlbum);
 }