温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:固定资产管理系统源码
当前文件路径:DepreciationManage/AssetsManage/MyAssetsForm.aspx.cs

1//文件名:MyAssetsForm.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 SystemManage_AssetsManage_MyAssetsForm : 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("A1") > 1) 19
{ 20
Server.Transfer("~/SystemManage/AllErrorHelp.aspx"); 21
} 22
} 23
protected void Button2_Click(object sender, EventArgs e) 24
{//新增固定资产信息 25
this.SqlDataSource2.Insert(); 26
} 27
protected void Button3_Click(object sender, EventArgs e) 28
{//修改固定资产信息 29
this.SqlDataSource2.Update(); 30
} 31
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) 32
{//弹出删除操作确认对话框 33
if (e.Row.RowType == DataControlRowType.DataRow) 34
{ 35
Button MyButton = (Button)e.Row.FindControl("Button1"); 36
MyButton.OnClientClick = "return confirm('是否确认删除当前选择的记录?')"; 37
} 38
} 39
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) 40
{//在文本框中显示选择的记录 41
this.TextBox2.Text = this.GridView1.SelectedRow.Cells[2].Text.ToString(); 42
this.TextBox3.Text = this.GridView1.SelectedRow.Cells[3].Text.ToString(); 43
this.TextBox4.Text = this.GridView1.SelectedRow.Cells[4].Text.ToString(); 44
this.TextBox5.Text = this.GridView1.SelectedRow.Cells[5].Text.ToString(); 45
this.TextBox6.Text = this.GridView1.SelectedRow.Cells[6].Text.ToString(); 46
this.TextBox7.Text = this.GridView1.SelectedRow.Cells[7].Text.ToString(); 47
this.TextBox8.Text = this.GridView1.SelectedRow.Cells[8].Text.ToString(); 48
this.TextBox9.Text = this.GridView1.SelectedRow.Cells[9].Text.ToString(); 49
this.DropDownList1.Text = this.GridView1.SelectedRow.Cells[10].Text.ToString(); 50
this.DropDownList2.Text = this.GridView1.SelectedRow.Cells[11].Text.ToString(); 51
this.DropDownList3.Text = this.GridView1.SelectedRow.Cells[12].Text.ToString(); 52
this.DropDownList4.Text = this.GridView1.SelectedRow.Cells[13].Text.ToString(); 53
this.TextBox10.Text = this.GridView1.SelectedRow.Cells[14].Text.ToString(); 54
this.TextBox11.Text = this.GridView1.SelectedRow.Cells[15].Text.ToString(); 55
this.TextBox12.Text = this.GridView1.SelectedRow.Cells[16].Text.ToString(); 56
this.TextBox13.Text = this.GridView1.SelectedRow.Cells[17].Text.ToString(); 57
this.TextBox14.Text = this.GridView1.SelectedRow.Cells[18].Text.ToString(); 58
this.TextBox15.Text = this.GridView1.SelectedRow.Cells[19].Text.ToString(); 59
this.DropDownList5.Text = this.GridView1.SelectedRow.Cells[20].Text.ToString(); 60
this.TextBox16.Text = this.GridView1.SelectedRow.Cells[21].Text.ToString(); 61
this.TextBox17.Text = this.GridView1.SelectedRow.Cells[22].Text.ToString(); 62
this.TextBox18.Text = this.GridView1.SelectedRow.Cells[23].Text.ToString(); 63
this.TextBox19.Text = this.GridView1.SelectedRow.Cells[24].Text.ToString(); 64
this.TextBox20.Text = this.GridView1.SelectedRow.Cells[25].Text.ToString(); 65
} 66
protected void Button4_Click(object sender, EventArgs e) 67
{//显示附属设备及配件页 68
this.Response.Redirect("~/AssetsManage/MyFittingsForm.aspx?MyID=" + this.TextBox3.Text+"*"+this.TextBox4.Text); 69
} 70
} 71





}
}