Example #1
0
        public MediaPlayer(Liedje liedje, string filename)
        {
            InitializeComponent();

            DoNotTriggerUpdateEvent = true;
            selectionPanel.Size     = new Size(this.Size.Width, this.Size.Height);
            fadeinPanel.Size        = new Size(0, this.Size.Height);
            fadeoutPanel.Size       = new Size(0, this.Size.Height);
            currentPanel.Size       = new Size(3, this.Size.Height);

            this.filename = filename;

            if (filename != "")
            {
                lengte = liedje.Lengte;

                wmp = new AxWMPLib.AxWindowsMediaPlayer();
                wmp.CreateControl();
                wmp.URL              = filename;
                wmp.PlayStateChange += wmp_PlayStateChange;
                wmp.Ctlcontrols.stop();
                ChangeButtonText("Play");

                label3.Text = liedje.Artiest + " / " + liedje.Titel;
                label4.Text = "0.00 / 0.00";

                numericUpDown1.Maximum = (decimal)lengte;
                numericUpDown2.Maximum = (decimal)lengte;
                numericUpDown3.Maximum = (decimal)lengte;
                numericUpDown3.Value   = (decimal)lengte;

                UpdateSelection();
            }
        }
Example #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Liedje liedje = _db.Table.Find(id);

            _db.Table.Remove(liedje);
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #3
0
 public ActionResult Edit([Bind(Include = "Id,Titel,Artiest,Jaar,Plaats")] Liedje liedje)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(liedje).State = EntityState.Modified;
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(liedje));
 }
Example #4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Liedje liedje = _db.Table.Find(id);

            if (liedje == null)
            {
                return(HttpNotFound());
            }
            return(View(liedje));
        }
Example #5
0
        public ActionResult Create(Liedje newLiedje)
        {
            if (ModelState.IsValid)
            {
                _db.Table.Add(newLiedje);
                _db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(newLiedje));
            }
        }
Example #6
0
        private ICollection <Liedje> MakeLiedjes()
        {
            JsonTextReader reader = new JsonTextReader(
                new StreamReader($"{Directory.GetCurrentDirectory()}{_jsonName}"));

            using (reader)
            {
                JObject obj = (JObject)JToken.ReadFrom(reader);

                List <Liedje> liedjesList = new List <Liedje>();
                List <String> edList      = new List <String>();

                Artist lomepal = new Artist();
                lomepal.naam  = "Lomepal";
                lomepal.groep = "false";

                Artist ed = new Artist();
                ed.naam  = "Ed Sheeran";
                ed.groep = "false";

                JArray edx = ((JArray)obj.GetValue("x"));
                foreach (String s in edx)
                {
                    Liedje edsong = new Liedje();
                    edsong.taal   = "English";
                    edsong.genre  = "Sloft";
                    edsong.title  = s;
                    edsong.artist = ed;
                    liedjesList.Add(edsong);
                }
                JArray lomepalamina = ((JArray)obj.GetValue("amina"));
                foreach (String s in lomepalamina)
                {
                    Liedje lomepaleSong = new Liedje();
                    lomepaleSong.taal   = "French";
                    lomepaleSong.genre  = "Rap";
                    lomepaleSong.title  = s;
                    lomepaleSong.artist = lomepal;
                    liedjesList.Add(lomepaleSong);
                }


                return(liedjesList);
            }
        }
        public ActionResult <Liedje> DeleteAlbum(int id)
        {
            try
            {
                Liedje l = _liedjeRepository.GetById(id);

                if (l == null)
                {
                    return(null);
                }

                _liedjeRepository.Remove(l);
                _liedjeRepository.saveChanges();

                return(l);
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
 public IActionResult UpdateMenu(Liedje liedje)
 {
     _liedjeRepository.Update(liedje);
     return(Ok());
 }
 public IActionResult createAlbum(Liedje liedje)
 { //Geef AterlierDTO en controleer de HTTPPut
     _liedjeRepository.Add(liedje);
     _liedjeRepository.saveChanges();
     return(Ok());
 }
 public void Update(Liedje liedje)
 {
     _liedjes.Update(liedje);
 }
 public void Remove(Liedje liedje)
 {
     _liedjes.Remove(liedje);
 }
        public IEnumerable <Liedje> GeefById(long id)
        {
            Liedje hier = GetById(id);

            return(_liedjes.Where(l => l.genre == hier.genre && l.taal == hier.taal && l.ID != id).Take(3).ToList());
        }
 public void Add(Liedje liedje)
 {
     _liedjes.Add(liedje);
 }