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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL;
using CY.Model;
using CY.Infrastructure.Query;
using CY.Infrastructure.Common;
using CY.BLL.Sys;
using CY.BLL.OA;
using CY.BLL.EC;
using CY.BLL.Inquiry;
using CY.Model.Inquiry;
using System.Drawing;
 
namespace CY.WebForm.APP.Pages 
{
    public partial class DeliverSignList : BasePageApp
    {
 
        OA_DeliverPlanBLL _OA_DeliverPlanBLL = null;
        OA_StaffBLL bll_OA_StaffBLL = null;
        OA_CarManageBll _OA_CarManageBll = null;
 
 
 
        //初始化
        public DeliverSignList()
        {
 
            _OA_DeliverPlanBLL = new OA_DeliverPlanBLL();
            bll_OA_StaffBLL = new OA_StaffBLL();
            _OA_CarManageBll = new OA_CarManageBll();
 
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            
            if (!IsPostBack)
            {
 
 
 
                InitialSelectData();
                BindList();
               // Response.End();
            }
        }
 
 
        //加载查询条件
        protected void InitialSelectData()
        {
            
 
            this.Button1.Text = DateTime.Now.ToString("yyyy-MM-dd");
            this.Button2.Text = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
            this.Button3.Text = DateTime.Now.AddDays(2).ToString("yyyy-MM-dd");
            this.Button4.Text = DateTime.Now.AddDays(3).ToString("yyyy-MM-dd");
            this.Button5.Text = DateTime.Now.AddDays(4).ToString("yyyy-MM-dd");
            this.Button6.Text = DateTime.Now.AddDays(5).ToString("yyyy-MM-dd");
            this.Button7.Text = DateTime.Now.AddDays(6).ToString("yyyy-MM-dd");
 
 
            //this.DriverId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId, null, null).Where(x => x.SM_Post.Equals("驾驶员"));
            //this.DriverId.DataTextField = "Name";
            //this.DriverId.DataValueField = "Keyid";
            //this.DriverId.DataBind();
            //this.DriverId.Items.Insert(0, new ListItem("请选择", ""));
 
            //this.CarId.DataSource = _OA_CarManageBll.SelectListByFirmId(CurrentUser.MemberId);
            //this.CarId.DataTextField = "CarNumber";
            //this.CarId.DataValueField = "Keyid";
            //this.CarId.DataBind();
            //this.CarId.Items.Insert(0, new ListItem("请选择", ""));
 
        }
 
        //分页事件
        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            BindList();
        }
 
        //查询事件
        protected void btn_Search_Click(object sender, EventArgs e)
        {
            BindList();
        }
 
        protected void btn_Search_Click1(object sender, EventArgs e)
        {
 
            this.txtDeliveryTime.Value = this.Button1.Text;
 
            BindList();
        }
        protected void btn_Search_Click2(object sender, EventArgs e)
        {
 
            this.txtDeliveryTime.Value = this.Button2.Text;
 
            BindList();
        }
        protected void btn_Search_Click3(object sender, EventArgs e)
        {
 
            this.txtDeliveryTime.Value = this.Button3.Text;
 
            BindList();
        }
        protected void btn_Search_Click4(object sender, EventArgs e)
        {
 
            this.txtDeliveryTime.Value = this.Button4.Text;
 
            BindList();
        }
        protected void btn_Search_Click5(object sender, EventArgs e)
        {
 
            this.txtDeliveryTime.Value = this.Button5.Text;
 
            BindList();
        }
        protected void btn_Search_Click6(object sender, EventArgs e)
        {
 
            this.txtDeliveryTime.Value = this.Button6.Text;
 
            BindList();
        }
        protected void btn_Search_Click7(object sender, EventArgs e)
        {
 
            this.txtDeliveryTime.Value = this.Button7.Text;
 
            BindList();
        }
 
