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
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
/**  
* OrderReceiveMoney.aspx.cs
*
* 功 能: 订单财务管理
* 类 名: OrderFinancial
*
* Ver    变更日期             负责人  变更内容
* ───────────────────────────────────
* V0.01  2013-5-28 14:35       吴崎均    初版
*/
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.BLL.Sys;
using CY.Model;
using CY.Infrastructure.Common;
using CY.BLL;
 
namespace CY.WebForm.Pages.business
{
    /// <summary>
    /// 订单财务管理
    /// </summary>
    public partial class SendAllIntLookBTable : BasePage
    {
 
        EC_OrderBasicBLL _eC_OrderBasicBLL = null;
        OA_StaffBLL bll_OA_StaffBLL = null;
 
        /// <summary>
        /// 初始化构造
        /// </summary>
        public SendAllIntLookBTable()
        {
            _eC_OrderBasicBLL = new EC_OrderBasicBLL();
            bll_OA_StaffBLL = new OA_StaffBLL();
        }
 
        /// <summary>
        /// 加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                switch (Request["Target"])
                {
                    case "":
                        break;
                    default:
                        Page_Load_Default();
                        return;
                }
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                Response.Clear();
                Response.Write("-1");
            }
            Response.End();
        }
 
        /// <summary>
        /// 默认执行方法
        /// </summary>
        private void Page_Load_Default()
        {
            UCPager1.AspNetPager.PageChanged += AspNetPager_PageChanged;
            this.btn_Search.Click += btn_Search_Click;
            this.txtCommission.Value = CY.Config.WebInfo.Instance.FirmOrderAgencyFee;
 
            if (!IsPostBack && !IsCallback)
            {
                Sys_DictionaryBLL _sys_DictionaryBLL = new Sys_DictionaryBLL();//字典业务逻辑操作类对象
                SysInquiry_PrintingTypeBLL _sysInquiry_PrintingTypeBLL = new SysInquiry_PrintingTypeBLL();//印刷业务类型业务逻辑操作类对象
 
                this.selPrintTypes.DataSource = _sysInquiry_PrintingTypeBLL.SelectUsedModles();
                this.selPrintTypes.DataBind();
                this.selPrintTypes.Items.Add(new ListItem("其他", "-1"));
 
                this.selOrderTypes.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单类型");
                this.selPayStates.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单支付状态");
                this.selOrderStates.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单状态");
                this.selCustormerLevels.DataSource = _sys_DictionaryBLL.GetDataByType("客户重要程度");
 
                this.selCustormerLevels.DataBind();
                this.selOrderTypes.DataBind();
                this.selPayStates.DataBind();
                this.selOrderStates.DataBind();
 
                this.selPrintTypes.Items.Insert(0, new ListItem("全部", ""));
                this.selOrderTypes.Items.Insert(0, new ListItem("全部", ""));
                this.selPayStates.Items.Insert(0, new ListItem("全部", ""));
                this.selOrderStates.Items.Insert(0, new ListItem("全部", ""));
                this.selCustormerLevels.Items.Insert(0, new ListItem("全部", ""));
 
                this.selPrintTypes.Value =
                this.selOrderTypes.Value =
                this.selPayStates.Value =
                this.selOrderStates.Value =
                this.selCustormerLevels.Value = "";
 
                //业务经理  
                this.selBusinessManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, true, false);
                this.selBusinessManagerId.DataTextField = "Name";
                this.selBusinessManagerId.DataValueField = "Keyid";
                this.selBusinessManagerId.DataBind();
                this.selBusinessManagerId.Items.Insert(0, new ListItem("全部", ""));
                this.selBusinessManagerId.Items.Insert(1, new ListItem(CurrentUser.ShortName, "0"));
                this.selBusinessManagerId.Value = Request["StuffKeyId"];
 
                //客户经理
                this.selAccountManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, false, true);
                this.selAccountManagerId.DataTextField = "Name";
                this.selAccountManagerId.DataValueField = "Keyid";
                this.selAccountManagerId.DataBind();
                this.selAccountManagerId.Items.Insert(0, new ListItem("全部", ""));
                this.selAccountManagerId.Items.Insert(1, new ListItem(CurrentUser.ShortName, "0"));
 
                //初次数据加载
                btn_Search_Click(btn_Search, new EventArgs());
            }
        }
 
        /// <summary>
        /// 搜索按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Search_Click(object sender, EventArgs e)
        {
            Dictionary<int, object> searchParam = new Dictionary<int, object>();
            Guid customeid = MyConvert.ConvertToGuid(Request["customeid"]);
            if (!Guid.Empty.Equals(customeid))
                SetParamValue(searchParam, 0, customeid);
            SetParamValue(searchParam, 1, CurrentUser.MemberId);
            SetParamValue(searchParam, 2, this.txtOrderId.Value.Trim());
            SetParamValue(searchParam, 3, this.txtCustormerName.Value.Trim());
            SetParamValue(searchParam, 4, this.txtBeginData.Value.Trim());
            SetParamValue(searchParam, 5, this.txtEndDate.Value.Trim());
            SetParamValue(searchParam, 6, this.selPrintTypes.Value);
            SetParamValue(searchParam, 7, this.selOrderTypes.Value);
            SetParamValue(searchParam, 8, this.selOrderStates.Value);
            SetParamValue(searchParam, 9, this.selPayStates.Value);
            SetParamValue(searchParam, 10, this.txtCreaterName.Value.Trim());
            SetParamValue(searchParam, 11, this.selCustormerLevels.Value);
            SetParamValue(searchParam, 12, this.selAccountManagerId.Value);
            SetParamValue(searchParam, 13, this.selBusinessManagerId.Value);
 
            SearchParam = searchParam;
            UCPager1.AspNetPager.CurrentPageIndex = 1;//重置页数
            //再次查询
            AspNetPager_PageChanged(UCPager1.AspNetPager, new EventArgs());
        }
 
        /// <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>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AspNetPager_PageChanged(object sender, EventArgs e)
        {
            //UCPager1.AspNetPager.PageSize = 3;
 
            Infrastructure.Query.Pagination pagination = new Infrastructure.Query.Pagination()
            {
                PageSize = UCPager1.AspNetPager.PageSize,
                PageIndex = UCPager1.AspNetPager.CurrentPageIndex
            };
            IEnumerable<EC_OrderBasic> result = _eC_OrderBasicBLL.SelectModelPage_Financial(pagination, SearchParam);
            rptData.DataSource = result;
            rptData.DataBind();
 
            UCPager1.AspNetPager.RecordCount = pagination.RecordCount;
 
            EC_OrderBasic m_EC_OrderBasic = _eC_OrderBasicBLL.SumOrderMoney_receive(pagination, SearchParam);
            if (m_EC_OrderBasic != null)
            {
                this.AllMoney.InnerText = (m_EC_OrderBasic.OrAllTradingMoney ?? 0).ToString("0.00");
                this.AlreadyMoney.InnerText = (m_EC_OrderBasic.OrAllPayedMoney ?? 0).ToString("0.00");
                this.NoMoney.InnerText = (m_EC_OrderBasic.OrAllUnPayedMoney ?? 0).ToString("0.00");
            }
        }
 
        /// <summary>
        /// 查询参数
        /// </summary>
        private Dictionary<int, object> SearchParam
        {
            get
            {
                return ViewState["SearchParam"] as Dictionary<int, object>;
            }
            set
            {
                ViewState["SearchParam"] = value;
            }
        }
    }
}