Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TrackSet trackset = db.TrackSet.Find(id);

            db.TrackSet.Remove(trackset);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public RibbonApp()
        {
            // Creation logic
            ShapesModel  = new TrackSet();
            TouchSurface = new Surface(this);

            // Wire up UIs
            SetupOtherUI();
        }
Пример #3
0
 public ActionResult Edit([Bind(Include = "Id,album,title,track,artist,genre,filename,runningtime,date,weight")] TrackSet trackset)
 {
     if (ModelState.IsValid)
     {
         db.Entry(trackset).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(trackset));
 }
Пример #4
0
        public ActionResult Create([Bind(Include = "Id,album,title,track,artist,genre,filename,runningtime,date,weight")] TrackSet trackset)
        {
            if (ModelState.IsValid)
            {
                db.TrackSet.Add(trackset);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(trackset));
        }
Пример #5
0
        // GET: /Browser/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TrackSet trackset = db.TrackSet.Find(id);

            if (trackset == null)
            {
                return(HttpNotFound());
            }
            return(View(trackset));
        }
Пример #6
0
        // after refreshRibbons
        private void truncateTheTracks()
        {
            var      now         = DateTime.Now;
            var      tobeRemoved = new List <Track>();
            TrackSet tracks      = (TrackSet)_ribbonSet.tracks;

            foreach (Track t in tracks)
            {
                cleanup(t, now);
                if (t.isClosed() && t.Count == 0)
                {
                    tobeRemoved.Add(t);
                }
            }

            tobeRemoved.ForEach(t => ((TrackSet)_ribbonSet.tracks).remove(t));
        }
Пример #7
0
 public RibbonSet(TrackSet ts)
 {
     Tracks = ts;
 }
Пример #8
0
 public RibbonSet(TrackSet ts)
 {
     tracks = ts;
     setup(); // todo AOP Tricks
 }