您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->达达ASP.NET企业信息管理系统>>Admin/Admin_User.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:达达ASP.NET企业信息管理系统


当前文件路径:DaDaEnterprise/Admin/Admin_User.aspx.cs 文件类型
普通视图
		            
1using System; 2using System.Collections; 3using System.Configuration; 4using System.Data; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.HtmlControls; 9using System.Web.UI.WebControls; 10using System.Web.UI.WebControls.WebParts; 11 12public partial class Admin_Admin_User : System.Web.UI.Page 13{ 14 protected void Page_Load(object sender, EventArgs e) 15 { 16 if (!IsPostBack) 17 { 18 DataAccess.IsAdmin(); 19 string sql = "select top 5 * from [Admin]"; 20 Repeater1.DataSource = DataAccess.GetDataSet(sql); 21 Repeater1.DataBind(); 22 } 23 } 24 25 protected void Sub_Click(object sender, EventArgs e) 26 { 27 string PassWord = FormsAuthentication.HashPasswordForStoringInConfigFile(Pwd.Text.ToString(), "MD5"); 28 string ChkPass = FormsAuthentication.HashPasswordForStoringInConfigFile(ChkPwd.Text.ToString(), "MD5"); 29 string sql = "insert into [Admin](AdminName,AdminPwd) values('" 30 + Admin.Text + "','" + PassWord + "')"; 31 if (!String.IsNullOrEmpty(Admin.Text)) 32 { 33 if (Pwd.Text == ChkPwd.Text) 34 { 35 if (DataAccess.ExecuteCmd(sql) > 0) 36 { 37 Response.Redirect("./Admin_User.aspx"); 38 } 39 else Response.Write("<script>alert('添加失败!');</script>"); 40 } 41 else Response.Write("<script>alert('两次密码不一致!');</script>"); 42 } 43 else Response.Write("<script>alert('名称不能为空!');</script>"); 44 } 45 46 protected void Del_Click(object sender, CommandEventArgs e) 47 { 48 string id = e.CommandName; 49 string sql = "delete from [Admin] where id=" + id; 50 if (DataAccess.ExecuteCmd(sql) > 0) 51 { 52 Response.Redirect("./Admin_User.aspx"); 53 } 54 else Response.Write("<script>alert('删除失败!');</script>"); 55 } 56} 57
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:达达ASP.NET企业信息管理系统

- 人事管理系统(课程设计)源码

- 曼迪新闻系统测试版

- 仿新浪投票系统源码

- Ajax之用户注册实例源码

- 网上办公系统源码

- ASP.NET2.0支持多语言示例源码

- Asp.net无刷新评星控件及演示..

- 哈尔滨某大学教务系统平台源码

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号