public static int DeleteListingType(ListingTypeViewModel listingType) { try { // Convert the view model object to a service proxy object. SP.ListingTypeSvc.ListingType request = listingType.ToModel(); // Call the service delete method. _listingTypeClient.DeleteListingType(request); return 1; } catch (System.ServiceModel.FaultException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public static int InsertListingType(ListingTypeViewModel listingType) { if (null == listingType) { throw new Exception("Cannot insert ListingType. The listingType object was null. Cannot be empty."); } try { // Convert the view model object to a service proxy object. SP.ListingTypeSvc.ListingType request = listingType.ToModel(); // Call the service insert method. _listingTypeClient.InsertListingType(request); return 1; } catch (System.ServiceModel.FaultException ex) { throw ex; } catch (Exception ex) { throw ex; } }