Example #1
0
        /// <summary>
        /// 获取prepayid
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="prePayId"></param>
        /// <returns></returns>
        public PaymentDataResults getPayData(string orderId)
        {
            string             sql = "select s.shopName,g.goodsName,o.tradeTime,o.tradeAmount, o.prePayId, o.payNo,o.customerCode from t_order_list o,t_sys_shop s,t_order_goods g where o.merchantOrderId = g.merchantOrderId and o.purchaserCode = s.shopCode and  parentOrderId = '" + orderId + "' ";
            DataTable          dt  = DatabaseOperationWeb.ExecuteSelectDS(sql, "t_order_list").Tables[0];
            PaymentDataResults p   = new PaymentDataResults();

            p.shopName     = dt.Rows[0]["shopName"].ToString();
            p.goodsName    = dt.Rows[0]["goodsName"].ToString();
            p.tradeTime    = dt.Rows[0]["tradeTime"].ToString();
            p.tradeAmount  = dt.Rows[0]["tradeAmount"].ToString();
            p.prePayId     = dt.Rows[0]["prePayId"].ToString();
            p.payNo        = dt.Rows[0]["payNo"].ToString();
            p.customerCode = dt.Rows[0]["customerCode"].ToString();

            return(p);
        }
Example #2
0
        /// <summary>
        /// 获取prepayid
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="prePayId"></param>
        /// <returns></returns>
        public PaymentDataResults getPayData(string billId)
        {
            PaymentDataResults paymentDataResults = null;
            StringBuilder      builder            = new StringBuilder();

            builder.AppendFormat(PaymentSqls.SELECT_PREPAYID_BY_BILLID, billId);
            string    sql = builder.ToString();
            DataTable dt  = DatabaseOperationWeb.ExecuteSelectDS(sql, "T").Tables[0];

            if (dt.Rows.Count > 0)
            {
                string state = "待支付";
                if (dt.Rows[0]["bookingState"].ToString() == "2" || dt.Rows[0]["bookingState"].ToString() == "4")
                {
                    state = "已支付";
                }
                else if (dt.Rows[0]["bookingState"].ToString() == "3" || dt.Rows[0]["bookingState"].ToString() == "5")
                {
                    state = "已退票";
                }
                paymentDataResults = new PaymentDataResults
                {
                    openId       = dt.Rows[0]["openId"].ToString(),
                    billid       = dt.Rows[0]["billId"].ToString(),
                    billPrice    = dt.Rows[0]["billPrice"].ToString(),
                    billValue    = dt.Rows[0]["beginTime"].ToString() + " " + dt.Rows[0]["beginPort"].ToString() + "-" + dt.Rows[0]["endPort"].ToString() + " " + dt.Rows[0]["shipName"].ToString(),
                    bookingTime  = dt.Rows[0]["bookingTime"].ToString(),
                    bookingState = state,
                    prePayId     = dt.Rows[0]["prePayId"].ToString(),
                    payNo        = dt.Rows[0]["payNo"].ToString(),
                    refundFee    = dt.Rows[0]["refundFee"].ToString(),
                    refundTime   = dt.Rows[0]["refundTime"].ToString(),
                    formId       = dt.Rows[0]["formId"].ToString(),
                };
            }
            return(paymentDataResults);
        }