username@email.com
2025-05-21 a980cd04341d71216e0f59bd4b7327fe9fc50032
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL.EC;
using CY.Model;
using CY.BLL.Sys;
using CY.Infrastructure.Common;
using CY.BLL;
using CY.Model.Inquiry;
using CY.BLL.OA;
using CY.Infrastructure.Query;
using CY.WebForm.Pages.common;
using CY.SQLDAL;
namespace CY.WebForm.Pages.business
{
    //吴辉
    //后道外协
    public partial class AgSealEdit : BasePage
    {
        EC_SpecialOrdersBLL bll_EC_SpecialOrdersBLL = null;
        OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null;
        EC_OrderBLL bll_EC_OrderBLL = null;
        public Guid targetid = Guid.Empty;
 
        //初始化
        public AgSealEdit()
        {
            bll_EC_SpecialOrdersBLL = new EC_SpecialOrdersBLL();
            bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL();
            bll_EC_OrderBLL = new EC_OrderBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InitData();
            }
        }
 
        //加载合版施工单信息
        private bool InitData()
        {
            targetid = CurrentUser.MemberId;
 
            #region 获取订单及其相关
 
            EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL();
            string orderIdStr = Request["orderid"];
            if (string.IsNullOrEmpty(orderIdStr))
            {
                CY.WebForm.BasePage.JavaScript.MessageBox("未传递参数!", this);
                return false;
            }
            int? orderId = MyConvert.ConvertToInt32(orderIdStr);
            if (!orderId.HasValue)
            {
                CY.WebForm.BasePage.JavaScript.MessageBox("未传递参数!", this);
                return false;
            }
 
            EC_OrderBasic _eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(orderId.Value);
            if (null == _eC_OrderBasic)
            {
                CY.WebForm.BasePage.JavaScript.MessageBox("数据不存在!", this);
                return false;
            }
 
            EC_OrderPrintParameterBLL _eC_OrderPrintParameterBLL = new EC_OrderPrintParameterBLL();
            EC_OrderPrintParameter _eC_OrderPrintParameter = _eC_OrderPrintParameterBLL.GetModel(orderId.Value);
            InquiryCommonModel _inquiryCommonModel = null;
            if (null == _eC_OrderPrintParameter)
            {
                _inquiryCommonModel = new InquiryCommonModel();
            }
            else
            {
                _inquiryCommonModel = SerializationHelper.DeSerialize(typeof(InquiryCommonModel), _eC_OrderPrintParameter.PrintParameter) as InquiryCommonModel;
            }
 
            #endregion
 
           
 
            this.spanOrderNum.InnerText = _eC_OrderBasic.SellerOrderId;
    
            this.spanOrderTitle.InnerText = _eC_OrderBasic.DocumentName;
            this.spanCustomName.InnerText = _eC_OrderBasic.BuyerName;
            this.spanPrintCount.InnerText = _eC_OrderBasic.OrderExtend.PrintNum.ToString2();
            this.txtBookNumber.Value = _eC_OrderBasic.OrderExtend.BookNum.ToString2();
            this.txtBookPrice.Value = _eC_OrderBasic.OrderExtend.BookPrice.ToString2();
            this.txtNumberPerBag.Value = _eC_OrderBasic.OrderExtend.NumPerBag.ToString2();
            this.txtBagNum.Value = _eC_OrderBasic.OrderExtend.BagNum.ToString2();
            if (_eC_OrderBasic.PrintTypeId != 6)
            {
                
                this.trbook.Style.Add("display", "none");
            }
            else
            {
                //this.trbook.Style.Add("display", "block");
            }
           
 
            Pagination pa = new Pagination();
            pa.PageSize = 500;
            pa.PageIndex = 1;
          
 
            return true;
        }
 
        //提交事件
        protected void btn_Submit_form(object sender, EventArgs e)
        {
            try
            {
                if (SaveOrder())
                    JavaScript.RefreshDIVOpener(this);
                else
                    JavaScript.MessageBox("操作失败", this);
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                JavaScript.MessageBox("操作失败", this);
            }
        }
 
        //保存订单
        private bool SaveOrder()
        {
            EC_OrderBasicBLL _eC_OrderBasicBLL = new EC_OrderBasicBLL();
            string orderIdStr = Request["orderid"];
            if (string.IsNullOrEmpty(orderIdStr) || "0".Equals(orderIdStr))
                return false;
 
            if (string.IsNullOrEmpty(orderIdStr))
            {
                JavaScript.MessageBox("未传递参数!", this);
                return false;
            }
            int? orderid = MyConvert.ConvertToInt32(orderIdStr);
            if (!orderid.HasValue)
            {
                JavaScript.MessageBox("未传递参数!", this);
                return false;
            }
 
            EC_OrderBasic _eC_OrderBasic = _eC_OrderBasicBLL.SelectModelById(orderid.Value);
 
            EC_OrderExtend OrderExtend = _eC_OrderBasic.OrderExtend;
            OrderExtend.BookNum = txtBookNumber.Value;
            OrderExtend.BookPrice = txtBookPrice.Value;
            OrderExtend.NumPerBag = txtNumberPerBag.Value;
            OrderExtend.BagNum = txtBagNum.Value;
            
           
            return bll_EC_OrderBLL.OldUpdate(OrderExtend);
 
        }
    }
}