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; } }
public void RemovePaymentInfo(PaymentInfoViewModel paymentInfo) { _paymentInfoVMs.Remove(paymentInfo); }
public void AddPaymentInfo(PaymentInfoViewModel paymentInfo) { _paymentInfoVMs.Add(paymentInfo); }
/// <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; }
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; } }