public void UpdateArtist(ModifyArtistModel model) { try { using (var context = new sparrow_dbEntities()) { var userId = GetUserId(model.UserEmail); var artist = context.SPRW_ARTIST.FirstOrDefault(i => i.ARTIST_ID == model.ArtistId); if (artist != null) { artist.ACT_IND = model.Active; artist.NAME = model.Name; artist.DESCRP = model.Description; artist.LAST_MAINT_TIME = DateTime.Now; artist.LAST_MAINT_USER_ID = model.UserEmail; } context.SaveChanges(); } } catch (Exception e) { throw e; } }
public HttpResponseMessage UpdateArtist([FromBody] ModifyArtistModel model) { if (_security.Verify(model.Token, model.UserEmail)) { try { _artist.UpdateArtist(model); return(Request.CreateResponse(HttpStatusCode.Created)); } catch (Exception e) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } } return(Request.CreateResponse(HttpStatusCode.BadRequest)); }
public void UpdateArtist(ModifyArtistModel model) { Repository.UpdateArtist(model); }