Ejemplo n.º 1
0
 static void Main()
 {
     SimpleAccessControl.getInstance().openDatabase();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new MainForm());
     SimpleAccessControl.getInstance().closeDatabase();
 }
Ejemplo n.º 2
0
        private void populateDataGrid()
        {
            lwMain.Items.Clear();
            List <Artist> artists = SimpleAccessControl.getInstance().listArtistsAndAlbums();

            foreach (Artist artist in artists)
            {
                if (artist.Albums.Count == 0)
                {
                    ListViewItem item = new ListViewItem(artist.Name);
                    lwMain.Items.Add(item);
                }
                else
                {
                    foreach (Album album in artist.Albums)
                    {
                        ListViewItem item = new ListViewItem(artist.ToString());
                        item.SubItems.Add(album.CdName);
                        item.SubItems.Add(album.CdYear);
                        lwMain.Items.Add(item);
                    }
                }
            }
        }
 private void btnAdd_Click(object sender, EventArgs e)
 {
     SimpleAccessControl.getInstance().addArtist(tbArtist.Text);
     this.Close();
 }