public void CreateClaim(string createxml) { try { _repository.CreateNewClaimType(createxml); } catch (FaultException fault) { MitchellFault _fault = new MitchellFault(); _fault.Message = fault.Message; throw new FaultException <MitchellFault>(_fault, "Unable to create the MitchellClaim"); } }
public void DeleteClaim(string ClaimNumber) { try { _repository.DeleteClaimType(ClaimNumber); } catch (FaultException fault) { MitchellFault _fault = new MitchellFault(); _fault.Message = fault.Message; throw new FaultException <MitchellFault>(_fault, "Unable to delete the MitchellClaim"); } }
public void UpdateClaim(string updatexml) { updatexml = File.ReadAllText(@"D:\Documents\update-claim.xml"); try { _repository.UpdateClaimType(updatexml); } catch (FaultException fault) { MitchellFault _fault = new MitchellFault(); _fault.Message = fault.Message; throw new FaultException <MitchellFault>(_fault, "Unable to update the MitchellClaim"); } }
public List <string> GetClaimByDate(DateTime FromDate, DateTime ToDate) { List <string> claims; try { claims = _repository.GetClaimTypes(FromDate, ToDate); if (claims.Count() == 0) { throw new FaultException("There are no records in the selected date range"); } return(claims); } catch (FaultException fault) { MitchellFault _fault = new MitchellFault(); _fault.Message = fault.Message; throw new FaultException <MitchellFault>(_fault); } }
public MitchellClaim GetClaim(string ClaimNumber) { MitchellClaim _claim = new MitchellClaim(); try { _claim = _repository.GetClaimType(ClaimNumber); if (_claim.ClaimNumber == null) { throw new FaultException("There are no records for specific claim"); } return(_claim); } catch (FaultException fault) { MitchellFault _fault = new MitchellFault(); _fault.Message = fault.Message; throw new FaultException <MitchellFault>(_fault); } }
public VehicleDetails GetVehicleDetails(string ClaimNumber, string vin) { VehicleDetails _vehicle = new VehicleDetails(); try { _vehicle = _repository.GetVehicleDetails(ClaimNumber, vin); if (_vehicle == null) { throw new FaultException("There are no records for specific claim"); } return(_vehicle); } catch (FaultException fault) { MitchellFault _fault = new MitchellFault(); _fault.Message = fault.Message; throw new FaultException <MitchellFault>(_fault); } }