温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:某公司人事工资管理系统源码
当前文件路径:StaffSalaryManage/FileManage/LeaveForm.aspx.cs

1//文件名:LeaveForm.aspx.cs 2
using System; 3
using System.Data; 4
using System.Configuration; 5
using System.Collections; 6
using System.Web; 7
using System.Web.Security; 8
using System.Web.UI; 9
using System.Web.UI.WebControls; 10
using System.Web.UI.WebControls.WebParts; 11
using System.Web.UI.HtmlControls; 12
13
public partial class FileManage_LeaveForm : System.Web.UI.Page 14
{ 15
protected void Page_Load(object sender, EventArgs e) 16
{ 17
string MyForbidString = Session["MyForbid"].ToString(); 18
if (MyForbidString.IndexOf("A7") > 1) 19
{ 20
Server.Transfer("~/SystemManage/AllErrorHelp.aspx"); 21
} 22
} 23
protected void Button2_Click(object sender, EventArgs e) 24
{//新增员工离职信息 25
this.SqlDataSource3.Insert(); 26
this.DropDownList1.DataBind(); 27
} 28
protected void Button3_Click(object sender, EventArgs e) 29
{//修改员工离职信息 30
this.SqlDataSource3.Update(); 31
32
} 33
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) 34
{//弹出删除操作确认对话框 35
if (e.Row.RowType == DataControlRowType.DataRow) 36
{ 37
Button MyButton = (Button)e.Row.FindControl("Button1"); 38
MyButton.OnClientClick = "return confirm('是否确认删除当前选择的记录?')"; 39
} 40
} 41
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) 42
{//在控件中显示选择的记录 43
this.TextBox2.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); 44
this.TextBox3.Text = this.GridView1.SelectedRow.Cells[5].Text.ToString(); 45
this.TextBox4.Text = this.GridView1.SelectedRow.Cells[6].Text.ToString(); 46
this.TextBox5.Text = this.GridView1.SelectedRow.Cells[7].Text.ToString(); 47
this.TextBox6.Text = this.GridView1.SelectedRow.Cells[8].Text.ToString(); 48
} 49
} 50





}
}