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); }
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); }
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); }
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); }
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); }