コード例 #1
0
        public ActionResult GetAllReagents()
        {
            var reagents      = _reagentService.GetReagents().ToList();
            var responseModel = new ReagentResponseModel {
                Reagents = reagents
            };

            if (responseModel != null)
            {
                return(Ok(GetResponse(ResponseType.OBJECT, ResponseStatusCode.SUCCESS, responseModel)));
            }
            else
            {
                return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "No reagents found", "Please add a reagent"))));
            }
        }
コード例 #2
0
        public ActionResult GetAllTestReagentRelations()
        {
            var relations     = _reagentService.GetTestReagentRelations().ToList();
            var reagents      = _reagentService.GetReagents().ToList();
            var tests         = _testsService.GetOtherTests().ToList();
            var responseModel = new ReagentResponseModel {
                TestReagentRelations = relations, Reagents = reagents, Tests = tests
            };

            if (responseModel != null)
            {
                return(Ok(GetResponse(ResponseType.OBJECT, ResponseStatusCode.SUCCESS, responseModel)));
            }
            else
            {
                return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "No test reagent relation found", "Please add a new one"))));
            }
        }