public async Task <Abbrevations> DeleteAbbrevation(Abbrevations abbrevation) { var url = URLBuilder.GetURL(Controllers.MAINTENANCE, EndPoint.MAINTENANCE_ABBREVATION_DELETE); return(await requestProvider.DeleteAsync(url, abbrevation, new Dictionary <string, string> { ["id"] = abbrevation.Id.ToString() })); }
public void UpdateAbbrevation(Abbrevations abbrevation) { var abbrevationFromDb = _abbreavationsRepository.Get(abbrevation.Id); if (abbrevationFromDb != null) { _util.CopyProperties(abbrevation, abbrevationFromDb); _abbreavationsRepository.Update(abbrevationFromDb); } else { throw new Exception("This abbrevation is not available"); } }
public ActionResult UpdateAbbrInterp(Abbrevations abbrevation) { if (abbrevation != null) { try { maintenanceService.UpdateAbbrevation(abbrevation); } catch (Exception e) { Program.Logger.Error(e); return(Ok(GetResponse(ResponseType.FAIL, ResponseStatusCode.FAIL, GetError(ErrorCodes.dataNotFound, "Failed", "Error occurred while updating the abbrevation details")))); } return(Ok(GetResponse(ResponseType.ACK, ResponseStatusCode.SUCCESS))); } else { return(BadRequest(GetResponse(ResponseType.ERROR, ResponseStatusCode.ERROR, GetError(ErrorCodes.invalidData, "Invalid input", "Please enter proper abbrevation details")))); } }
public async Task <Abbrevations> AddNewAbbrevation(Abbrevations abbrevation) { var url = URLBuilder.GetURL(Controllers.MAINTENANCE, EndPoint.MAINTENANCE_ABBREVATION_INSERT); return(await requestProvider.PostAsync(url, abbrevation)); }
public async Task <Abbrevations> UpdateAbbrevation(Abbrevations abbrevation) { var url = URLBuilder.GetURL(Controllers.MAINTENANCE, EndPoint.MAINTENANCE_ABBREVATION_UPDATE); return(await requestProvider.PutAsync(url, abbrevation)); }
public void InsertAbbrevation(Abbrevations abbrevation) { _abbreavationsRepository.Insert(abbrevation); }