public static int DeletePaymentInfoAudit(PaymentInfoAuditViewModel paymentInfoAudit)
        {
            try
            {
                // Convert the view model object to a service proxy object.
                SP.PaymentInfoAuditSvc.PaymentInfoAudit request = paymentInfoAudit.ToModel();

                // Call the service delete method.
                _paymentInfoAuditClient.DeletePaymentInfoAudit(request);

                return 1;
            }
            catch (System.ServiceModel.FaultException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts a PaymentInfoAudit service proxy object to a WebClient object.
        /// </summary>
        /// <param name="paymentInfoAudit">PaymentInfoAudit service proxy</param>
        /// <returns>PaymentInfoAudit WebClient object to be used in the UI.</returns>
        public static VM.PaymentInfoAuditViewModel ToViewModel(this SP.PaymentInfoAuditSvc.PaymentInfoAudit paymentInfoAudit)
        {
            VM.PaymentInfoAuditViewModel result = new VM.PaymentInfoAuditViewModel()
            {
                PaymentInfoAuditGuid = paymentInfoAudit.PaymentInfoAuditGuid,
                PaymentInfoGuid = paymentInfoAudit.PaymentInfoGuid,
                PaymentInfoID = paymentInfoAudit.PaymentInfoID,
                AmazonToken = paymentInfoAudit.AmazonToken,
                DateModified = paymentInfoAudit.DateModified,
            };

            return result;
        }
        public static int InsertPaymentInfoAudit(PaymentInfoAuditViewModel paymentInfoAudit)
        {
            if (null == paymentInfoAudit)
            {
                throw new Exception("Cannot insert PaymentInfoAudit. The paymentInfoAudit object was null. Cannot be empty.");
            }

            try
            {
                // Convert the view model object to a service proxy object.
                SP.PaymentInfoAuditSvc.PaymentInfoAudit request = paymentInfoAudit.ToModel();

                // Call the service insert method.
                _paymentInfoAuditClient.InsertPaymentInfoAudit(request);

                return 1;
            }
            catch (System.ServiceModel.FaultException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public static PaymentInfoAuditCollection GetPaymentInfoAuditsForPaymentInfoByPaymentInfoGuid(Guid paymentInfoGuid)
 {
     SP.PaymentInfoAuditSvc.PaymentInfoAudit[] paymentInfoAudits = _paymentInfoAuditClient.GetPaymentInfoAuditsForPaymentInfoByPaymentInfoGuid(paymentInfoGuid);
     PaymentInfoAuditCollection result = new PaymentInfoAuditCollection();
     foreach (SP.PaymentInfoAuditSvc.PaymentInfoAudit paymentInfoAudit
         in paymentInfoAudits)
     {
         PaymentInfoAuditViewModel viewModel = new PaymentInfoAuditViewModel(paymentInfoAudit.PaymentInfoAuditGuid, paymentInfoAudit.PaymentInfoGuid, paymentInfoAudit.PaymentInfoID, paymentInfoAudit.AmazonToken, paymentInfoAudit.DateModified);
         result.Add(viewModel);
     }
     return result;
 }
 public void RemovePaymentInfoAudit(PaymentInfoAuditViewModel paymentInfoAudit)
 {
     _paymentInfoAuditVMs.Remove(paymentInfoAudit);
 }
 public void AddPaymentInfoAudit(PaymentInfoAuditViewModel paymentInfoAudit)
 {
     _paymentInfoAuditVMs.Add(paymentInfoAudit);
 }