public async Task <TestReagentRelation> DeleteTestReagentRelation(TestReagentRelation testReagentRelation)
        {
            var url = URLBuilder.GetURL(Controllers.REAGENT, EndPoint.TEST_REAGENT_RELATIONS_DELETE);

            return(await requestProvider.DeleteAsync(url, testReagentRelation, new Dictionary <string, string> {
                ["id"] = testReagentRelation.Id.ToString()
            }));
        }
 public ActionResult UpdateTestReagentRelation(TestReagentRelation testReagentRelation)
 {
     if (testReagentRelation != null)
     {
         try
         {
             _reagentService.UpdateTestReagentRelation(testReagentRelation);
         }
         catch (Exception e)
         {
             Program.Logger.Error(e);
             return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "Failed", "Error occurred while updating the test reagent relation"))));
         }
         return(Ok(GetResponse(ResponseType.ACK, ResponseStatusCode.SUCCESS)));
     }
     else
     {
         return(BadRequest(GetResponse(ResponseType.ERROR, ResponseStatusCode.ERROR, GetError(ErrorCodes.invalidData, "Invalid input", "Please enter proper test reagent relation details"))));
     }
 }
Example #3
0
        public void UpdateTestReagentRelation(TestReagentRelation testReagentRelation)
        {
            var relationFromDb = _testReagentRelationRepository.Get(testReagentRelation.Id);

            if (relationFromDb != null)
            {
                relationFromDb.ModifiedBy   = testReagentRelation.ModifiedBy;
                relationFromDb.ModifiedDate = testReagentRelation.ModifiedDate;
                relationFromDb.ReagentId    = testReagentRelation.ReagentId;
                relationFromDb.OtherTestId  = testReagentRelation.OtherTestId;
                relationFromDb.QtyPerTest   = testReagentRelation.QtyPerTest;
                relationFromDb.Unit         = testReagentRelation.Unit;

                _testReagentRelationRepository.Update(relationFromDb);
            }
            else
            {
                throw new Exception("Test reagent relation does not exist");
            }
        }
        public async Task <TestReagentRelation> AddNewTesetReagentRelation(TestReagentRelation testReagentRelation)
        {
            var url = URLBuilder.GetURL(Controllers.REAGENT, EndPoint.TEST_REAGENT_RELATIONS_ADD);

            return(await requestProvider.PostAsync(url, testReagentRelation));
        }
        public async Task <TestReagentRelation> UpdateTestReagentRelation(TestReagentRelation testReagentRelation)
        {
            var url = URLBuilder.GetURL(Controllers.REAGENT, EndPoint.TEST_REAGENT_RELATIONS_UPDATE);

            return(await requestProvider.PutAsync(url, testReagentRelation));
        }
Example #6
0
 public void InsertTestReagentRelation(TestReagentRelation testReagentRelation)
 {
     _testReagentRelationRepository.Insert(testReagentRelation);
 }