您目前尚未登陆,请选择【登陆】或【注册
首页->电子商务->明日供求信息网源码>>BackGround/LeaguerInfoDelete.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:明日供求信息网源码
当前文件:文件类型 MingriGongQiu/BackGround/LeaguerInfoDelete.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11 12public partial class BackGround_LeaguerInfoDelete : System.Web.UI.Page 13{ 14 Operation operation = new Operation(); 15 static string infoType = "";      //供求信息类型 16 static int CheckType = -1;       //3种类别:全部显示(-1代表全部显示),显示过期信息(0),显示未过期信息(1) 17 18 protected void Page_Load(object sender, EventArgs e) 19 { 20 if (!IsPostBack) 21 this.GridViewBind(); 22 } 23 private void GridViewBind() 24 { 25 GridView1.DataSource = operation.SelectLeaguerInfo(); 26 GridView1.DataKeyNames = new string[] {"id" }; 27 GridView1.DataBind(); 28 } 29 protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) 30 { 31 GridView1.PageIndex = e.NewPageIndex; 32 //按过期类型绑定数据(3种类别:全部显示(-1),显示过期(0),显示未过期(1)) 33 switch (CheckType) 34 { 35 case -1: 36 GridViewBind(); 37 break; 38 case 0: 39 GridView1.DataSource = operation.SelectLeaguerInfo(false); 40 GridView1.DataBind(); 41 break; 42 case 1: 43 GridView1.DataSource = operation.SelectLeaguerInfo(true); 44 GridView1.DataBind(); 45 break; 46 } 47 } 48 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 49 { 50 if (e.Row.RowType == DataControlRowType.DataRow) 51 { 52 //高亮显示指定行 53 e.Row.Attributes.Add("onMouseOver", "Color=this.style.backgroundColor;this.style.backgroundColor='#FFF000'"); 54 e.Row.Attributes.Add("onMouseOut", "this.style.backgroundColor=Color;"); 55 //进行时间格式化 56 e.Row.Cells[5].Text = Convert.ToDateTime(e.Row.Cells[5].Text).ToShortDateString(); 57 //删除指定行数据时,弹出询问对话框 58 ((LinkButton)(e.Row.Cells[8].Controls[0])).Attributes.Add("onclick", "return confirm('是否删除当前行数据!')"); 59 //多余字 使用...显示 60 e.Row.Cells[1].Text = StringFormat.Out(e.Row.Cells[2].Text, 7); 61 e.Row.Cells[2].Text = StringFormat.Out(e.Row.Cells[2].Text, 16); 62 } 63 } 64 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) 65 { 66 operation.DeleteLeaguerInfo(GridView1.DataKeys[e.RowIndex].Value.ToString()); 67 this.GridViewBind(); 68 } 69 protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) 70 { 71 string id = GridView1.DataKeys[e.NewSelectedIndex].Value.ToString(); 72 infoType = GridView1.DataKeys[e.NewSelectedIndex][0].ToString(); 73 Response.Write("<script> window.open('DetailLeaguerInfo.aspx?id=" + id + "','','scrollbars') </script>"); 74 Response.Write("<script>history.go(-1)</script>"); 75 } 76 protected void rdoBtnAll_CheckedChanged(object sender, EventArgs e) 77 { 78 CheckType = -1; 79 this.GridViewBind(); 80 } 81 protected void rdoBtnTrue_CheckedChanged(object sender, EventArgs e) 82 { 83 CheckType = 1; 84 GridView1.DataSource = operation.SelectLeaguerInfo(true); 85 GridView1.DataBind(); 86 } 87 protected void rdoBtnFalse_CheckedChanged(object sender, EventArgs e) 88 { 89 CheckType = 0; 90 GridView1.DataSource = operation.SelectLeaguerInfo(false); 91 GridView1.DataBind(); 92 } 93} 94 95
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:明日供求信息网源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号