public HttpResponseMessage Reorder(int conferenceId) { var raw = new System.IO.StreamReader(HttpContext.Current.Request.InputStream).ReadToEnd(); var data = JsonConvert.DeserializeObject <List <Order> >(raw); ISpeakerRepository _repository = SpeakerRepository.Instance; foreach (Order no in data) { var speaker = _repository.GetSpeaker(conferenceId, no.id); if (speaker != null) { speaker.Sort = no.order; _repository.UpdateSpeaker(speaker.GetSpeakerBase(), UserInfo.UserID); } } return(Request.CreateResponse(HttpStatusCode.OK, "")); }
public Speaker UpdateSpeaker(Speaker speaker) { var updateSpeaker = _speakerRepository.ReadSpeakerById(speaker.SpeakerId); if (updateSpeaker == null) { throw new InvalidDataException("Can not read speaker with no brand"); } updateSpeaker.SpeakerName = speaker.SpeakerName; updateSpeaker.SpeakerDescription = speaker.SpeakerDescription; updateSpeaker.SpeakerBrand = speaker.SpeakerBrand; updateSpeaker.Price = speaker.Price; updateSpeaker.Color = speaker.Color; updateSpeaker.Url = speaker.Url; updateSpeaker.Brand = speaker.Brand; return(_speakerRepository.UpdateSpeaker(updateSpeaker)); }
public Speaker Update(Speaker speakerToModify) { return(repo.UpdateSpeaker(speakerToModify)); }
public IActionResult UpdateSpeaker(SpeakerModel speaker) { _speakerRepository.UpdateSpeaker(speaker); return(Ok()); }