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
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.BLL;
using CY.Infrastructure.Common;
 
namespace CY.WebForm.Pages.business
{
    //吴辉
    //生产安排
    public partial class AgOrderProduction : BasePage
    {
 
        EC_OrderBasicBLL _eC_OrderBasicBLL = null;
        OA_StaffBLL bll_OA_StaffBLL = null;
        public bool IsUse = false;
 
        /// <summary>
        /// 初始化构造
        /// </summary>
        public AgOrderProduction()
        {
            _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"])
                {
                    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;
            List<EC_OrderDialogue> dialogues = _eC_OrderBasicBLL.SelectPropertyChangeRequest(CurrentUser.MemberId) as List<EC_OrderDialogue>;
 
            if (!IsPostBack && !IsCallback)
            {
                Sys_DictionaryBLL _sys_DictionaryBLL = new Sys_DictionaryBLL();//字典业务逻辑操作类对象
                SysInquiry_PrintingTypeBLL _sysInquiry_PrintingTypeBLL = new SysInquiry_PrintingTypeBLL();//印刷业务类型业务逻辑操作类对象
 
                this.selPayStates.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单支付状态");
                this.selPayStates.DataBind();
                this.selPayStates.Items.Add(new ListItem("所有", ""));
 
                this.selPrintTypes.DataSource = _sysInquiry_PrintingTypeBLL.SelectUsedModles();
                this.selPrintTypes.DataBind();
                this.selPrintTypes.Items.Add(new ListItem("其他", "-1"));
 
                this.selOrderTypes.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单类型");
                //selOrderStates.DataSource = _sys_DictionaryBLL.GetDataByType("EC_订单状态");
 
                this.selOrderTypes.DataBind();
                //selOrderStates.DataBind();
 
                this.selPrintTypes.Items.Insert(0, new ListItem("所有", ""));
                this.selOrderTypes.Items.Add(new ListItem("所有", ""));
                this.selOrderStates.Items.Add(new ListItem("所有", ""));
                this.selOrderStates.Items.Add(new ListItem("未开工", "2"));
                this.selOrderStates.Items.Add(new ListItem("已开工", "3"));
 
                this.selPrintTypes.Value = "";
                this.selOrderTypes.Value = "";
                this.selOrderStates.Value = "2";
                this.selPayStates.Value = "";
 
                this.selClientManager.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, false, true);
                this.selClientManager.DataTextField = "Name";
                this.selClientManager.DataValueField = "Name";
                this.selClientManager.DataBind();
                this.selClientManager.Items.Insert(0, new ListItem("全部", ""));
 
                this.selBusinessManager.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, true, false);
                this.selBusinessManager.DataTextField = "Name";
                this.selBusinessManager.DataValueField = "Name";
                this.selBusinessManager.DataBind();
                this.selBusinessManager.Items.Insert(0, new ListItem("全部", ""));
 
                //初次数据加载
                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>();
 
            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, "");
            SetParamValue(searchParam, 12, this.selClientManager.Value);
            SetParamValue(searchParam, 13, this.selBusinessManager.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 = 25;
 
            Infrastructure.Query.Pagination pagination = new Infrastructure.Query.Pagination()
            {
                PageSize = UCPager1.AspNetPager.PageSize,
                PageIndex = UCPager1.AspNetPager.CurrentPageIndex
            };
            IEnumerable<EC_OrderBasic> result = _eC_OrderBasicBLL.SelectModelPageAg(pagination, SearchParam);
            rptData.DataSource = result;
            rptData.DataBind();
 
            UCPager1.AspNetPager.RecordCount = pagination.RecordCount;
        }
 
        /// <summary>
        /// 查询参数
        /// </summary>
        private Dictionary<int, object> SearchParam
        {
            get
            {
                return ViewState["SearchParam"] as Dictionary<int, object>;
            }
            set
            {
                ViewState["SearchParam"] = value;
            }
        }
    }
}