Esempio n. 1
0
        public IHttpActionResult UpdateVideoCout(video v)
        {
            var videoupdate = db.videoList.Find(v.videoID);

            videoupdate.videoID          = v.videoID;
            videoupdate.videoName        = v.videoName;
            videoupdate.videoPic         = v.videoPic;
            videoupdate.videoSource      = v.videoSource;
            videoupdate.videoListened    = v.videoListened;
            videoupdate.videoTimerelease = v.videoTimerelease;
            db.Entry(videoupdate).State  = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            return(Ok(videoupdate));
        }
Esempio n. 2
0
 public ActionResult Register(users us)
 {
     if (ModelState.IsValid)
     {
         using (DTcontext db = new DTcontext())
         {
             db.userList.Add(us);
             db.SaveChanges();
         }
         ModelState.Clear();
         ViewBag.Message = us.userName + " Register success";
     }
     return(View());
 }
Esempio n. 3
0
        public IHttpActionResult UpdateSongCout(song s)
        {
            var songupdate = db.songList.Find(s.songCode);

            songupdate.songName        = s.songName;
            songupdate.songPicture     = s.songPicture;
            songupdate.albumID         = s.albumID;
            songupdate.songCode        = s.songCode;
            songupdate.songSinger      = s.songSinger;
            songupdate.songSource      = s.songSource;
            songupdate.songType        = s.songType;
            songupdate.songListened    = s.songListened;
            songupdate.timRelease      = s.timRelease;
            db.Entry(songupdate).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            return(Ok(songupdate));
        }
Esempio n. 4
0
 public void addUserSong(usersong u)
 {
     db.userSongList.Add(u);
     db.SaveChanges();
 }