public async Task <IActionResult> Find([FromBody] List <ObjectId> screenIds)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _screenRepository.Find(screenIds);
     }));
 }
Ejemplo n.º 2
0
 public async Task <IActionResult> Search([FromQuery] ItemSearchRequest requestArgs)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _itemRepository.Search(requestArgs);
     }));
 }
Ejemplo n.º 3
0
 public async Task <IActionResult> Post([FromBody] ProjectRelease release)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _projectRepository.Add(release);
     }));
 }
Ejemplo n.º 4
0
 public async Task <IActionResult> Post([FromBody] TestCase testCaseR)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _testCaseRepository.Add(testCaseR);
     }));
 }
 public async Task <IActionResult> Post([FromBody] ItemType item)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _itemTypeRepository.Add(item);
     }));
 }
Ejemplo n.º 6
0
 public async Task <IActionResult> Search([FromQuery] TestCaseSearchRequest searchRequest)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _testCaseRepository.Search(searchRequest);
     }));
 }
 public async Task <IActionResult> Post([FromBody] DashboardPanel item)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _dashboardPanelRepository.Add(item);
     }));
 }
 public async Task <IActionResult> Get(string id)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _dashboardPanelRepository.Get(new ObjectId(id));
     }));
 }
 public async Task <IActionResult> Get()
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _dashboardPanelRepository.GetAll();
     }));
 }
Ejemplo n.º 10
0
 public async Task <IActionResult> Get(string id, [FromQuery] string expand = null)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _itemRepository.Get(new ObjectId(id), new ItemExpansionParams(expand));
     }));
 }
Ejemplo n.º 11
0
 public async Task <IActionResult> Get()
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _workflowTransitionRepository.GetAll();
     }));
 }
Ejemplo n.º 12
0
 public async Task <IActionResult> Get(string id)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _workflowTransitionRepository.Get(new ObjectId(id));
     }));
 }
Ejemplo n.º 13
0
        public async Task <IActionResult> Get([FromQuery] string imageFileName)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                if (string.IsNullOrEmpty(imageFileName))
                {
                    return "";
                }

                var url = string.Concat(
                    "https://meticulos.blob.core.windows.net/images/",
                    imageFileName);

                var blob = new CloudBlockBlob(new Uri(url), GetStorageCredentials());
                if (await blob.ExistsAsync())
                {
                    await blob.FetchAttributesAsync();
                    byte[] imageBytes = new byte[blob.Properties.Length];
                    await blob.DownloadToByteArrayAsync(imageBytes, 0);
                    return Convert.ToBase64String(imageBytes);
                }

                return "";
            }));
        }
Ejemplo n.º 14
0
 public async Task <IActionResult> Post([FromBody] WorkflowTransition item)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _workflowTransitionRepository.Add(item);
     }));
 }
Ejemplo n.º 15
0
 public async Task <IActionResult> Put(string id, [FromBody] WorkflowTransition item)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         item.Id = new ObjectId(id);
         return await _workflowTransitionRepository.Update(item);
     }));
 }
 public async Task <IActionResult> Put(string id, [FromBody] DashboardPanel item)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         item.Id = new ObjectId(id);
         return await _dashboardPanelRepository.Update(item);
     }));
 }
Ejemplo n.º 17
0
 public async Task <IActionResult> Put(string id, [FromBody] ProjectRelease release)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         release.Id = new ObjectId(id);
         return await _projectRepository.Update(release);
     }));
 }
Ejemplo n.º 18
0
 public async Task <IActionResult> Put(string id, [FromBody] TestCase testCaseR)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         testCaseR.Id = new ObjectId(id);
         return await _testCaseRepository.Update(testCaseR);
     }));
 }
Ejemplo n.º 19
0
        public async Task <IActionResult> Post([FromBody] FieldChangeGroup item)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() => {
                if (item.ItemId == ObjectId.Empty)
                {
                    throw new ApplicationException("Required fields not supplied.");
                }

                return await _fieldChangeGroupRepository.Add(item);
            }));
        }
        public async Task <IActionResult> Post([FromBody] Screen screen)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                if (string.IsNullOrEmpty(screen.Name))
                {
                    throw new System.Exception("Required fields not supplied.");
                }

                return await _screenRepository.Add(screen);
            }));
        }
