username@email.com
2025-05-09 66beb245e516809514642c00922f0339bf760518
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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();
                    }
 
                }
 
 
 
            }
        }
    }
}