protected void Page_Load(object sender, EventArgs e) { //strPagePrivilege.Add("BJKB"); //strPageUserType.Add("mana"); if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["ID"]) && !string.IsNullOrEmpty(Request.QueryString["Year"]) && !string.IsNullOrEmpty(Request.QueryString["Term"])) { int ID = 0; int Year = 0; int Term = 0; if (int.TryParse(Request.QueryString["ID"], out ID) && int.TryParse(Request.QueryString["Year"], out Year) && int.TryParse(Request.QueryString["Term"], out Term)) { LabMS.BLL.Location Location = new LabMS.BLL.Location(); LabMS.Model.Location model = Location.GetModel(ID); if (model != null) { if (model.LabID != null) { LabMS.BLL.Lab Lab = new LabMS.BLL.Lab(); LabMS.Model.Lab labmodel = Lab.GetModel(model.LabID.Value); if (labmodel != null) { lb_Lab.Text = labmodel.Lab_Name + " �ص㣺У��" + model.Location_Campus + "��ѧ¥��" + model.Location_Building + "¥�㣺" + model.Location_Floor + "�����" + model.Location_RoomNum + ""; } } } lb_Year.Text = Year.ToString(); if (Term == 1) { lb_Term.Text = "��ѧ��"; } else { lb_Term.Text = "��ѧ��"; } } } DataBinds(); } }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("SYYF"); if (UserType == "student" || UserType == "teacher") { modifybtn.Visible = false; DeleteBtn.Visible = false; } if (Request.QueryString["ID"] != null) { if (!IsPostBack) { int ID; string strID = Request.QueryString["ID"].ToString(); if (int.TryParse(strID, out ID)) { LabMS.BLL.Location location = new LabMS.BLL.Location(); LabMS.Model.Location Locationinfo = new LabMS.Model.Location(); List<LabMS.Model.Dictionary> list = new List<LabMS.Model.Dictionary>(); IDHF.Value = ID.ToString();//存储ID值 //获取用房信息 通过ID Locationinfo = location.GetModel(ID); LocationNameLbl.Text = Locationinfo.Location_Name;//名称 AreaLbl.Text = Locationinfo.Location_Area;//面积 BuildingNameLbl.Text = Locationinfo.Location_Building;//楼名称 CampusLbl.Text = Locationinfo.Location_Campus;//校区 FloorLbl.Text = Locationinfo.Location_Floor;//楼层 ManagerLbl.Text = Locationinfo.Location_InCharge;//负责人 BuildingNameLbl.Text = Locationinfo.Location_Name;//楼名称 TelLbl.Text = Locationinfo.Location_Phone;//联系电话 RoomNumLbl.Text = Locationinfo.Location_RoomNum;//房间号 SummaryLbl.Text = Locationinfo.Location_Summary.Replace("\r\n", "<br/>");//备注 UsageLbl.Text = Locationinfo.Location_Usage;//用途 StudentNumLbl.Text = Locationinfo.Location_StudentNum.ToString();//容纳学生数 //绑定使用状态 list = DictionaryDropdownlist("117"); StatusDDL.DataSource = list; StatusDDL.DataBind(); //绑定实验室名 LabDropdowlist(); LabDDL.SelectedValue = Locationinfo.LabID.ToString(); } else { ERRLbl.Text = "系统异常,ID值不合法!"; ERRLbl.Visible = true; modifybtn.Visible = false; DeleteBtn.Visible = false; } } } else { ERRLbl.Text = "系统异常,ID值不合法!"; ERRLbl.Visible = true; modifybtn.Visible = false; DeleteBtn.Visible = false; } }