SysManageProject.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:3k
- 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 com.etong.BusinessRule.Zwf;
- public partial class SysManage_SysManageProject : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- DataView dv = new DataView();
- EtongZwf etongzwf = new EtongZwf();
- dv = etongzwf.ProjectSearch(-1);
- this.GridView1.DataSource = dv;
- this.GridView1.DataBind();
- }
- }
- protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
- {
- GridView1.PageIndex = e.NewPageIndex;
- EtongZwf etongzwf = new EtongZwf();
- DataView dv = etongzwf.ProjectSearch(-1);
- dv.Sort = (string)ViewState["sortFieldName"];
- this.GridView1.DataSource = dv;
- this.GridView1.DataBind();
- }
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';");
- e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#E8F2FA';");
- }
- }
- protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
- {
- try
- {
- int serialid = Convert.ToInt16(GridView1.DataKeys[e.RowIndex].Value.ToString());
- EtongZwf etongzwf = new EtongZwf();
- etongzwf.ProjectDelete(serialid);
- GridView1.DataSource = etongzwf.ProjectSearch(-1);
- GridView1.DataBind();
- ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:删除记录成功!');</script>");
- }
- catch (Exception ex)
- {
- ClientScript.RegisterStartupScript(this.GetType(), "errorMessage", "<script>alert('" + ex.Message.Replace("'", "").Replace("rn", "") + "');</script>");
- }
- }
- protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
- {
- int serialid = Convert.ToInt16(GridView1.DataKeys[e.NewEditIndex].Value.ToString());
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "window.showModalDialog('ProjectUpdata.aspx?Serialid=" + serialid + "','','help:0;dialogWidth:'+420+'px;dialogHeight:'+350+'px,location=no, status=no;');window.location.replace(window.location.href);", true);//window.location.reload();
-
- }
- protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
- {
- }
- }