Exemplo n.º 1
0
        public IHttpActionResult UpdateMediaShelf(UpdateDetail model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            _updateService.UpdateMediaShelf(model);

            return(Ok());
        }
Exemplo n.º 2
0
        public IHttpActionResult UpdateHandlebarPost(UpdateDetail model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            _updateService.UpdateHandlebarPost(model);

            return(Ok());
        }
Exemplo n.º 3
0
        public IHttpActionResult UpdateSprintShiftType(UpdateDetail model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            _updateService.UpdateSprintShiftType(model);

            return(Ok());
        }
Exemplo n.º 4
0
        public IHttpActionResult UpdateTabletHolder(UpdateDetail model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            _updateService.UpdateTabletHolder(model);

            return(Ok());
        }
Exemplo n.º 5
0
        public IHttpActionResult UpdateStagesBikeNumberPlate(UpdateDetail model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            _updateService.UpdateStagesBikeNumberPlate(model);

            return(Ok());
        }
Exemplo n.º 6
0
 public void RemapLocationLink(UpdateDetail updateDetail, IUrlHelper Url, HttpRequest Request)
 {
     if (updateDetail.Resource != null)
     {
         // First element is the controller
         // Second element is the method
         // Third element is the id name
         string[] paths    = updateDetail.Resource.Location.Split('.');
         var      location = Url.Action(paths[1], paths[0], new Dictionary <string, string> {
             { paths[2], updateDetail.Resource.Id }
         }, Request.Scheme);
         updateDetail.Resource.Location = location;
     }
 }
Exemplo n.º 7
0
        public void UpdateHandlebarPost(UpdateDetail model)
        {
            var repo = _unitOfWork.GetRepository <HandlebarPost>();

            var itemToUpdate = repo.Get(model.Id);

            if (itemToUpdate == null)
            {
                throw new ArgumentNullException();
            }

            if (model.BasePrice.HasValue)
            {
                itemToUpdate.BasePrice = model.BasePrice.Value;
            }

            if (!String.IsNullOrEmpty(model.Title))
            {
                itemToUpdate.Title = model.Title;
            }

            repo.Update(itemToUpdate);
            _unitOfWork.Save();
        }