1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- public partial class Admin_AddAdmin : System.Web.UI.Page
- {
-
- LYS.UserData1 myud = new LYS.UserData1();
- protected void Page_Load(object sender, EventArgs e)
- {
- Session["UserType"] = "系管理员";
- //Session["UserType"] = "超级管理员";
- if (Session["UserType"].ToString() == "系管理员")
- {
- UserType.Items.Add("教师");
- UserType.Items.Add("督导员");
- }
- else if (Session["UserType"].ToString() == "超级管理员")
- {
- UserType.Items.Add("教师");
- UserType.Items.Add("督导员");
- UserType.Items.Add("系管理员");
- }
- else
- { Response.Write("<script>alert('你没有是权限添加数据!')</script>"); }
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- myud.AddUsersToDB("select * from Users", "UserS", UserName.Text, PassWord.Text, UserType.SelectedValue, DropDownList1.SelectedValue);
- }
- }
|