username@email.com
2021-09-02 9da546cd8de37882147f19f6f090544476bfe5ae
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
/**  
* OrderMoneyReceive.aspx.cs
*
* 功 能: 订单收款
* 类 名: OrderMoneyReceive
*
* Ver    变更日期             负责人  变更内容
* ───────────────────────────────────
* V0.01  2013-5-28 13:44      吴崎均    初版
*/
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.Infrastructure.Common;
using CY.Model;
using CY.BLL.OA;
using CY.BLL.Sys;
using System.Text;
using CY.BLL;
using System.Transactions;
namespace CY.WebForm.Pages.business
{
    public partial class InvoicingConfirmEdit : BasePage
    {
        private EC_OrderBLL _eC_OrderBLL = null;
 
        private OA_CorporateClientsBLL bll_OA_CorporateClientsBLL = null;
        private EC_OrderBasicBLL _eC_OrderBasicBLL = null; 
 
 
        private OA_StaffBLL _StaffBLL = null;
        OA_KaipiaoshenqingBLL oA_KaipiaoshenqingBLL = null;
 
        /// <summary>
        /// 初始化构造 
        /// </summary>
        public InvoicingConfirmEdit()
        {
            bll_OA_CorporateClientsBLL = new OA_CorporateClientsBLL();
            _StaffBLL = new OA_StaffBLL();
            _eC_OrderBasicBLL = new EC_OrderBasicBLL();
            oA_KaipiaoshenqingBLL = new OA_KaipiaoshenqingBLL();
        }
        /// <summary>
        /// 界面加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            _eC_OrderBLL = new EC_OrderBLL();
            btnSubmit.ServerClick += new EventHandler(btnSubmit_ServerClick);
 
            LoadOrder();
            if (IsPostBack || IsCallback)
                return;
          
 
        }
 
