username@email.com
2024-12-31 7dad3e5ef9896edc58a04c7b52e2978c33396d7a
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
/**  
* SeckillBusinessList.aspx.cs
*
* 功 能: 特价业务列表管理页
* 类 名: SeckillBusinessList
*
* Ver    变更日期             负责人  变更内容
* ───────────────────────────────────
* V0.01  2013-4-9 10:43       吴崎均    初版
* V0.02  2013-4-12 17:45      吴崎均    完成分页查询、增加批量删除
* V0.03  2013-4-16            吴崎均    变更查询方式,使分页过程中修改查询条件对分页无影响
* V0.04  2013-6-16 18:40      吴崎均    细节调整,显示创建时间、时间范围搜索将截止日期加一天
*
*
*
*
*
*
*/
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;
 
namespace CY.WebForm.Pages.business
{
 
 
    /// <summary>
    /// 特价业务管理
    /// </summary>
    public partial class SeckillBusinessList : BasePage
    {
        private EC_SeckillBusinessBLL _eC_SeckillBusinessBLL = null;//特价秒杀业务逻辑操作对象
        /// <summary>
        /// 初始化
        /// </summary>
        public SeckillBusinessList()
        {
            _eC_SeckillBusinessBLL = new EC_SeckillBusinessBLL();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
 
            try
            {
                switch (Request["Target"])
                {
                    case "BatchDelete":
                        CY.WebForm.cs.WebUtil.DeleteData(_eC_SeckillBusinessBLL.DeleteDataByIds,CurrentUser.ShortName);//调用通用删除方法
                        break;
                    case "publish":
                    case "setend":
                        CY.WebForm.cs.WebUtil.ChangeState(_eC_SeckillBusinessBLL.ChangeState);//调用通用修改状态方法
                        break;
 
                    default:
 
                        UCPager1.AspNetPager.PageChanged += AspNetPager1_PageChanged;
                        btn_Search.Click += new EventHandler(btn_Search_Click);
                        if (!IsPostBack && !IsCallback)
                        {
                            BingData();
                        }
                        else { }
                        return;
                }
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                Response.Clear();
                Response.Write("-1");
 
            }
 
 
            Response.End();
 
 
        }
 
        /// <summary>
        /// 查询按钮点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Search_Click(object sender, EventArgs e)
        {
            UCPager1.AspNetPager.CurrentPageIndex = 1;
            BeginCreate = MyConvert.ConvertToDateTime(txtBeginCreate.Value);
            EndCreate = MyConvert.ConvertToDateTime(txtEndCreate.Value);
            EndCreate = EndCreate.HasValue ?(Nullable<DateTime>)EndCreate.Value.AddDays(1) : null;
            Name = MyConvert.ConvertToString(txtName.Value);
            EndCase = CY.Infrastructure.Common.MyConvert.ConvertToInt32(selIsEndCase.Value);
            BingData();
        }
        /// <summary>
        /// 分页事件
        /// </summary>
        /// <param name="src"></param>
        /// <param name="e"></param>
        protected void AspNetPager1_PageChanged(object src, EventArgs e)
        {
            BingData();
        }
 
 
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void BingData()
        {
            Infrastructure.Query.Pagination pagination = new Infrastructure.Query.Pagination() { PageSize = UCPager1.AspNetPager.PageSize, PageIndex = UCPager1.AspNetPager.CurrentPageIndex };
            Infrastructure.Query.Query query = new Infrastructure.Query.Query(true);
            txtBeginCreate.Value = BeginCreate.HasValue ? BeginCreate.Value.ToString(UtilConst.DATEFORMAT) : "";
            txtEndCreate.Value = EndCreate.HasValue ? EndCreate.Value.AddDays(-1).ToString(UtilConst.DATEFORMAT) : "";
            txtName.Value = Name;
            selIsEndCase.Value = string.Format("{0}",EndCase);
            rptData.DataSource = _eC_SeckillBusinessBLL.SelectModelPage(pagination, Name, EndCase.HasValue ? EndCase.Value : -1,CurrentUser.MemberId, BeginCreate, EndCreate);
            UCPager1.AspNetPager.RecordCount = pagination.RecordCount;
            rptData.DataBind();
        }
        #region 查询参数
        private DateTime? BeginCreate
        {
            get { return MyConvert.ConvertToDateTime(ViewState["BeginCreate"]); }
            set { ViewState["BeginCreate"] = value; }
        }
        private DateTime? EndCreate
        {
            get { return MyConvert.ConvertToDateTime(ViewState["EndCreate"]); }
            set { ViewState["EndCreate"] = value; }
        }
        private string Name
        {
            get { return MyConvert.ConvertToString(ViewState["Name"]); }
            set { ViewState["Name"] = value; }
        }
 
        private int? EndCase
        {
            get { return MyConvert.ConvertToInt32(ViewState["EndCase"]); }
            set { ViewState["EndCase"] = value; }
        } 
        #endregion
    }
}