Пример #1
0
 public void DeleteSetting(string key)
 {
     DataAccess da = new DataAccess();
     string sql = "DELETE from [Setting] "
             + "WHERE [key] ='" + key + "'";
     da.ExecuteNonQuery(sql);
 }
        private static PaymentTransactionData PaymentInfoToPaymentTransactionData(PaymentInfo paymentInfo)
        {
            PaymentTransactionData transData = null;

            if (paymentInfo != null)
            {
                transData = new PaymentTransactionData();

                try
                {
                    ProductData productdata = new ProductData();
                    Product product = new Product();
                    product.ProductId = paymentInfo.ProductID;
                    product.ProductName = paymentInfo.ProductName;
                    product.IsVip = paymentInfo.ProductID.ToLower() == "vip";
                    productdata.Product = product;

                    productdata.Amount = Convert.ToDecimal(paymentInfo.Price.Amount);

                    Term term = new Term();
                    DataAccess da = new DataAccess();
                    DataTable dtterm = da.GetDataTable("select * from Terms where [Type]='" + productdata.Term.TermType + "'");
                    term.TermId = Convert.ToInt32(dtterm.Rows[0]["TermId"].ToString());
                    term.TermType = dtterm.Rows[0]["Type"].ToString();
                    term.Description = dtterm.Rows[0]["Description"].ToString();
                    productdata.Term = term;

                    productdata.ProductTermId = prefix + productdata.Product.ProductId.ToLower() + "_" + productdata.Term.Description.ToLower();
                    transData.TransactionId = paymentInfo.TransactionID;
                    transData.ChargeDate = paymentInfo.PaymentTime;
                    transData.ProductData = productdata;
                }
                catch { }
            }

            return transData;
        }