Esempio n. 1
0
        public static int UpdateFacility(FacilityViewModel facility)
        {
            try
            {
                // Convert the view model object to a service proxy object.
                SP.FacilitySvc.Facility request = facility.ToModel();

                // Call the service update method.
                _facilityClient.UpdateFacility(request);

                return 1;
            }
            catch (System.ServiceModel.FaultException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public static int InsertFacility(FacilityViewModel facility)
        {
            if (null == facility)
            {
                throw new Exception("Cannot insert Facility. The facility object was null. Cannot be empty.");
            }

            try
            {
                // Convert the view model object to a service proxy object.
                SP.FacilitySvc.Facility request = facility.ToModel();

                // Call the service insert method.
                _facilityClient.InsertFacility(request);

                return 1;
            }
            catch (System.ServiceModel.FaultException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }