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));
        }
Beispiel #2
0
 public List<DC.PaymentInfo> GetAllPaymentInfoWithUndefined()
 {
     try
     {
         BL.PaymentInfoLogic paymentInfoLogic = new BL.PaymentInfoLogic();
         List<BE.PaymentInfo> entities = paymentInfoLogic.GetAllPaymentInfoWithUndefined();
         List<DC.PaymentInfo> response = entities.ToDataContractList();
         return response;
     }
     catch (Exception ex)
     {
         FC.DefaultFaultContract fault = new FC.DefaultFaultContract();
         fault.ErrorMessage = "Unable to retrieve paymentInfo data.";
         throw new FaultException<FC.DefaultFaultContract>(fault,
             new FaultReason(ex.Message));
     }
 }
Beispiel #3
0
        public void DeletePaymentInfo(DC.PaymentInfo request)
        {
            try
            {
                BL.PaymentInfoLogic paymentInfoLogic = new BL.PaymentInfoLogic();
                BE.PaymentInfo entity = request.ToBusinessEntity();
                paymentInfoLogic.DeletePaymentInfo(entity);
            }
            catch (BE.PaymentInfoNotFoundException ex)
            {
                FC.DefaultFaultContract fault = new FC.DefaultFaultContract();
                fault.ErrorMessage = String.Format(
                    "Unable to delete Payment Info data. Data: {0}",
                    request.ToBusinessEntity().ToString());

                throw new FaultException<FC.DefaultFaultContract>(fault,
                    new FaultReason(ex.Message));
            }
        }
Beispiel #4
0
        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;
        }
Beispiel #5
0
 public DC.PaymentInfo GetPaymentInfoByPaymentInfoGuid(Guid paymentInfoGuid)
 {
     try
     {
         BL.PaymentInfoLogic paymentInfoLogic = new BL.PaymentInfoLogic();
         BE.PaymentInfo entity = paymentInfoLogic.GetPaymentInfoByPaymentInfoGuid(paymentInfoGuid);
         DC.PaymentInfo response = entity.ToDataContract();
         return response;
     }
     catch (BE.PaymentInfoNotFoundException ex)
     {
         FC.PaymentInfoFault fault = new FC.PaymentInfoFault();
         fault.PaymentInfoGuid = ex.PaymentInfoGuid;
         fault.ErrorMessage = "PaymentInfo does not exsist in the database.";
         throw new FaultException<FC.PaymentInfoFault>(fault,
             new FaultReason(ex.Message));
     }
     catch (Exception ex)
     {
         FC.PaymentInfoFault fault = new FC.PaymentInfoFault();
         fault.ErrorMessage = "Could not retrieve a specific PaymentInfo for unknown reasons.";
         throw new FaultException<FC.PaymentInfoFault>(fault,
             new FaultReason(ex.Message));
     }
 }