protected void Page_Load(object sender, EventArgs e) { try { if (Request.QueryString["VirtualLabID"] != null && Request.QueryString["VirtualLabID"] != "") { Vlab = VirtualLaboratory.Load(new Guid(Request.QueryString["VirtualLabID"].ToString())); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('参数错误!将返回网站主页');window.location = '../Default.aspx'</script>"); return; } } catch { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('参数错误!将返回网站主页');window.location = '../Default.aspx'</script>"); return; } }
protected void Page_Load(object sender, EventArgs e) { try { if (Request.QueryString["VexpID"] != null && Request.QueryString["VexpID"] != "") { Vexp = VirtualExperimental.Load(new Guid(Request.QueryString["VexpID"].ToString())); if (Vexp != null) { this.labTitle.Text = Vexp.Name; this.HidUrl.Value = Vexp.FlashUrl.Replace('\\', '/'); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('flash文件未找到!');window.location = 'VirtualLab.aspx'</script>"); return; } } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('参数错误!');window.location = 'VirtualLab.aspx'</script>"); return; } } catch { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('页面加载错误!');window.location = 'VirtualLab.aspx'</script>"); return; } try { string VirtualLabID = null; if (Request.QueryString["VirtualLabID"] != null && Request.QueryString["VirtualLabID"] != "") { VirtualLabID = Request.QueryString["VirtualLabID"]; } if (VirtualLabID != null && VirtualLabID != "") { Vlab = VirtualLaboratory.Load(new Guid(VirtualLabID)); string sqlwhere = "VirturlLabID='" + VirtualLabID + "'"; Vlbc = VirtualLabDataBigClass.GetBySql(sqlwhere) as List<VirtualLabDataBigClass>; if (Vlbc != null && Vlbc.Count != 0) { HidModule.Value = "false"; SideNaveSub = new List<VirtualLabDataSub>[Vlbc.Count]; Vlsn = new List<VirtualLabDataSon>[Vlbc.Count]; for (int i = 0; i < Vlbc.Count; i++) { List<VirtualLabDataSub> LVsub = VirtualLabDataSub.GetBySql("frontID='" + Vlbc[i].Id + "'") as List<VirtualLabDataSub>; if (LVsub != null && LVsub.Count != 0) { if (LVsub.Count > num) { num = LVsub.Count; } SideNaveSub[i] = LVsub; HidModule.Value = "true"; } else { List<VirtualLabDataSon> tempsn = VirtualLabDataSon.SelectByfrontID(Vlbc[i].Id) as List<VirtualLabDataSon>; if (tempsn != null && tempsn.Count != 0) { Vlsn[i] = tempsn; } } } } if (this.HidModule.Value == "true") { SideNaveListSon = new List<VirtualLabDataSon>[Vlbc.Count, num]; for (int j = 0; j < Vlbc.Count; j++) { if (Vlbc[j].Name != "虚拟实验室") { if (SideNaveSub[j] != null) { for (int i = 0; i < SideNaveSub[j].Count; i++) { List<VirtualLabDataSon> LSon = VirtualLabDataSon.SelectByfrontID(SideNaveSub[j][i].Id) as List<VirtualLabDataSon>; if (LSon != null && LSon.Count != 0) { SideNaveListSon[j, i] = LSon; //this.HidFlash.Value = "false"; } } } } else { SideNaveListExp = new List<VirtualExperimental>[Vlbc.Count, num]; if (SideNaveSub[j] != null) { for (int i = 0; i < SideNaveSub[j].Count; i++) { List<VirtualExperimental> LExp = VirtualExperimental.SelectByfrontID(SideNaveSub[j][i].Id) as List<VirtualExperimental>; if (LExp != null && LExp.Count != 0) { SideNaveListExp[j, i] = LExp; //this.HidFlash.Value = "false"; } } } } } } } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('参数错误!将返回网站主页');window.location = '../Default.aspx'</script>"); return; } } catch { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('页面加载错误!将返回网站主页');window.location = '../Default.aspx'</script>"); return; } }
protected void Page_Load(object sender, EventArgs e) { try { string VirtualLabID = null; if (Request.QueryString["VirtualLabID"] != null && Request.QueryString["VirtualLabID"] != "") { VirtualLabID = Request.QueryString["VirtualLabID"]; } else { VirtualLabID = "3fcf0e24-889d-475b-ae66-608956d466d5"; } if (VirtualLabID != null && VirtualLabID != "") { Vlab = VirtualLaboratory.Load(new Guid(VirtualLabID)); string sqlwhere = "VirturlLabID='" + VirtualLabID + "'"; Vlbc = VirtualLabDataBigClass.GetBySql(sqlwhere) as List<VirtualLabDataBigClass>; if (Vlbc != null && Vlbc.Count != 0) { HidModule.Value = "false"; SideNaveSub = new List<VirtualLabDataSub>[Vlbc.Count]; Vlsn = new List<VirtualLabDataSon>[Vlbc.Count]; for (int i = 0; i < Vlbc.Count; i++) { List<VirtualLabDataSub> LVsub = VirtualLabDataSub.GetBySql("frontID='" + Vlbc[i].Id + "'") as List<VirtualLabDataSub>; if (LVsub != null && LVsub.Count != 0) { if (LVsub.Count > num) { num = LVsub.Count; } SideNaveSub[i] = LVsub; HidModule.Value = "true"; } else { List < VirtualLabDataSon > tempsn= VirtualLabDataSon.SelectByfrontID(Vlbc[i].Id) as List<VirtualLabDataSon>; if (tempsn != null && tempsn.Count != 0) { Vlsn[i] = tempsn; } } } } if (this.HidModule.Value == "true") { SideNaveListSon = new List<VirtualLabDataSon>[Vlbc.Count, num]; for (int j = 0; j < Vlbc.Count; j++) { if (Vlbc[j].Name != "虚拟实验室") { if (SideNaveSub[j] != null) { for (int i = 0; i < SideNaveSub[j].Count; i++) { List<VirtualLabDataSon> LSon = VirtualLabDataSon.SelectByfrontID(SideNaveSub[j][i].Id) as List<VirtualLabDataSon>; if (LSon != null && LSon.Count != 0) { SideNaveListSon[j, i] = LSon; //this.HidFlash.Value = "false"; } } } } else { SideNaveListExp = new List<VirtualExperimental>[Vlbc.Count, num]; if (SideNaveSub[j] != null) { for (int i = 0; i < SideNaveSub[j].Count; i++) { List<VirtualExperimental> LExp = VirtualExperimental.SelectByfrontID(SideNaveSub[j][i].Id) as List<VirtualExperimental>; if (LExp != null && LExp.Count != 0) { SideNaveListExp[j, i] = LExp; //this.HidFlash.Value = "false"; } } } } } } if (Request.QueryString["SonID"] != null && Request.QueryString["SonID"] != "") { BindPage(Request.QueryString["SonID"]); } else { if (Vlab != null) { this.labTitle.Text = Vlab.Name + "简介"; this.litContent.Text = Vlab.Content; } } if (Request.QueryString["Taget"] != null && Request.QueryString["Taget"] != "") { switch (Request.QueryString["Taget"]) { case "LabContract": SelectBindPage("实验室架构"); break; case "Alalyse": SelectBindPage("分析常识"); break; case "Experiment": this.labTitle.Text = Vlab.Name + "简介"; this.litContent.Text = Vlab.Content; break; } } } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('参数错误!将返回网站主页');window.location = '../Default.aspx'</script>"); return; } if (!Page.IsPostBack) { } } catch { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('页面加载错误!将返回网站主页');window.location = '../Default.aspx'</script>"); return; } }