Asp.net源码专业站
首页->企业网站->缤纷企业管理系统源码>>Admin/AddEdit_About.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:缤纷企业管理系统源码
当前文件:文件类型 BinFenEnterpriseWeb/Admin/AddEdit_About.aspx.cs[2K,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_About : System.Web.UI.Page 15 { 16 protected void Page_Load(object sender, EventArgs e) 17 { 18 19 if (!IsPostBack) 20 { 21 CommFun.IsAdmin(); 22 23 if (Request.QueryString["Action"] == "Edit") 24 { 25 DataRow drw = DBFun.GetDataRow("Select * From T_About where id=" + Request.QueryString["id"]); 26 if (drw == null) 27 { 28 Response.Write("读取数据失败!数据库中没有此记录或参数不正确!"); 29 Response.End(); 30 } 31 tb_title.Text = drw["AboutType"].ToString(); 32 ftb_Contents.Text = drw["contents"].ToString(); 33 btn_Ok.Text = "修改"; 34 lbl_title.Text = "修改关于我们"; 35 } 36 } 37 38 } 39 40 41 42 protected void btn_Ok_Click(object sender, EventArgs e) 43 { 44 //添加 45 46 string strsql; 47 if (btn_Ok.Text == "添加") 48 { 49 strsql = string.Format("insert Into T_About (AboutType,contents) values ('{0}','{1}')", 50 tb_title.Text, ftb_Contents.Text.Replace("'", "''")); 51 52 if (DBFun.ExecuteUpdate(strsql)) 53 { 54 string NewID = DBFun.SearchValue("select Max(ID) from T_About"); 55 Response.Write("<script>alert('添加成功!');window.location.href='AddEdit_About.aspx?Action=Edit&ID=" + NewID + "';</script>"); 56 } 57 } 58 else 59 { 60 strsql = string.Format("Update T_About Set Abouttype='{0}',contents='{1}' where id={2}", 61 tb_title.Text, ftb_Contents.Text.Replace("'", "''"), Request.QueryString["id"]); 62 63 if (DBFun.ExecuteUpdate(strsql)) 64 { 65 Response.Write("<script>alert('修改成功!');</script>"); 66 } 67 } 68 69 } 70 71 } 72}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:缤纷企业管理系统源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146