Ejemplo n.º 1
0
        public static int DeleteCityStateZip(CityStateZipViewModel cityStateZip)
        {
            try
            {
                // Convert the view model object to a service proxy object.
                SP.CityStateZipSvc.CityStateZip request = cityStateZip.ToModel();

                // Call the service delete method.
                _cityStateZipClient.DeleteCityStateZip(request);

                return 1;
            }
            catch (System.ServiceModel.FaultException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public static int InsertCityStateZip(CityStateZipViewModel cityStateZip)
        {
            if (null == cityStateZip)
            {
                throw new Exception("Cannot insert CityStateZip. The cityStateZip object was null. Cannot be empty.");
            }

            try
            {
                // Convert the view model object to a service proxy object.
                SP.CityStateZipSvc.CityStateZip request = cityStateZip.ToModel();

                // Call the service insert method.
                _cityStateZipClient.InsertCityStateZip(request);

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