Ejemplo n.º 21
0
        public async Task <IActionResult> Post([FromBody] Item item)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() => {
                if (string.IsNullOrEmpty(item.Name) ||
                    item.TypeId == ObjectId.Empty)
                {
                    throw new ApplicationException("Required fields not supplied.");
                }

                return await _itemRepository.Add(item);
            }));
        }
        public async Task <IActionResult> Search([FromQuery] WorkflowTransitionFunctionSearchRequest requestArgs)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                if (string.IsNullOrEmpty(requestArgs.TransitionId))
                {
                    throw new ApplicationException("Search parameters missing.");
                }

                return await _workflowTransitionFunctionRepository.Search(requestArgs);
            }));
        }
Ejemplo n.º 23
0
        public async Task <IActionResult> Search([FromQuery] WorkflowNodeSearchRequest requestArgs)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                if (string.IsNullOrEmpty(requestArgs.WorkflowId))
                {
                    throw new System.Exception("Invalid search parameters supplied.");
                }

                return await _workflowNodeRepository.Search(new ObjectId(requestArgs.WorkflowId));
            }));
        }
Ejemplo n.º 24
0
        public async Task <IActionResult> Search([FromQuery] WorkflowTransitionSearchRequest requestArgs)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                if (string.IsNullOrEmpty(requestArgs.WorkflowId) && string.IsNullOrEmpty(requestArgs.FromNodeId))
                {
                    throw new System.Exception("Valid search criteria not supplied.");
                }

                return await _workflowTransitionRepository.Search(requestArgs);
            }));
        }
Ejemplo n.º 25
0
        public async Task <IActionResult> Search([FromQuery] WorkflowFunctionSearchRequest requestArgs)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                if (!Enum.IsDefined(typeof(WorkflowFunctionTypes), requestArgs.Type))
                {
                    throw new ApplicationException("Invalid function type specified.");
                }

                return await _workflowFunctionRepository.Search(requestArgs);
            }));
        }
Ejemplo n.º 26
0
        public async Task <IActionResult> Search([FromQuery] FieldChangeGroupSearchRequest requestArgs)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                if (string.IsNullOrEmpty(requestArgs.ItemId) ||
                    ObjectId.Parse(requestArgs.ItemId) == ObjectId.Empty)
                {
                    throw new ApplicationException("Search parameters missing or invalid.");
                }

                return await _fieldChangeGroupRepository.Search(new ObjectId(requestArgs.ItemId));
            }));
        }
        public async Task <IActionResult> Put(string id, [FromBody] Screen screen)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                if (string.IsNullOrEmpty(screen.Name))
                {
                    throw new System.Exception("Required fields not supplied.");
                }

                screen.Id = new ObjectId(id);
                return await _screenRepository.Update(screen);
            }));
        }
Ejemplo n.º 28
0
        public async Task <IActionResult> Post([FromBody] WorkflowNode item)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                var newNode = await _workflowNodeRepository.Add(item);
                // Update workflow's Nodes list
                var wf = await _workflowRepository.Get(item.WorkflowId);
                if (wf.Nodes == null)
                {
                    wf.Nodes = new List <ObjectId>();
                }
                wf.Nodes.Add(item.Id);
                await _workflowRepository.Update(wf);

                return newNode;
            }));
        }
Ejemplo n.º 29
0
        public async Task <IActionResult> Post([FromBody] ItemImagePostRequest request)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() => {
                byte[] imgBytes = Convert.FromBase64String(request.ImageData);

                var url = string.Concat(
                    "https://meticulos.blob.core.windows.net/images/",
                    request.FileName);

                var blob = new CloudBlockBlob(new Uri(url), GetStorageCredentials());

                if (!(await blob.ExistsAsync()))
                {
                    await blob.UploadFromByteArrayAsync(imgBytes, 0, imgBytes.Length);
                }

                return new ItemImage()
                {
                    Url = url
                };
            }));
        }
        public async Task <IActionResult> Post([FromBody] WorkflowTransitionFunctionPostRequest request)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() =>
            {
                if (request.TransitionId == ObjectId.Empty)
                {
                    throw new ApplicationException("TransitionId is required.");
                }

                if (request.FunctionId == ObjectId.Empty)
                {
                    throw new ApplicationException("FunctionId is required.");
                }

                var transFunction = new WorkflowTransitionFunction()
                {
                    TransitionId = request.TransitionId,
                    FunctionId = request.FunctionId,
                    FunctionArgs = request.FunctionArgs
                };
                return await _workflowTransitionFunctionRepository.Add(transFunction);
            }));
        }