Пример #1
0
 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");
     }
 }
Пример #2
0
 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");
     }
 }
Пример #3
0
 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");
     }
 }
Пример #4
0
        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);
            }
        }
Пример #5
0
        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);
            }
        }
Пример #6
0
        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);
            }
        }