        /// <summary>
        /// 提交按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnSubmit_ServerClick(object sender, EventArgs e)
        {
            string orderIds = Request["ids"];
 
            bool isWin = false;
            OA_Kaipiaoshenqing oA_Kaipiaoshenqing = oA_KaipiaoshenqingBLL.GetModelByKeyid(orderIds.ToGuid2());
 
 
 
 
            oA_Kaipiaoshenqing.Kaipiaoshenqing = 3;
            oA_Kaipiaoshenqing.KaipiaoquerenCreater = CurrentUser.TrueMemberId;
            oA_Kaipiaoshenqing.KaipiaoquerenTime = DateTime.Now;
 
            isWin = oA_KaipiaoshenqingBLL.UpdateModel(oA_Kaipiaoshenqing);
 
 
 
 
 
            if (isWin)
            {
                JavaScript.MessageBox("操作成功", this, true, true);
            }
            else
            {
                JavaScript.MessageBox("操作失败", this);
            }
            //JavaScript.MessageBox(isWin ? "收款成功!" : "收款失败!", this, "top.frmright.ReLoad();top.Dialog.close();");
            // Request.RequestContext.RouteData.DataTokens.Add("IsWin", isWin ? "1" : "");
 
 
 
        }
 
 
        /// <summary>
        /// 加载订单
        /// </summary>
        private void LoadOrder()
        {
            try
            {
                string orderIds = Request["id"];
            if (string.IsNullOrEmpty(orderIds))
            {
                JavaScript.MessageBox("订单不存在!", this);
                return;
            }
 
            this.ids.Value = orderIds;
            OA_Kaipiaoshenqing oA_Kaipiaoshenqing = oA_KaipiaoshenqingBLL.GetModelByKeyid(orderIds.ToGuid2());
            OA_CorporateClients m_OA_CorporateClients = bll_OA_CorporateClientsBLL.SelectModelByFirmIdandMemberId(CurrentUser.MemberId, oA_Kaipiaoshenqing.BuyerId);
 
            this.txtBuyerName.InnerText = m_OA_CorporateClients.CompanyName;
            OA_Staff oA_Staff = _StaffBLL.GetModelByKeyid(oA_Kaipiaoshenqing.BusinessManagerId);
            if (oA_Staff != null)
            {
                this.txtBusinessManager.InnerText = oA_Staff.Name;
            }
            this.txtkaipiaoshijian.InnerText = DateTime.Now.ToString("yyyy-MM-dd");
            this.txtSellerOrderId.InnerText = oA_Kaipiaoshenqing.SellerOrderId;
 
 
 
 
 
                Dictionary<int, object> searchParam = new Dictionary<int, object>();
 
                SetParamValue(searchParam, 1, CurrentUser.MemberId);
                SetParamValue(searchParam, 2, "");
                SetParamValue(searchParam, 3, "");
                SetParamValue(searchParam, 4, "");
                SetParamValue(searchParam, 5, "");
                SetParamValue(searchParam, 6, "");
                SetParamValue(searchParam, 7, "");
                SetParamValue(searchParam, 8, "");
                SetParamValue(searchParam, 9, "");
                SetParamValue(searchParam, 10, "");
                SetParamValue(searchParam, 11, "");
                SetParamValue(searchParam, 12, "");
                SetParamValue(searchParam, 13, "");
                SetParamValue(searchParam, 14, "");
                SetParamValue(searchParam, 15, "");
                SetParamValue(searchParam, 16, "");
                SetParamValue(searchParam, 18, (CurrentUser.StaffId > 0 ? 1 : 0));
                SetParamValue(searchParam, 19, CurrentUser.TrueMemberId);
                SetParamValue(searchParam, 20, CurrentUser.StaffId);
                SetParamValue(searchParam, 21, CurrentUser.TrueName);
                SetParamValue(searchParam, 22, "");
                SetParamValue(searchParam, 23, "");
                SetParamValue(searchParam, 24, "");
                SetParamValue(searchParam, 25, "");
                SetParamValue(searchParam, 26, orderIds.ToGuid2());
                SearchParam = searchParam;
 
 
                /// UCPager1.AspNetPager.CurrentPageIndex = 1;//重置页数
                //再次查询
                //   AspNetPager_PageChanged(UCPager1.AspNetPager, new EventArgs());
                Infrastructure.Query.Pagination pagination = new Infrastructure.Query.Pagination()
                {
                    PageSize = 1000,// UCPager1.AspNetPager.PageSize,
                    PageIndex = 1// UCPager1.AspNetPager.CurrentPageIndex
                };
                IEnumerable<EC_OrderBasic> result = _eC_OrderBasicBLL.SelectModelPage_Seller(pagination, searchParam);//.Where(x=>x.Quchudingdan == 2);
 
                decimal shoukuanmoney = 0;
                this.txtshuliang.InnerText = result.ToList().Count.ToString();
 
 
 
 
                foreach (EC_OrderBasic eC_OrderBasic in result)
                {
                   
                    
 
 
                    shoukuanmoney += eC_OrderBasic.SumPrice.Value;
 
 
                     
                }
                this.txtjine.InnerText = String.Format("{0:F}", shoukuanmoney);
 
               
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                JavaScript.MessageBox("订单不存在!", this);
            }
 
 
        }
        /// <summary>
        /// 设置查询参数方法
        /// </summary>
        /// <param name="target">设置目标</param>
        /// <param name="key">键</param>
        /// <param name="value">值</param>
        private static void SetParamValue(Dictionary<int, object> target, int key, object value)
        {
            if (string.IsNullOrEmpty(string.Format("{0}", value)))
                return;
            else
            {
            }
 
            if (target.ContainsKey(key))
            {
                target[key] = value;
            }
            else
            {
                target.Add(key, value);
            }
        }
 
        /// <summary>
        /// 查询参数
        /// </summary>
        private Dictionary<int, object> SearchParam
        {
            get
            {
                return ViewState["SearchParam"] as Dictionary<int, object>;
            }
            set
            {
                ViewState["SearchParam"] = value;
            }
        }
 
    }
}