messagelist.aspx.cs
资源名称:moban.rar [点击查看]
上传用户:szraylite
上传日期:2018-06-06
资源大小:11546k
文件大小:2k
源码类别:
软件测试
开发平台:
Java
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using ENTERPRISE.BusinessLogicLayer;
- public partial class admin_messagelist : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- InitData();
- }
- private void InitData()
- {
- DataSet ds = Messages.QueryMessages();
- GV.DataSource = ds;
- GV.DataBind();
- }
- protected void GV_PageIndexChanging(object sender, GridViewPageEventArgs e)
- {
- GV.PageIndex = e.NewPageIndex;
- InitData();
- }
- protected void GV_RowCommand(object sender, GridViewCommandEventArgs e)
- {
- int index = Convert.ToInt32(e.CommandArgument); //待处理的行下标
- int id= -1;
- switch (e.CommandName)
- {
- //删除
- case "Delete":
- id = Convert.ToInt32(GV.Rows[index].Cells[0].Text);
- Messages messages = new Messages();
- messages.LoadData(id);
- messages.Delete();
- Response.Write("<Script Language=JavaScript>alert('删除成功!');</Script>");
- InitData();
- break;
- default:
- break;
- }
- }
- protected void GV_RowDeleting(object sender, GridViewDeleteEventArgs e)
- {
- ;
- }
- }