public static bool ConfirmPay(OrderInfo order) { if (order.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { bool flag; using (DbConnection connection = DatabaseFactory.CreateDatabase().CreateConnection()) { connection.Open(); DbTransaction dbTran = connection.BeginTransaction(); try { SubsiteSalesProvider provider = SubsiteSalesProvider.Instance(); if (provider.ConfirmPay(order, dbTran) <= 0) { dbTran.Rollback(); return(false); } if (order.GroupBuyId <= 0) { PurchaseOrderInfo purchaseOrder = provider.ConvertOrderToPurchaseOrder(order); if (!provider.CreatePurchaseOrder(purchaseOrder, dbTran)) { dbTran.Rollback(); return(false); } } dbTran.Commit(); flag = true; } catch { dbTran.Rollback(); flag = false; } finally { connection.Close(); } } if (flag) { SubsiteSalesProvider.Instance().UpdateProductSaleCounts(order.LineItems); UpdateUserAccount(order); } return(flag); } return(false); }