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 ShejiOrderxiadan : 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<EC_OrderBasic>();
|
foreach (var orderid in orderids)
|
{
|
var _eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(orderid.ToInt32().Value);
|
if(_eC_OrderBasic.ShejiStatus == 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.UpShejiStatus(eC_OrderBasic.Keyid.Value, 1, CurrentUser.ShortName);
|
|
if (resul)
|
{
|
var eC_OrderExtend = _eC_OrderBasicBLL.GetModelByKeyid(eC_OrderBasic.Keyid.Value);
|
eC_OrderExtend.ShejiStatus = eC_OrderBasic.Keyid.Value;
|
var acceptWayByOrder = _AcceptWayByOrderBLL.GetModelByTargetId(eC_OrderBasic.Keyid.Value);
|
var pay_TradingSingle = _eC_OrderBasicBLL.GetPayTradingById(eC_OrderBasic.Keyid.Value);
|
|
eC_OrderBasic.SellerId = CurrentUser.MemberId;
|
eC_OrderBasic.Creater = CurrentUser.ShortName;
|
eC_OrderBasic.CreateTime = DateTime.Now;
|
eC_OrderBasic.Operator = CurrentUser.ShortName;
|
eC_OrderBasic.LastUpdateTime = DateTime.Now;
|
eC_OrderBasic.AcceptWayByOrder = acceptWayByOrder;
|
// InquiryCommonModel _inquiryCommonModel = SerializationHelper.DeSerialize(typeof(InquiryCommonModel), ) as InquiryCommonModel;
|
// PayAbout.NewOrder(eC_OrderBasic, eC_OrderExtend, _inquiryCommonModel);
|
var eC_OrderPrint = new EC_OrderPrintParameter();
|
eC_OrderPrint.PrintParameter = eC_OrderBasic.PrintParameter;
|
bool isWin = eC_OrderBLL.NewOrderpiliang(eC_OrderBasic, eC_OrderExtend, pay_TradingSingle, acceptWayByOrder, null, 0, 0, eC_OrderPrint);
|
}
|
|
}
|
|
|
scope.Complete();
|
JavaScript.MessageBox("操作成功", this, true, true);
|
}
|
catch (Exception ex)
|
{
|
|
PAGEHandleException(ex);
|
JavaScript.MessageBox("操作失败", this, true, false);
|
}
|
finally
|
{
|
// 释放资源
|
scope.Dispose();
|
}
|
|
}
|
|
|
|
}
|
}
|
}
|
}
|