public void PaySuccess(string transaction_id, string orderNo, string channel) { try { List <Orders> orders = new List <Orders>(); Orders order = null; if (channel.Equals("wx")) { orders = orderDao.GetModels("OrderId=@0 and Enabled=@1", Convert.ToInt32(orderNo), 0); } else { orders = orderDao.GetModels("OrderNo=@0 and Enabled=@1", orderNo, 0); } // memberDao.GetModels("id=@0 and pwd=@1", memberId, passWord) if (orders.Count == 1) { order = orders[0]; orderDao.Update(new Orders { OrderNo = order.OrderNo, Enabled = 1, TradeNo = transaction_id }, new string[] { "OrderNo" }, "Enabled", "TradeNo"); PaymentLog model = new PaymentLog(); model.IsPayed = "1"; model.PayedTime = DateTime.Now; model.CreateTime = DateTime.Now; model.Payment = channel; model.TradeNo = transaction_id; model.SourceOrderId = order.OrderId; model.Amount = order.TotalAmount; model.MemberId = order.MemberId; string[] paramlist = { "IsPayed", "PayedTime", "CreateTime", "Payment", "TradeNo", "SourceOrderId", "Amount", "MemberId" }; paymentLogDal.Insert(model, paramlist); DbHelperSQL.ExcuteNonquery("exec pro_UpdateOrderExpiryDate " + order.OrderId); } DbHelperSQL.WriteLog("交易成功\r\n" + "订单号:" + orderNo + " 交易流水号:" + transaction_id, new Exception()); } catch (Exception ex) { DbHelperSQL.WriteLog("订单状态修改失败\r\n" + "订单号:" + orderNo + " 交易流水号:" + transaction_id, ex); } }
public bool Update(Orders model) { return(dao.Update(model)); }