Exemple #1
0
 public ActionResult ChangeImageLocation(ImageLocationModel model)
 {
     if (!_imageService.ChangeImageLocation(model))
     {
         return(Error("Images does not exist",
                      $"There are no images with workorderID: {model.WorkOrderId}. images == null"));
     }
     return(Success());
 }
Exemple #2
0
        public bool ChangeImageLocation(ImageLocationModel model)
        {
            var images       = repository.SearchFor <SageImageWorkOrder>(x => x.WorkOrder == model.WorkOrderId).SingleOrDefault();
            var changedImage = images?.Images.SingleOrDefault(x => x.Id == model.PictureId && !x.IsDeleted);

            if (changedImage == null)
            {
                return(false);
            }

            changedImage.Latitude  = model.Latitude;
            changedImage.Longitude = model.Longitude;
            repository.Update(images);
            return(true);
        }