private void InsertData() { CityStateZip cityStateZip = new CityStateZip(); cityStateZip.City = acctCity.Text; cityStateZip.State = acctState.Text; cityStateZip.ZipCode = acctZipCode.Text; CityStateZipLogic cszLogic = new CityStateZipLogic(); cityStateZip = cszLogic.InsertCityStateZip(cityStateZip); PaymentInfo paymentInfo = new PaymentInfo(); paymentInfo.AmazonToken = "test"; PaymentInfoLogic piLogic = new PaymentInfoLogic(); paymentInfo = piLogic.InsertPaymentInfo(paymentInfo); Client client = new Client(); client.ClientName = acctCompanyName.Text; client.PhoneNumber = acctPhoneNumber.Text; client.Email = acctEmail.Text; client.Address = acctAddress.Text; client.CityStateZipGuid = cityStateZip.CityStateZipGuid; client.PaymentInfoGuid = paymentInfo.PaymentInfoGuid; ClientLogic clientLogic = new ClientLogic(); client = clientLogic.InsertClient(client); Response.Redirect(string.Format("CreateListing.aspx?ClientGuid={0}", client.ClientGuid)); }
private void AddPaymentInfoToAccount(AccountViewModel account, PaymentInfo paymentInfo) { Common.ValidateArgument<AccountViewModel>(account, "account"); Common.ValidateArgument<PaymentInfo>(paymentInfo, "paymentInfo"); PaymentInfoLogic piLogic = new PaymentInfoLogic(); PaymentInfo existingPaymentInfo = piLogic.GetPaymentInfoByPaymentInfoGuid(paymentInfo.PaymentInfoGuid); if (existingPaymentInfo == null || existingPaymentInfo.PaymentInfoGuid == Guid.Empty) { paymentInfo = piLogic.InsertPaymentInfo(paymentInfo); } else { paymentInfo.PaymentInfoGuid = existingPaymentInfo.PaymentInfoGuid; piLogic.UpdatePaymentInfo(paymentInfo); paymentInfo = piLogic.GetPaymentInfoByPaymentInfoGuid(paymentInfo.PaymentInfoGuid); } account.PaymentInfoGuid = paymentInfo.PaymentInfoGuid; }
public void InsertPaymentInfo(DC.PaymentInfo request) { try { BL.PaymentInfoLogic paymentInfoLogic = new BL.PaymentInfoLogic(); BE.PaymentInfo entity = request.ToBusinessEntity(); paymentInfoLogic.InsertPaymentInfo(entity); } catch (BE.PaymentInfoAlreadyExistsException ex) { FC.DefaultFaultContract fault = new FC.DefaultFaultContract(); fault.ErrorMessage = String.Format( "Unable to insert Payment Info data. Data: {0}", request.ToBusinessEntity().ToString()); throw new FaultException<FC.DefaultFaultContract>(fault, new FaultReason(ex.Message)); } }