/// <summary> /// /// </summary> private void LoadData() { var listParam = new List <SearchParam>(); if (currentManage.isSuperAdmin <= 0) { } string userId = txtuserId.Text.Trim(); int tempId = 0; if (int.TryParse(userId, out tempId)) { listParam.Add(new SearchParam("userid", tempId)); } if (!string.IsNullOrEmpty(txtuserOrder.Text.Trim())) { listParam.Add(new SearchParam("userorder", txtuserOrder.Text.Trim())); } DateTime tempdt; if (!string.IsNullOrEmpty(StimeBox.Text.Trim())) { if (DateTime.TryParse(StimeBox.Text.Trim(), out tempdt)) { if (tempdt > DateTime.MinValue) { listParam.Add(new SearchParam("stime", StimeBox.Text.Trim())); } } } if (!string.IsNullOrEmpty(EtimeBox.Text.Trim())) { if (DateTime.TryParse(EtimeBox.Text.Trim(), out tempdt)) { if (tempdt > DateTime.MinValue) { listParam.Add(new SearchParam("etime", tempdt.AddDays(1))); } } } string orderby = string.Empty; DataSet pageData = Debuglog.PageSearch(listParam, this.Pager1.PageSize, this.Pager1.CurrentPageIndex, orderby); this.Pager1.RecordCount = Convert.ToInt32(pageData.Tables[0].Rows[0][0]); this.rptTrades.DataSource = pageData.Tables[1]; this.rptTrades.DataBind(); }
protected void btnDel_Click(object sender, EventArgs e) { try { string ids = Request.Form["chkItem"]; if (!string.IsNullOrEmpty(ids)) { foreach (string itemid in ids.Split(',')) { Debuglog.Delete(int.Parse(itemid)); } } } catch (Exception ex) { ShowMessageBox(ex.Message); } LoadData(); }
protected void Page_Load(object sender, EventArgs e) { CardInfoList cardInfoList = new CardInfoList(HttpContext.Current); var myCardInfo = new CardInfo(HttpContext.Current); string opstate = "1"; Thread thread = new Thread(new ParameterizedThreadStart(PostCardToSupplier)); //Thread thread = new Thread(new (PostCardToSupplier)); HttpContext context = new HttpContext(HttpContext.Current.Request, HttpContext.Current.Response); thread.Start(context); string retcode = string.Format("opstate={0}", opstate); HttpContext.Current.Response.ContentType = "text/plain"; HttpContext.Current.Response.Write(retcode); //} //参数没接收成功 if (opstate != "1") { #region 记录日志 if (this.DebuglogOpen) { foreach (CardInfo apiCardInfo in cardInfoList) { var debugInfo = new viviapi.Model.Sys.debuginfo { userid = apiCardInfo.UserId, addtime = DateTime.Now, bugtype = viviapi.Model.Sys.debugtypeenum.卡类订单, errorcode = opstate, errorinfo = apiCardInfo.Msg, userorder = apiCardInfo.orderid, url = HttpContext.Current.Request.RawUrl, detail = "" }; Debuglog.Insert(debugInfo); } } #endregion } }
/// <summary> /// /// </summary> private void Process(HttpContext context) { var apiCardInfo = new CardInfo(context); string opstate = Utility.CheckParameter(apiCardInfo); if (opstate == "0") { string sysOrderId = Factory.Instance.GenerateOrderId(OrderPrefix); var orderInfo = InitOrder(sysOrderId, apiCardInfo); if (orderInfo == null) { apiCardInfo.Msg = "初始化订单失败,系统繁忙"; opstate = "-999"; } else { var suppResponse = new CardSynchCallBack(); if (apiCardInfo.ProcessMode == 1) { #region 通过接口 var supp = (SupplierCode)apiCardInfo.SupplierId; suppResponse = OrderCardUtils.SynchSubmit(supp , sysOrderId , apiCardInfo.TypeId , apiCardInfo.CardNo , apiCardInfo.CardPwd , apiCardInfo.OrderAmt , string.Empty , 1); if (suppResponse.SummitStatus == 0) { opstate = Utility.ConvertSynchronousErrorCode(supp, suppResponse.SuppErrorCode); string viewMsg = Utility.GetMessageByCode(opstate); var response = new CardOrderSupplierResponse() { Sync = 1, SupplierId = apiCardInfo.SupplierId, SuppTransNo = suppResponse.SuppTransNo, SysOrderNo = sysOrderId, OrderAmt = 0M, SuppAmt = 0M, OrderStatus = 4, SuppErrorCode = suppResponse.SuppErrorCode, SuppErrorMsg = suppResponse.SuppErrorMsg, Opstate = opstate, ViewMsg = viewMsg, Method = 1 }; OrderCardUtils.FinishForSync(orderInfo, response); } else { apiCardInfo.Msg = "提卡成功,等待处理结果"; } #endregion } else { #region 系统自已处理 apiCardInfo.SupplierId = 0; suppResponse.SuppTransNo = DateTime.Now.ToString("yyyyMMddHHmmssfff"); suppResponse.OrderStatus = 2; suppResponse.SuppErrorMsg = "支付成功"; suppResponse.SuppErrorCode = "0"; suppResponse.SuccAmt = apiCardInfo.OrderAmt; #endregion } if (apiCardInfo.ProcessMode == 2 || suppResponse.OrderStatus == 2) { #region 系统自处理 var resInfo = new CardProcessResultInfo { supplierId = 0, orderid = sysOrderId, supplierOrder = suppResponse.SuppTransNo, status = 2, opstate = "0", msg = suppResponse.SuppErrorMsg, userViewMsg = suppResponse.SuppErrorMsg, tranAMT = suppResponse.SuccAmt, suppAmt = 0M, errtype = suppResponse.SuppErrorCode, method = apiCardInfo.ProcessMode, count = 0 }; apiCardInfo.Msg = "提卡成功,等待处理结果"; var process = new SystemProcessCard(); var tmr = new System.Threading.Timer(process.Process, resInfo, 1000, 0); resInfo.tmr = tmr; #endregion } } } if (opstate != "0") { #region 记录日志 if (this.DebuglogOpen) { var debugInfo = new viviapi.Model.Sys.debuginfo { userid = apiCardInfo.UserId, addtime = DateTime.Now, bugtype = viviapi.Model.Sys.debugtypeenum.卡类订单, errorcode = opstate, errorinfo = apiCardInfo.Msg, userorder = apiCardInfo.orderid, url = context.Request.RawUrl, detail = "" }; Debuglog.Insert(debugInfo); } #endregion } string retcode = string.Format("opstate={0}", opstate); context.Response.ContentType = "text/plain"; context.Response.Write(retcode); }