OpRoleManager.aspx.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:4k
- 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.DAL.FC;
- public partial class SysManage_OpRoleManager : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- EtongFlyChouWFPrj EFlyPrj = new EtongFlyChouWFPrj();
- DataView dv = EFlyPrj.GetAllOpRole();
- GridView1.DataSource = dv;
- GridView1.DataBind();
- TB_Condition.Attributes.Add("onkeypress", "javascript:return EnterTextBox();");
- }
- }
- protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
- {
- int currentpageindex;
- currentpageindex = Convert.ToInt32(e.NewPageIndex);
- if (currentpageindex == -2)
- {
- TextBox txtNewPageIndex;
- txtNewPageIndex = GridView1.BottomPagerRow.FindControl("LinkTextBoxNewPage") as TextBox;
- if (txtNewPageIndex != null)
- {
- try
- {
- currentpageindex = Convert.ToInt32(txtNewPageIndex.Text) - 1;
- }
- catch
- {
- currentpageindex = 0;
- }
- }
- }
- currentpageindex = currentpageindex < 0 ? 0 : currentpageindex;
- currentpageindex = currentpageindex >= GridView1.PageCount ? GridView1.PageCount - 1 : currentpageindex;
- GridView1.PageIndex = currentpageindex;
- EtongFlyChouWFPrj EFlyPrj = new EtongFlyChouWFPrj();
- DataView dv = EFlyPrj.GetAllOpRole();
- GridView1.DataSource = dv;
- GridView1.DataBind();
- }
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- int iRow;
- iRow = e.Row.DataItemIndex;
- iRow = iRow % 2;
- if (iRow > 0)
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='#f0f0f0';");
- else
- e.Row.Attributes.Add("OnMouseOut", "this.style.backgroundColor='White';");
- e.Row.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#E8F2FA';");
- EtongFlyChouCode EFlyCode = new EtongFlyChouCode();
- try
- {
- e.Row.Cells[2].Text = EFlyCode.GetSortByID(e.Row.Cells[2].Text);
- }
- catch
- {
- e.Row.Cells[6].Text = "未知";
- }
- }
-
- }
- protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
- {
- int iOpID = Convert.ToInt32(GridView1.DataKeys[e.NewEditIndex].Value);
- string sURL = "OpRoleModify.aspx?strN=M&strOp=" + iOpID;
- //Response.Redirect(sURL);
- this.ClientScript.RegisterStartupScript(this.GetType(), "0", "<script> window.showModalDialog('" + sURL + "','业务角色修改','help:0;dialogWidth:550px;dialogHeight:600px,location=no,status=no;');</script>");
- }
- protected void IB_Search_Click(object sender, ImageClickEventArgs e)
- {
- EtongFlyChouWFPrj EFlyPrj = new EtongFlyChouWFPrj();
- if (DDL_Condition.SelectedValue == "1")
- {
- if (TB_Condition.Text == null || TB_Condition.Text.Trim() == "") ;
- else
- {
- try
- {
- EFlyPrj.OpID = Convert.ToInt32(TB_Condition.Text);
- }
- catch
- {
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('系统提示:编号查询指允许输入数据,请输入数字!');", true);
- return;
- }
- }
- }
- else if (DDL_Condition.SelectedValue == "2")
- {
- EFlyPrj.OpName = TB_Condition.Text.Trim();
- }
- else
- {
- this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('系统提示:请输入系统查询条件!');", true);
- return;
- }
- DataView dv = new DataView();
- dv = EFlyPrj.CheckOpByCondition();
- GridView1.DataSource = dv;
- GridView1.DataBind();
- }
- }