SysManageProject.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:3k
源码类别:

.net编程

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using com.etong.BusinessRule.Zwf;
  12. public partial class SysManage_SysManageProject : System.Web.UI.Page
  13. {
  14.     protected void Page_Load(object sender, EventArgs e)
  15.     {
  16.         if (!IsPostBack)
  17.         {
  18.             DataView dv = new DataView();
  19.             EtongZwf etongzwf = new EtongZwf();
  20.             dv = etongzwf.ProjectSearch(-1);
  21.             this.GridView1.DataSource = dv;
  22.             this.GridView1.DataBind();
  23.         }
  24.     }
  25.     protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
  26.     {
  27.         GridView1.PageIndex = e.NewPageIndex;
  28.         EtongZwf etongzwf = new EtongZwf();
  29.         DataView dv = etongzwf.ProjectSearch(-1);
  30.         dv.Sort = (string)ViewState["sortFieldName"];
  31.         this.GridView1.DataSource = dv;
  32.         this.GridView1.DataBind();
  33.     }
  34.     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  35.     {
  36.         if (e.Row.RowType == DataControlRowType.DataRow)
  37.         {
  38.             e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';");
  39.             e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#E8F2FA';");
  40.         }
  41.     }
  42.     protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
  43.     {
  44.         try
  45.         {
  46.             int serialid = Convert.ToInt16(GridView1.DataKeys[e.RowIndex].Value.ToString());
  47.             EtongZwf etongzwf = new EtongZwf();
  48.             etongzwf.ProjectDelete(serialid);
  49.             GridView1.DataSource = etongzwf.ProjectSearch(-1);
  50.             GridView1.DataBind();
  51.             ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('系统提示:删除记录成功!');</script>");
  52.         }
  53.         catch (Exception ex)
  54.         {
  55.             ClientScript.RegisterStartupScript(this.GetType(), "errorMessage", "<script>alert('" + ex.Message.Replace("'", "").Replace("rn", "") + "');</script>");
  56.         }
  57.     }
  58.     protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
  59.     {
  60.         int serialid = Convert.ToInt16(GridView1.DataKeys[e.NewEditIndex].Value.ToString());
  61.         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();
  62.      
  63.     }
  64.     protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
  65.     {
  66.     }
  67. }