ArticleClass.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_ArticleClass : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- InitData();
- }
- private void InitData()
- {
- DataSet ds = ArticleClass.Queryclass();
- ClassGV.DataSource = ds;
- ClassGV.DataBind();
- }
- protected void ClassGV_PageIndexChanging(object sender, GridViewPageEventArgs e)
- {
- ClassGV.PageIndex = e.NewPageIndex;
- InitData();
- }
- protected void ClassGV_RowCommand(object sender, GridViewCommandEventArgs e)
- {
- int index = Convert.ToInt32(e.CommandArgument); //待处理的行下标
- int id = -1;
- switch (e.CommandName)
- {
- //删除
- case "Delete":
- id = Convert.ToInt32(ClassGV.Rows[index].Cells[0].Text);
- ArticleClass articleClass = new ArticleClass();
- articleClass.LoadData(id);
- articleClass.Delete();
- Response.Write("<Script Language=JavaScript>alert('删除成功!');</Script>");
- InitData();
- break;
- default:
- break;
- }
- }
- protected void ClassGV_RowDeleting(object sender, GridViewDeleteEventArgs e)
- {
- ;
- }
- }