public bool UpdateBadge(VendorBadge badge)
        {
            //Update an existing badge
            bool updated = false;

            try {
                updated = new DataService().ExecuteNonQuery(SQL_CONNID, USP_BADGE_UPDATE, new object[] { badge.IDNumber, badge.LastName, badge.FirstName, badge.Middle, badge.Suffix, badge.Location, badge.Department, badge.Status });
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            return(updated);
        }
        public bool CreateBadge(VendorBadge badge)
        {
            //Add a new badge
            bool created = false;

            try {
                created = new DataService().ExecuteNonQuery(SQL_CONNID, USP_BADGE_NEW, new object[] { badge.LastName, badge.FirstName, badge.Middle, badge.Suffix, badge.Location, badge.Department, badge.Status });
            }
            catch (Exception ex) { throw new ApplicationException(ex.Message, ex); }
            return(created);
        }
Exemple #3
0
        public bool UpdateVendorBadge(VendorBadge badge)
        {
            //Update an existing badge
            bool updated = false;

            try {
                updated = new VendorBadgeGateway().UpdateBadge(badge);
            }
            catch (Exception ex) { throw new FaultException <HRFault>(new HRFault(ex.Message), "Service Error"); }
            return(updated);
        }
Exemple #4
0
        public bool AddVendorBadge(VendorBadge badge)
        {
            //Add a new badge
            bool added = false;

            try {
                added = new VendorBadgeGateway().CreateBadge(badge);
            }
            catch (Exception ex) { throw new FaultException <HRFault>(new HRFault(ex.Message), "Service Error"); }
            return(added);
        }
Exemple #5
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);
        }
Exemple #6
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);
        }
Exemple #7
0
        public VendorBadge GetVendorBadge(int idNumber)
        {
            //
            VendorBadge badge = null;

            try {
                DataSet ds = new VendorBadgeGateway().ReadBadge(idNumber);
                if (ds != null)
                {
                    BadgeDataset _badges = new BadgeDataset();
                    _badges.Merge(ds);
                    badge = new VendorBadge(_badges.BadgeTable[0]);
                }
            }
            catch (Exception ex) { throw new FaultException <HRFault>(new HRFault(ex.Message), "Service Error"); }
            return(badge);
        }