Asp.net源码专业站
首页->企业网站->缤纷企业管理系统源码>>Admin/AddEdit_Jobs.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:缤纷企业管理系统源码
当前文件:文件类型 BinFenEnterpriseWeb/Admin/AddEdit_Jobs.aspx.cs[3K,2009-6-12 11:33:51]打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.IO; 4using System.Configuration; 5using System.Collections; 6using System.Web; 7using System.Web.Security; 8using System.Web.UI; 9using System.Web.UI.WebControls; 10using System.Web.UI.WebControls.WebParts; 11using System.Web.UI.HtmlControls; 12namespace Web.Admin 13{ 14 public partial class AddEdit_Jobs : System.Web.UI.Page 15 { 16 protected void Page_Load(object sender, EventArgs e) 17 { 18 pageload(); 19 } 20 private void pageload() 21 { 22 //网页加载 23 24 if (!IsPostBack) 25 { 26 //软件类型 27 CommFun.IsAdmin(); 28 string strqry; 29 30 string Action = Request.QueryString["Action"]; 31 string id = Request.QueryString["ID"]; 32 if (Action == "Edit" && id != null) 33 { 34 //是示信息以供修改 35 36 strqry = string.Format("select * From T_Jobs where ID={0}", id); 37 DataRow dr = DBFun.GetDataView(strqry).Table.Rows[0]; 38 tb_Position.Text = dr["Jobposition"].ToString(); 39 tb_Department.Text = dr["department"].ToString(); 40 tb_Thewhere.Text = dr["thewhere"].ToString(); 41 tb_Email.Text = dr["email"].ToString(); 42 tb_Limittime.Text = ((DateTime)dr["limittime"]).ToString("yyyy-MM-dd"); 43 ftb_Requirement.Text = dr["requirement"].ToString(); 44 btn_Ok.Text = "修改"; 45 } 46 else 47 { 48 btn_Ok.Text = "添加"; 49 50 } 51 52 53 } 54 } 55 protected void btn_Ok_Click(object sender, EventArgs e) 56 { 57 //修改 58 modify(); 59 60 } 61 private void modify() 62 { 63 string strsql; 64 if (btn_Ok.Text == "修改") 65 { 66 string id = Request.QueryString["id"]; 67 if (id == null || id == "") 68 return; 69 70 strsql=string.Format("Update T_Jobs set Jobposition='{0}',department='{1}',thewhere='{2}'," 71 +"email='{3}',limittime=#{4}#,requirement='{5}' where id={6}", 72 tb_Position.Text, tb_Department.Text, tb_Thewhere.Text, 73 tb_Email.Text, tb_Limittime.Text, ftb_Requirement.Text.Replace("'", "''"), id); 74 75 if (DBFun.ExecuteUpdate(strsql)) 76 { 77 Response.Write("<script>alert('修改成功!');window.location.href='AddEdiT_Jobs.aspx?Action=Edit&ID=" + id + "';</script>"); 78 79 } 80 else 81 { 82 83 84 Response.Write("<script>alert('修改失败!请确认输入是否正确。');</script>"); 85 } 86 } 87 else 88 { 89 //添加 90 91 strsql = string.Format("Insert into [T_Jobs] (Jobposition,department,thewhere," 92 + "email,limittime,requirement) values('{0}','{1}','{2}','{3}',#{4}#,'{5}')", 93 tb_Position.Text, tb_Department.Text, tb_Thewhere.Text, 94 tb_Email.Text, tb_Limittime.Text, ftb_Requirement.Text.Replace("'", "''")); 95 if (DBFun.ExecuteUpdate(strsql)) 96 { 97 98 string NewId = DBFun.SearchValue("Select Max(id) from T_Jobs"); 99 Response.Write("<script>alert('添加成功!');window.location.href='AddEdiT_Jobs.aspx?Action=Edit&ID=" + NewId + "';</script>"); 100 101 } 102 else 103 { 104 105 Response.Write("<script>alert('添加失败!请确认输入是否正确。');</script>"); 106 } 107 108 } 109 } 110 111 112 113 } 114} 115
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:缤纷企业管理系统源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146