/// <summary> /// Converts the PaymentInfoAudit ViewModel into a PaymentInfoAudit Model to be used with the service. /// </summary> /// <param name="paymentInfoAudit">ViewModel to convert.</param> /// <returns>PaymentInfoAuditReturns null if parameter is null. Otherwise, returns Model to be used with the service.</returns> public static SP.PaymentInfoAuditSvc.PaymentInfoAudit ToModel(this VM.PaymentInfoAuditViewModel paymentInfoAudit) { if (null == paymentInfoAudit) { return null; } SP.PaymentInfoAuditSvc.PaymentInfoAudit result = new SP.PaymentInfoAuditSvc.PaymentInfoAudit() { PaymentInfoAuditGuid = paymentInfoAudit.PaymentInfoAuditGuid, PaymentInfoGuid = paymentInfoAudit.PaymentInfoGuid, PaymentInfoID = paymentInfoAudit.PaymentInfoID, AmazonToken = paymentInfoAudit.AmazonToken, DateModified = paymentInfoAudit.DateModified, }; return result; }
public static int InsertPaymentInfoAudit(Guid paymentInfoGuid, int paymentInfoID, string amazonToken, DateTime dateModified) { try { // Create the service proxy object and populate it. SP.PaymentInfoAuditSvc.PaymentInfoAudit request = new SP.PaymentInfoAuditSvc.PaymentInfoAudit(); request.PaymentInfoAuditGuid = Guid.Empty; request.PaymentInfoGuid = paymentInfoGuid; request.PaymentInfoID = paymentInfoID; request.AmazonToken = amazonToken; request.DateModified = dateModified; // Call the service insert method. _paymentInfoAuditClient.InsertPaymentInfoAudit(request); return 1; } catch (System.ServiceModel.FaultException ex) { throw ex; } catch (Exception ex) { throw ex; } }