public List<OrderPaymentNcccQuery> GetNCCC(OrderPaymentNcccQuery store, out int totalCount) { StringBuilder sql = new StringBuilder(); StringBuilder sqlcount = new StringBuilder(); try { sql.AppendLine(@"SELECT nccc_id,order_id,merchantid,terminalid,orderid,"); sql.AppendLine(@"pan,bankname,transcode,transmode,transdate,transtime,"); sql.AppendLine(@"transamt,approvecode,responsecode,responsemsg,installtype,"); sql.AppendLine(@"`install`,firstamt,eachamt,fee,redeemtype,redeemused,"); sql.AppendLine(@"redeembalance,creditamt,riskmark,foreign1,"); sql.AppendLine(@"secure_status,FROM_UNIXTIME(nccc_createdate) AS nccc_createdates ,nccc_ipfrom,post_data"); sql.AppendFormat(@"FROM order_payment_nccc "); sqlcount.AppendFormat(@"SELECT count(*) AS search_total FROM order_payment_nccc "); if (!store.isSecret) { sqlcount.AppendFormat(" where nccc_id='{0}' ", store.nccc_id); sql.AppendFormat(" where nccc_id='{0}' ", store.nccc_id); } else { sqlcount.AppendFormat(" where order_id='{0}' ", store.order_id); sql.AppendFormat(" where order_id='{0}' ", store.order_id); } totalCount = 0; if (store.IsPage) { System.Data.DataTable _dt = _access.getDataTable(sqlcount.ToString()); if (_dt != null && _dt.Rows.Count > 0) { totalCount = Convert.ToInt32(_dt.Rows[0]["search_total"]); } sql.AppendFormat(" limit {0},{1}", store.Start, store.Limit); } return _access.getDataTableForObj<OrderPaymentNcccQuery>(sql.ToString()); } catch (Exception ex) { throw new Exception("TabShowDao-->GetNCCC " + ex.Message + sql.ToString(), ex); } }
public HttpResponseBase GetNCCC() { List<OrderPaymentNcccQuery> stores = new List<OrderPaymentNcccQuery>(); string json = string.Empty; try { OrderPaymentNcccQuery query = new OrderPaymentNcccQuery(); query.Start = Convert.ToInt32(Request.Params["start"] ?? "0");//用於分頁的變量 query.Limit = Convert.ToInt32(Request.Params["limit"] ?? "20");//用於分頁的變量 query.order_id = Convert.ToUInt32(Request.Params["Order_Id"].ToString()); _tabshow = new TabShowMgr(mySqlConnectionString); if (!string.IsNullOrEmpty(Request.Params["isSecret"])) { if (Request.Params["isSecret"] == "true") { query.isSecret = true; } else { query.isSecret = false; } } int totalCount = 0; stores = _tabshow.GetNCCC(query, out totalCount); if (query.isSecret) { foreach (var item in stores) { item.pan_bankname = "*****(******)"; } } else { foreach (var item in stores) { item.pan_bankname = item.pan + "(" + item.bankname + ")"; } } IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; json = "{success:true,'msg':'user',totalCount:" + totalCount + ",data:" + JsonConvert.SerializeObject(stores, 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; }
public List<OrderPaymentNcccQuery> GetNCCC(OrderPaymentNcccQuery store, out int totalCount) { try { return _tabshowdao.GetNCCC (store, out totalCount); } catch (Exception ex) { throw new Exception("TabShowMgr-->GetNCCC-->" + ex.Message, ex); } }