Esempio n. 1
0
        public bool UpdateVendorBadge(VendorBadge badge)
        {
            //
            bool updated = false;
            VendorBadgeServiceClient client = new VendorBadgeServiceClient();

            try {
                updated = client.UpdateVendorBadge(badge);
                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(updated);
        }
Esempio n. 2
0
        public VendorBadge GetVendorBadge(int idNumber)
        {
            //
            VendorBadge badge = null;
            VendorBadgeServiceClient client = new VendorBadgeServiceClient();

            try {
                badge = client.GetVendorBadge(idNumber);
                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(badge);
        }
Esempio n. 3
0
        public bool AddVendorDepartment(string name)
        {
            //
            bool added = false;
            VendorBadgeServiceClient client = new VendorBadgeServiceClient();

            try {
                added = client.AddVendorDepartment(name);
                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(added);
        }
Esempio n. 4
0
        public DataSet GetVendorStatusList()
        {
            //
            DataSet list = new DataSet();
            VendorBadgeServiceClient client = new VendorBadgeServiceClient();

            try {
                DataSet ds = client.GetVendorStatusList();
                if (ds != null)
                {
                    list.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(list);
        }
Esempio n. 5
0
        public BadgeDataset ViewVendorBadges()
        {
            //
            BadgeDataset             badges = new BadgeDataset();
            VendorBadgeServiceClient client = new VendorBadgeServiceClient();

            try {
                DataSet ds = client.ViewVendorBadges();
                if (ds != null)
                {
                    badges.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(badges);
        }