public Permit ValidateVehicle(string issueState, string plateNumber) { // Permit permit = null; PermitAdminServiceClient client = new PermitAdminServiceClient(); try { permit = client.ValidateVehicle(issueState, plateNumber); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <HRFault> hfe) { client.Abort(); throw new ApplicationException(hfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(permit); }
public bool ChangeVehicle(Vehicle vehicle) { // bool changed = false; PermitAdminServiceClient client = new PermitAdminServiceClient(); try { changed = client.ChangeVehicle(vehicle); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <HRFault> hfe) { client.Abort(); throw new ApplicationException(hfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(changed); }
public bool RevokePermit(Permit permit) { // bool revoked = false; PermitAdminServiceClient client = new PermitAdminServiceClient(); try { revoked = client.RevokePermit(permit); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <HRFault> hfe) { client.Abort(); throw new ApplicationException(hfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(revoked); }
public int ReplacePermit(Permit permit, string newNumber) { // int id = 0; PermitAdminServiceClient client = new PermitAdminServiceClient(); try { id = client.ReplacePermit(permit, newNumber); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <HRFault> hfe) { client.Abort(); throw new ApplicationException(hfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(id); }
public Permit ReadPermit(int id) { // Permit permit = null; PermitAdminServiceClient client = new PermitAdminServiceClient(); try { permit = client.ReadPermit(id); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <HRFault> hfe) { client.Abort(); throw new ApplicationException(hfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(permit); }
public DataSet ViewPermits() { // DataSet permits = new DataSet(); PermitAdminServiceClient client = new PermitAdminServiceClient(); try { DataSet ds = client.ViewPermits(); if (ds != null) { permits.Merge(ds); } client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <HRFault> hfe) { client.Abort(); throw new ApplicationException(hfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(permits); }