Ejemplo n.º 1
0
        void NeuerEintragToolStripMenuItemClick(object sender, EventArgs e)
        {
            var add = new AddContent();

            while (true)
            {
                if (add.ShowDialog(AddContent.Purpose.addNewMovie) == DialogResult.OK)
                {
                    var dbRet = database.getMediaByName(add.RetMedia.Name);
                    if (dbRet != null)
                    {
                        MessageBox.Show("Es gibt bereits einen Eintrag mit diesem Namen:" + Environment.NewLine +
                                        "Name: " + add.RetMedia.Name + Environment.NewLine +
                                        "Typ: " + add.RetMedia.Type + Environment.NewLine +
                                        "Genre: " + add.RetMedia.Genre + Environment.NewLine +
                                        "KA: " + add.RetMedia.KA + Environment.NewLine +
                                        "Bewertung: " + add.RetMedia.Rating + Environment.NewLine);
                        continue;
                    }
                    else
                    {
                        database.addNewEntry(add.RetMedia);
                        DisplayContentChanged(sender, e);
                    }
                }

                break;
            }
            add.Dispose();
        }
Ejemplo n.º 2
0
        void AddReptoolStripMenuItemClick(object sender, EventArgs e)
        {
            var add = new AddContent();

            if (add.ShowDialog(AddContent.Purpose.addRepDetails) == DialogResult.OK)
            {
                database.addDetail(add.RetMedia.ID, add.RetMedia.RepeatDetail);

                DisplayContentChanged(sender, e);
            }

            add.Dispose();
        }
Ejemplo n.º 3
0
        void EintragLöschenToolStripMenuItemClick(object sender, EventArgs e)
        {
            var add = new AddContent();

            if (add.ShowDialog(AddContent.Purpose.deleteMovie) == DialogResult.OK)
            {
                if (MessageBox.Show("Sicher das sie \"" + add.RetMedia.Name + "\" löschen möchten?", "Einträg löschen", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    database.deleteMedia(add.RetMedia);
                    PictureListItem temp = pictureListContent.getItemByMedia(add.RetMedia);
                    pictureListContent.remove(temp);
                }
            }

            add.Dispose();
            DisplayContentChanged(sender);
        }