using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.BLL.Sys; using CY.BLL; using CY.Model; using CY.Infrastructure.Common; using CY.WebForm.Pages.common; using CY.BLL.EC; using CY.Model.Inquiry; using System.Transactions; namespace CY.WebForm.Pages.business { public partial class ShejiOrderjiesuan : BasePage { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string Keyid = Request["Keyid"].ToString(); var orderids = Keyid.Trim(',').Split(','); if(orderids == null || orderids.Length == 0) { JavaScript.MessageBox("未传递参数!", this, true, false); return; } EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL(); EC_AcceptWayByOrderBLL _AcceptWayByOrderBLL = new EC_AcceptWayByOrderBLL(); EC_OrderBLL eC_OrderBLL = new EC_OrderBLL();//实例化订单业务操作对象 var eC_OrderBasics = new List(); foreach (var orderid in orderids) { var _eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(orderid.ToInt32().Value); if(_eC_OrderBasic.shifoujiesuan == 1) { JavaScript.MessageBox(_eC_OrderBasic.SellerOrderId + "已结算的订单不能重复结算!", this,true, false); return; } eC_OrderBasics.Add(_eC_OrderBasic); } using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted, Timeout = TransactionManager.MaximumTimeout } ) ) { try { //开始下单 foreach (var eC_OrderBasic in eC_OrderBasics) { var resul = _eC_OrderBasicBLL.UpShejijiesuanStatus(eC_OrderBasic.Keyid.Value, 1, CurrentUser.ShortName); } scope.Complete(); JavaScript.MessageBox("操作成功", this, true, true); } catch (Exception ex) { PAGEHandleException(ex); JavaScript.MessageBox("操作失败", this, true, false); } finally { // 释放资源 scope.Dispose(); } } } } } }