Ejemplo n.º 1
0
 public CameraResult(CameraDTO config)
 {
     this.Config           = config;
     this.DownloadedPhotos = new List <PhotoDTO>();
     this.DownloadedVideos = new List <VideoDTO>();
     this.DeletedFiles     = new List <DeletedFileDTO>();
 }
Ejemplo n.º 2
0
        private Camera GetCameraFromDTO(CameraDTO camDTO)
        {
            Camera cam = Service.CreateCamera();

            CameraDTO.GetAttributesFromDTO(camDTO, cam);
            if (camDTO.Floor != null)
            {
                cam.Floor = FloorService.GetFloor((Guid)camDTO.Floor);
            }
            else
            {
                cam.Floor = null;
            }

            //if (camDTO.People != null)
            // {
            //    foreach (Guid personGuid in camDTO.People) cam.People.Add(PersonService.GetPerson(personGuid));
            // }
            //Seems like we need a person type service too.
            if (cam.PersonTypes == null)
            {
                cam.PersonTypes = new List <PersonType>();
            }
            return(cam);
        }
Ejemplo n.º 3
0
        public Camera GetCamera(CameraDTO cameraConf)
        {
            var cam = new Camera
            {
                Alias             = cameraConf.Alias,
                DestinationFolder = cameraConf.DestinationFolder,
                IpAddress         = cameraConf.IpAddress,
                PortNumber        = cameraConf.PortNumber,
                UserName          = cameraConf.UserName,
            };

            return(cam);
        }
Ejemplo n.º 4
0
        // PUT: api/Cameras
        //The parameter is completely optional as we do have the Guid inside the camera DTO.
        public void Put([FromBody] CameraDTO camDTO)
        {
            Camera cam = GetCameraFromDTO(camDTO);

            Service.Update(cam);
        }
Ejemplo n.º 5
0
        // POST: api/Cameras
        public void Post([FromBody] CameraDTO camDTO)
        {
            Camera cam = GetCameraFromDTO(camDTO);

            Service.AddCamera(cam);
        }