Example #1
0
        //Interface
        public PermitGateway()
        {
            //
            PermitSearchServiceClient client = new PermitSearchServiceClient();

            _state   = true;
            _address = client.Endpoint.Address.Uri.AbsoluteUri;
        }
Example #2
0
        public DataSet FindPermitsByVehicle(string year, string make, string model, string color)
        {
            //
            DataSet permits = new DataSet();
            PermitSearchServiceClient client = new PermitSearchServiceClient();

            try {
                DataSet ds = client.FindPermitsByVehicle(year, make, model, color);
                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);
        }
Example #3
0
        public DataSet FindPermitsByPlate(string issueState, string plateNumber)
        {
            //
            DataSet permits = new DataSet();
            PermitSearchServiceClient client = new PermitSearchServiceClient();

            try {
                DataSet ds = client.FindPermitsByPlate(issueState, plateNumber);
                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);
        }
Example #4
0
        public DataSet FindPermitsByNumber(string number)
        {
            //
            DataSet permits = null;
            PermitSearchServiceClient client = new PermitSearchServiceClient();

            try {
                DataSet ds = client.FindPermitsByNumber(number);
                if (ds != null && ds.Tables["PermitTable"] != null && ds.Tables["PermitTable"].Rows.Count > 0)
                {
                    permits = new DataSet();
                    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);
        }