예제 #1
0
        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, ""));
        }
예제 #2
0
        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));
        }
예제 #3
0
 public Speaker Update(Speaker speakerToModify)
 {
     return(repo.UpdateSpeaker(speakerToModify));
 }
 public IActionResult UpdateSpeaker(SpeakerModel speaker)
 {
     _speakerRepository.UpdateSpeaker(speaker);
     return(Ok());
 }