コード例 #1
0
        public static int DeletePaymentInfo(PaymentInfoViewModel paymentInfo)
        {
            try
            {
                // Convert the view model object to a service proxy object.
                SP.PaymentInfoSvc.PaymentInfo request = paymentInfo.ToModel();

                // Call the service delete method.
                _paymentInfoClient.DeletePaymentInfo(request);

                return 1;
            }
            catch (System.ServiceModel.FaultException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
 public void RemovePaymentInfo(PaymentInfoViewModel paymentInfo)
 {
     _paymentInfoVMs.Remove(paymentInfo);
 }
コード例 #3
0
 public void AddPaymentInfo(PaymentInfoViewModel paymentInfo)
 {
     _paymentInfoVMs.Add(paymentInfo);
 }
コード例 #4
0
ファイル: ClientAssembler.cs プロジェクト: ankit-defacto/PSS
        /// <summary>
        /// Converts a PaymentInfo service proxy object to a WebClient object.
        /// </summary>
        /// <param name="paymentInfo">PaymentInfo service proxy</param>
        /// <returns>PaymentInfo WebClient object to be used in the UI.</returns>
        public static VM.PaymentInfoViewModel ToViewModel(this SP.PaymentInfoSvc.PaymentInfo paymentInfo)
        {
            VM.PaymentInfoViewModel result = new VM.PaymentInfoViewModel()
            {
                PaymentInfoGuid = paymentInfo.PaymentInfoGuid,
                PaymentInfoID = paymentInfo.PaymentInfoID,
                AmazonToken = paymentInfo.AmazonToken,
            };

            return result;
        }
コード例 #5
0
        public static int InsertPaymentInfo(PaymentInfoViewModel paymentInfo)
        {
            if (null == paymentInfo)
            {
                throw new Exception("Cannot insert PaymentInfo. The paymentInfo object was null. Cannot be empty.");
            }

            try
            {
                // Convert the view model object to a service proxy object.
                SP.PaymentInfoSvc.PaymentInfo request = paymentInfo.ToModel();

                // Call the service insert method.
                _paymentInfoClient.InsertPaymentInfo(request);

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