public ActionResult AddArtist(artistinformation newArtist) { dustEntities ORM = new dustEntities(); ORM.artistinformations.Add(newArtist); ORM.SaveChanges(); return(RedirectToActionPermanent("AdminArtist")); }
public ActionResult SaveChanges(artistinformation UpdatedItem) { dustEntities ORM = new dustEntities(); //need this is every operation that takes in information //find the old record artistinformation OldRecord = ORM.artistinformations.Find(UpdatedItem.artistid); //ToDo check for null OldRecord.soundcloud = UpdatedItem.soundcloud; OldRecord.website = UpdatedItem.website; OldRecord.genre = UpdatedItem.genre; OldRecord.spotify = UpdatedItem.spotify; OldRecord.youtube = UpdatedItem.youtube; OldRecord.email = UpdatedItem.email; OldRecord.twitter = UpdatedItem.twitter; OldRecord.instagram = UpdatedItem.instagram; OldRecord.facebook = UpdatedItem.facebook; OldRecord.popularcity = UpdatedItem.popularcity; ORM.Entry(OldRecord).State = System.Data.Entity.EntityState.Modified; ORM.SaveChanges(); return(RedirectToAction("AdminArtist")); }