        //绑定列表
        private void BindList()
        {
            if (this.txtDeliveryTime.Value == "")
            {
                this.txtDeliveryTime.Value = this.Button1.Text;
            }
            if (this.txtDeliveryTime.Value == this.Button1.Text)
            {
                this.Button1.BorderColor = Color.Black;
                this.Button2.BorderColor = Color.LightBlue;
                this.Button3.BorderColor = Color.LightBlue;
                this.Button4.BorderColor = Color.LightBlue;
                this.Button5.BorderColor = Color.LightBlue;
                this.Button6.BorderColor = Color.LightBlue;
                this.Button7.BorderColor = Color.LightBlue;
            }
            else if (this.txtDeliveryTime.Value == this.Button2.Text)
            {
                this.Button2.BorderColor = Color.Black;
                this.Button1.BorderColor = Color.LightBlue;
                this.Button3.BorderColor = Color.LightBlue;
                this.Button4.BorderColor = Color.LightBlue;
                this.Button5.BorderColor = Color.LightBlue;
                this.Button6.BorderColor = Color.LightBlue;
                this.Button7.BorderColor = Color.LightBlue;
            }
            else if (this.txtDeliveryTime.Value == this.Button3.Text)
            {
                this.Button3.BorderColor = Color.Black;
                this.Button2.BorderColor = Color.LightBlue;
                this.Button1.BorderColor = Color.LightBlue;
                this.Button4.BorderColor = Color.LightBlue;
                this.Button5.BorderColor = Color.LightBlue;
                this.Button6.BorderColor = Color.LightBlue;
                this.Button7.BorderColor = Color.LightBlue;
            }
            else if (this.txtDeliveryTime.Value == this.Button4.Text)
            {
                this.Button4.BorderColor = Color.Black;
                this.Button2.BorderColor = Color.LightBlue;
                this.Button3.BorderColor = Color.LightBlue;
                this.Button1.BorderColor = Color.LightBlue;
                this.Button5.BorderColor = Color.LightBlue;
                this.Button6.BorderColor = Color.LightBlue;
                this.Button7.BorderColor = Color.LightBlue;
            }
            else if (this.txtDeliveryTime.Value == this.Button5.Text)
            {
                this.Button5.BorderColor = Color.Black;
                this.Button2.BorderColor = Color.LightBlue;
                this.Button3.BorderColor = Color.LightBlue;
                this.Button4.BorderColor = Color.LightBlue;
                this.Button1.BorderColor = Color.LightBlue;
                this.Button6.BorderColor = Color.LightBlue;
                this.Button7.BorderColor = Color.LightBlue;
            }
            else if (this.txtDeliveryTime.Value == this.Button6.Text)
            {
                this.Button6.BorderColor = Color.Black;
                this.Button2.BorderColor = Color.LightBlue;
                this.Button3.BorderColor = Color.LightBlue;
                this.Button4.BorderColor = Color.LightBlue;
                this.Button5.BorderColor = Color.LightBlue;
                this.Button1.BorderColor = Color.LightBlue;
                this.Button7.BorderColor = Color.LightBlue;
            }
            else if (this.txtDeliveryTime.Value == this.Button7.Text)
            {
                this.Button7.BorderColor = Color.Black;
                this.Button2.BorderColor = Color.LightBlue;
                this.Button3.BorderColor = Color.LightBlue;
                this.Button4.BorderColor = Color.LightBlue;
                this.Button5.BorderColor = Color.LightBlue;
                this.Button6.BorderColor = Color.LightBlue;
                this.Button1.BorderColor = Color.LightBlue;
            }
 
 
 
            Pagination pa = new Pagination();
            pa.PageSize = 1000;
            pa.PageIndex = 1;
 
            IEnumerable<OA_DeliverPlan> oA_DeliverPlans = _OA_DeliverPlanBLL.SelectModelPage(pa,
                CurrentUser.MemberId,
                this.txtDeliveryTime.Value,
                 "",
                "",
                CurrentUser.TrueMemberId.ToString()
              );
           foreach(var oA_DeliverPlan in oA_DeliverPlans)
            {
                if (!oA_DeliverPlan.DeliveredTime.HasValue)
                {
                    oA_DeliverPlan.qianshou = "<a href='javascript:void(0)'  class='a_under' onclick='View(\""+ oA_DeliverPlan.Keyid + "\",\"" + oA_DeliverPlan.BuyerName + "\")' >点击签收  </a>   ";
                }
                else
                {
                    oA_DeliverPlan.qianshou = oA_DeliverPlan.DeliveredTime.Value.ToString("yyyy-MM-dd");
                }
            }
 
 
 
            this.RepClientList.DataSource = oA_DeliverPlans;
 
 
 
            this.RepClientList.DataBind();
             
        }
 
         
 
 
 
    }
}