示例#1
0
        public List<OrderPaymentHitrustQuery> GetOderHitrust(OrderPaymentHitrustQuery store, out int totalCount)
        {
            StringBuilder sb = new StringBuilder();
            try
            {
                sb.Append(@"select order_id,retcode,orderstatus,id,retcodename,authRRN,rettype,capDate,depositamount,approveamount,redem_discount_amount,redem_discount_point,FROM_UNIXTIME(createtime) as createdate,pan,bankname ");
                sb.AppendFormat("   from order_payment_hitrust ");
                sb.AppendFormat(" where order_id ='{0}' ", store.order_id);
                totalCount = 0;
                if (store.IsPage)
                {
                    System.Data.DataTable _dt = _access.getDataTable(sb.ToString());
                    if (_dt != null && _dt.Rows.Count > 0)
                    {
                        totalCount = _dt.Rows.Count;
                    }
                    sb.AppendFormat(" limit {0},{1}", store.Start, store.Limit);
                }
                return _access.getDataTableForObj<OrderPaymentHitrustQuery>(sb.ToString());
            }
            catch (Exception ex)
            {

                throw new Exception("TabShowDao-->GetOderHitrust " + ex.Message + sb.ToString(), ex);
            }
        }
        /// <summary>
        /// Hitrust-網際威信
        /// </summary>
        /// <returns></returns>
        public HttpResponseBase GetOrderHitrustList()
        {
            string json = string.Empty;

            OrderPaymentHitrustQuery query = new OrderPaymentHitrustQuery();
            query.Start = Convert.ToInt32(Request.Params["start"] ?? "0");//用於分頁的變量
            query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "25");//用於分頁的變量
            if (!string.IsNullOrEmpty(Request.Params["Order_Id"]))
            {
                query.order_id = Request.Params["Order_Id"];
            }
            try
            {
                List<OrderPaymentHitrustQuery> store = new List<OrderPaymentHitrustQuery>();
                _tbshow = new TabShowMgr(mySqlConnectionString);
                int totalCount = 0;
                store = _tbshow.GetOderHitrust(query, out  totalCount);
                //foreach (var item in store)
                //{
                //    item.card_number ="'"+item.pan+"','"+item.bankname+"'";
                //}
                IsoDateTimeConverter timeConverter = new IsoDateTimeConverter();
                //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式     
                timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                json = "{success:true,data:" + JsonConvert.SerializeObject(store, Formatting.Indented, timeConverter) + "}";//返回json數據
            }
            catch (Exception ex)
            {
                Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
                logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
                logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
                log.Error(logMessage);
                json = "{success:true,totalCount:0,data:[]}";
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;
        }
示例#3
0
 public List<OrderPaymentHitrustQuery> GetOderHitrust(OrderPaymentHitrustQuery store, out int totalCount)
 {
     try
     {
         return _tabshowdao.GetOderHitrust(store, out totalCount);
     }
     catch (Exception ex)
     {
         throw new Exception("TabShowMgr-->GetOderHitrust-->" + ex.Message, ex);
     }
 }