📄 detaildate.aspx.cs
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using YXShop.Common;
using Shop.Web.UI;
namespace YXShop.Web.Admin.Consumer
{
public partial class DetailDate : System.Web.UI.Page
{
public PageSet ps; BasePage bp = null;
protected void Page_Load(object sender, EventArgs e)
{
if (!PowerTree.PowerPass.isPass("008007000",PowerTree.PowerPanel.PowerType.look))
{
bp = new BasePage();
bp.PageError("对不起,你没有查看此页面的权限!", "../index.aspx");
}
if (!Page.IsPostBack)
{
gridqx();
}
if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
{
gridqx();
}
}
#region 日期列表
private void gridqx()
{
YXShop.BLL.UserInfoNote dataCAasd = new YXShop.BLL.UserInfoNote();
int pageIndex = Request["pageIndex"] == null ? 0 : int.Parse(Request["pageIndex"]);
if (pageIndex < 0)
{
pageIndex = 0;
}
if ((Request["Event"] == null) || (Request["Event"] == ""))
{
pageIndex = 0;
}
string strsql = " NoteType = 2";
if (Request["type"] != null)
{
if (Request["type"] == "zj")
{
strsql = "NoteType = 2 and BuckleOrAdd = 0";
}
if (Request["type"] == "js")
{
strsql = "NoteType = 2 and BuckleOrAdd = 1";
}
}
List<YXShop.Model.UserInfoNote> datas = dataCAasd.GetList(strsql);
dg3.DataSource = datas;
ps = new PageSet(datas.Count, PageSet.PageSize, pageIndex);
if (ps.PageCount <= pageIndex + 1)
{
pageIndex = ps.PageCount - 1;
}
dg3.PageSize = PageSet.PageSize;
dg3.PageIndex = pageIndex;
if (datas.Count < 1)
{
dg3.BackColor = System.Drawing.Color.White;
}
dg3.DataBind();
}
#endregion
public string jiequ(string str)
{
string str1;
if (str.Length <= 35)
{
str1 = str;
}
else
{
str1 = str.Substring(0, 34) + "...";
}
return str1;
}
protected void dg3_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (!(e.Row.DataItem is YXShop.Model.UserInfoNote))
{
return;
}
YXShop.Model.UserInfoNote data = (e.Row.DataItem as YXShop.Model.UserInfoNote);
if (data != null)
{
e.Row.Cells[1].Text = data.BuckleOrAdd.ToString() == "0" ? data.TicketCount.ToString() : string.Empty;
e.Row.Cells[2].Text = data.BuckleOrAdd.ToString() == "1" ? data.TicketCount.ToString() : string.Empty; ;
}
}
#region 删除
protected void Button1_Click(object sender, EventArgs e)
{
YXShop.BLL.UserInfoNote dataca = new YXShop.BLL.UserInfoNote();
string strdel="";
if (sj.SelectedValue.ToString() == "0")
{
if(Request["typexx"].ToString() == "tj")
{
strdel = "day(NoteDate) <= day(getdate())-10 or Month(NoteDate)< Month(getdate()) or year(NoteDate)<year(getdate()) and NoteType = 2 and BuckleOrAdd = 0";
dataca.Delecttj(strdel);
}
if(Request["typexx"].ToString() == "js")
{
strdel = "day(NoteDate) <= day(getdate())-10 or Month(NoteDate)< Month(getdate()) or year(NoteDate)<year(getdate()) and NoteType = 2 and BuckleOrAdd = 1";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "all")
{
strdel = "day(NoteDate) <= day(getdate())-10 or Month(NoteDate)< Month(getdate()) or year(NoteDate)<year(getdate()) and NoteType = 2";
dataca.Delecttj(strdel);
}
}
if (sj.SelectedValue.ToString() == "1")
{
if (Request["typexx"].ToString() == "tj")
{
strdel = "Month(NoteDate) <= Month(getdate())-1 or year(NoteDate)<year(getdate()) and NoteType = 2 and BuckleOrAdd = 0";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "js")
{
strdel = "Month(NoteDate) <= Month(getdate())-1 or year(NoteDate)<year(getdate()) and NoteType = 2 and BuckleOrAdd = 1";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "all")
{
strdel = "Month(NoteDate) <= Month(getdate())-1 or year(NoteDate)<year(getdate()) and NoteType = 2";
dataca.Delecttj(strdel);
}
}
if (sj.SelectedValue.ToString() == "2")
{
if (Request["typexx"].ToString() == "tj")
{
strdel = "Month(NoteDate) = Month(getdate())-2 or year(NoteDate)<year(getdate()) and NoteType = 2 and BuckleOrAdd = 0";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "js")
{
strdel = "Month(NoteDate) = Month(getdate())-2 or year(NoteDate)<year(getdate()) and NoteType = 2 and BuckleOrAdd = 1";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "all")
{
strdel = "Month(NoteDate) = Month(getdate())-2 or year(NoteDate)<year(getdate()) and NoteType = 2";
dataca.Delecttj(strdel);
}
}
if (sj.SelectedValue.ToString() == "3")
{
if (Request["typexx"].ToString() == "tj")
{
strdel = "Month(NoteDate) = Month(getdate())-3 or year(NoteDate)<year(getdate()) and NoteType = 2 and BuckleOrAdd = 0";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "js")
{
strdel = "Month(NoteDate) = Month(getdate())-3 or year(NoteDate)<year(getdate()) and NoteType = 2 and BuckleOrAdd = 1";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "all")
{
strdel = "Month(NoteDate) = Month(getdate())-3 or year(NoteDate)<year(getdate()) and NoteType = 2";
dataca.Delecttj(strdel);
}
}
if (sj.SelectedValue.ToString() == "4")
{
if (Request["typexx"].ToString() == "tj")
{
strdel = "Month(NoteDate) = Month(getdate())-6 or year(NoteDate)<year(getdate()) and NoteType = 2 and BuckleOrAdd = 0";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "js")
{
strdel = "Month(NoteDate) = Month(getdate())-6 or year(NoteDate)<year(getdate()) and NoteType = 2 and BuckleOrAdd = 1";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "all")
{
strdel = "Month(NoteDate) = Month(getdate())-6 or year(NoteDate)<year(getdate()) and NoteType = 2";
dataca.Delecttj(strdel);
}
}
if (sj.SelectedValue.ToString() == "5")
{
if (Request["typexx"].ToString() == "tj")
{
strdel = "year(NoteDate)<=year(getdate())-1 and NoteType = 2 and BuckleOrAdd = 0";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "js")
{
strdel = "year(NoteDate)<=year(getdate())-1 and NoteType = 2 and BuckleOrAdd = 1";
dataca.Delecttj(strdel);
}
if (Request["typexx"].ToString() == "all")
{
strdel = "year(NoteDate)<=year(getdate())-1 and NoteType = 2";
dataca.Delecttj(strdel);
}
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -