protected void Page_Load(object sender, EventArgs e) { if (Session["Areaid"] == null || Session["Type"] == null) { Response.Write("<script language='javascript'>alert('请重新登录.'); location.href='Loginpage.aspx'</script>"); return; } short type = short.Parse(Session["Type"].ToString()); if (type != 0 && type != 1 && type != 2) { Response.Write("<script language='javascript'>alert('该账号无此操作权限.'); location.href='HomePage.aspx'</script>"); return; } if (!IsPostBack) { this.U_firehouse1.Visible = false; this.U_updateFirehouse1.Visible = false; IList <FireHouse> firelist = new List <FireHouse>(); SysFunc sf = new SysFunc(); Area currentarea = sf.GetArea(short.Parse(Session["Areaid"].ToString())); if (type == 0) // 超级权限 { firelist = sf.GetFireHouseList(); } else { if (currentarea.Type == true) { IList <Area> areas = sf.GetAreaList(currentarea.Cid, false); for (int i = 0; i < areas.Count; i++) { IList <FireHouse> tmp = sf.GetFireHouseList(areas[i].ID); for (int j = 0; j < tmp.Count; j++) { firelist.Add(tmp[j]); } } } else { firelist = sf.GetFireHouseList(currentarea.ID); } } bindlist(firelist); } //this.Button_back.Attributes["onclick"] = "javascript:location.href='HomePage.aspx'"; //this.ImageButton_submit.Attributes["onclick"] = "javascript:return confirm('确认提交?提交后无法更改');"; }
protected void DropDownList_limit_SelectedIndexChanged(object sender, EventArgs e) { if (this.DropDownList_type.SelectedValue == "0") { //ExSysFunction esf = new ExSysFunction(); //this.DropDownList_linkid.DataSource = esf.ge(); //this.DropDownList_linkid.DataTextField = "Name"; //this.DropDownList_linkid.DataValueField = "Id"; //this.DropDownList_linkid.DataBind(); } else if (this.DropDownList_type.SelectedValue == "1") { //管理部门 SysFunc esf = new SysFunc(); this.TextBox_linkid.Visible = false; this.DropDownList_linkid.Visible = true; this.Label_title.Visible = true; this.Label_title.Text = "部门"; this.DropDownList_linkid.DataSource = esf.GetFireManageList(); this.DropDownList_linkid.DataTextField = "Name"; this.DropDownList_linkid.DataValueField = "Id"; this.DropDownList_linkid.DataBind(); } else if (this.DropDownList_type.SelectedValue == "2") { //战斗部队 SysFunc esf = new SysFunc(); this.TextBox_linkid.Visible = false; this.DropDownList_linkid.Visible = true; this.Label_title.Visible = true; this.Label_title.Text = "部门"; this.DropDownList_linkid.DataSource = esf.GetFireHouseList(); this.DropDownList_linkid.DataTextField = "Name"; this.DropDownList_linkid.DataValueField = "Id"; this.DropDownList_linkid.DataBind(); } else if (this.DropDownList_type.SelectedValue == "3") { //监控中心 SysFunc esf = new SysFunc(); this.TextBox_linkid.Visible = false; this.DropDownList_linkid.Visible = true; this.Label_title.Visible = true; this.Label_title.Text = "部门"; this.DropDownList_linkid.DataSource = esf.GetControlCenterList(); this.DropDownList_linkid.DataTextField = "Name"; this.DropDownList_linkid.DataValueField = "Id"; this.DropDownList_linkid.DataBind(); } else if (this.DropDownList_type.SelectedValue == "4") { //维护公司 SysFunc esf = new SysFunc(); this.TextBox_linkid.Visible = false; this.DropDownList_linkid.Visible = true; this.Label_title.Visible = true; this.Label_title.Text = "部门"; this.DropDownList_linkid.DataSource = esf.GetMaintenance(); this.DropDownList_linkid.DataTextField = "Name"; this.DropDownList_linkid.DataValueField = "Id"; this.DropDownList_linkid.DataBind(); } else if (this.DropDownList_type.SelectedValue == "5") { //物业公司 SysFunc esf = new SysFunc(); this.TextBox_linkid.Visible = false; this.DropDownList_linkid.Visible = true; this.Label_title.Visible = true; this.Label_title.Text = "部门"; this.DropDownList_linkid.DataSource = esf.GetProperty(); this.DropDownList_linkid.DataTextField = "Name"; this.DropDownList_linkid.DataValueField = "Id"; this.DropDownList_linkid.DataBind(); } else if (this.DropDownList_type.SelectedValue == "6") { //消防主机 SysFunc esf = new SysFunc(); this.TextBox_linkid.Visible = true; this.DropDownList_linkid.Visible = false; this.Label_title.Visible = true; this.Label_title.Text = "HOST_ID"; } else { //this.Label_type.Text = "未知权限"; } }