コード例 #1
0
        public static int DeleteOffering(OfferingViewModel offering)
        {
            try
            {
                // Convert the view model object to a service proxy object.
                SP.OfferingSvc.Offering request = offering.ToModel();

                // Call the service delete method.
                _offeringClient.DeleteOffering(request);

                return 1;
            }
            catch (System.ServiceModel.FaultException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        public static int InsertOffering(OfferingViewModel offering)
        {
            if (null == offering)
            {
                throw new Exception("Cannot insert Offering. The offering object was null. Cannot be empty.");
            }

            try
            {
                // Convert the view model object to a service proxy object.
                SP.OfferingSvc.Offering request = offering.ToModel();

                // Call the service insert method.
                _offeringClient.InsertOffering(request);

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