public async Task <ReagentBillEntries> DeleteReagentEntry(ReagentBillEntries reagentEntry)
        {
            var url = URLBuilder.GetURL(Controllers.REAGENT, EndPoint.REAGENT_ENTRY_DELETE);

            return(await requestProvider.DeleteAsync(url, reagentEntry, new Dictionary <string, string> {
                ["id"] = reagentEntry.Id.ToString()
            }));
        }
Example #2
0
        public void UpdateReagentEntry(ReagentBillEntries reagentEntry)
        {
            var reagentEntryFromDb = _reagentEntriesRepository.Get(reagentEntry.Id);

            if (reagentEntryFromDb != null)
            {
                _util.CopyProperties(reagentEntry, reagentEntryFromDb);
                _reagentEntriesRepository.Update(reagentEntryFromDb);
            }
            else
            {
                throw new Exception("This reagent entry does not exist");
            }
        }
 public ActionResult UpdateReagentEntry(ReagentBillEntries reagentEntry)
 {
     if (reagentEntry != null)
     {
         try
         {
             _reagentService.UpdateReagentEntry(reagentEntry);
         }
         catch (Exception e)
         {
             Program.Logger.Error(e);
             return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "Failed", "Error occurred while updating the reagent entry details"))));
         }
         return(Ok(GetResponse(ResponseType.ACK, ResponseStatusCode.SUCCESS)));
     }
     else
     {
         return(BadRequest(GetResponse(ResponseType.ERROR, ResponseStatusCode.ERROR, GetError(ErrorCodes.invalidData, "Invalid input", "Please enter proper reagent entry details"))));
     }
 }
        public async Task <ReagentBillEntries> AddNewReagentEntry(ReagentBillEntries reagentEntry)
        {
            var url = URLBuilder.GetURL(Controllers.REAGENT, EndPoint.REAGENT_ENTRY_INSERT);

            return(await requestProvider.PostAsync(url, reagentEntry));
        }
        public async Task <ReagentBillEntries> UpdateReagentEntry(ReagentBillEntries reagentEntry)
        {
            var url = URLBuilder.GetURL(Controllers.REAGENT, EndPoint.REAGENT_ENTRY_UPDATE);

            return(await requestProvider.PutAsync(url, reagentEntry));
        }
Example #6
0
 public void InsertReagentEntry(ReagentBillEntries reagentEntry)
 {
     _reagentEntriesRepository.Insert(reagentEntry);
 }