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)); }
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()); }
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)); }
public void addUserSong(usersong u) { db.userSongList.Add(u); db.SaveChanges(); }