Beispiel #1
0
        public static int DeleteClick(ClickViewModel click)
        {
            try
            {
                // Convert the view model object to a service proxy object.
                SP.ClickSvc.Click request = click.ToModel();

                // Call the service delete method.
                _clickClient.DeleteClick(request);

                return 1;
            }
            catch (System.ServiceModel.FaultException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        public static int InsertClick(ClickViewModel click)
        {
            if (null == click)
            {
                throw new Exception("Cannot insert Click. The click object was null. Cannot be empty.");
            }

            try
            {
                // Convert the view model object to a service proxy object.
                SP.ClickSvc.Click request = click.ToModel();

                // Call the service insert method.
                _clickClient.InsertClick(request);

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