public static int DeleteClient(ClientViewModel client) { try { // Convert the view model object to a service proxy object. SP.ClientSvc.Client request = client.ToModel(); // Call the service delete method. _clientClient.DeleteClient(request); return 1; } catch (System.ServiceModel.FaultException ex) { throw ex; } catch (Exception ex) { throw ex; } }
public static int InsertClient(ClientViewModel client) { if (null == client) { throw new Exception("Cannot insert Client. The client object was null. Cannot be empty."); } try { // Convert the view model object to a service proxy object. SP.ClientSvc.Client request = client.ToModel(); // Call the service insert method. _clientClient.InsertClient(request); return 1; } catch (System.ServiceModel.FaultException ex) { throw ex; } catch (Exception ex) { throw ex; } }