protected void Page_Load(object sender, EventArgs e) { Permissions.MemRedirect(Page, Permissions.redirUrl); EndNumber = Request.QueryString["endNumber"] + ""; if (EndNumber == "") { EndNumber = SfType.getBH().ToString(); } StartNumber = Request.QueryString["ThNumber"]; #region 当前会员,是否有权限访问该网络的会员 if (EndNumber != Session["Member"].ToString()) { Response.Write("<script>alert('" + GetTran("000892", "您不能查看该网络") + "');window.location.href='First.aspx';</script>"); return; } if (WTreeBLL.IsRoot(StartNumber, WTreeBLL.GetMaxQS(), Session["Member"].ToString()) == false) { Response.Write("<script>alert('" + GetTran("000892", "您不能查看该网络") + "');window.location.href='First.aspx';</script>"); return; } #endregion if (!IsPostBack) { BindQS(); BindData(); Translations(); } }
//判断是否有权限查看该网咯 public bool IsRoot(string StartNumber, string qs, string EndNumber) { return(WTreeBLL.IsRoot(StartNumber, qs, EndNumber)); }
public void GetCYWLT() { string qsnumber = TextBox1.Text.Trim(); string ParentNumber = WTreeBLL.GetNumberParent(qsnumber); string qs = DropDownList_QiShu.SelectedValue; if (!WTreeBLL.IsRoot(qsnumber, qs, ViewState["dc"].ToString())) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('你不能查看该网络!')</script>"); return; } //链路图 LitLLT.Text = WTreeBLL.SetLianLuTu_CYWL(ViewState["dc"].ToString(), qsnumber, qs); //第一层 CYWLTModel cm = WTreeBLL.GetCYWLTModel(ParentNumber, qs, WTreeBLL.GetNumberQuShu(qsnumber)); if (cm != null) { dyc1.Text = "<a style='color:red' href='CommonlyNetwork.aspx?qsNumber=" + cm.Number + "&EndNumber=" + ViewState["dc"] + "'>" + cm.Number + "</a>"; dyc2.Text = cm.PetName; dyc3.Text = cm.Level; dyc4.Text = cm.ZY; dyc5.Text = cm.XY; dyc6.Text = cm.SY; dyc7.Text = cm.Left; dyc8.Text = cm.Right; } //第二层 CYWLTModel cml2 = WTreeBLL.GetCYWLTModel(cm == null ? "" : cm.Number, qs, "1"); if (cml2 != null) { dec1.Text = "<a style='color:red' href='CommonlyNetwork.aspx?qsNumber=" + cml2.Number + "&EndNumber=" + ViewState["dc"] + "'>" + cml2.Number + "</a>"; dec2.Text = cml2.PetName; dec3.Text = cml2.Level; dec4.Text = cml2.ZY; dec5.Text = cml2.XY; dec6.Text = cml2.SY; dec7.Text = cml2.Left; dec8.Text = cml2.Right; } CYWLTModel cmr2 = WTreeBLL.GetCYWLTModel(cm == null ? "" : cm.Number, qs, "2"); if (cmr2 != null) { dec9.Text = "<a style='color:red' href='CommonlyNetwork.aspx?qsNumber=" + cmr2.Number + "&EndNumber=" + ViewState["dc"] + "'>" + cmr2.Number + "</a>"; dec10.Text = cmr2.PetName; dec11.Text = cmr2.Level; dec12.Text = cmr2.ZY; dec13.Text = cmr2.XY; dec14.Text = cmr2.SY; dec15.Text = cmr2.Left; dec16.Text = cmr2.Right; } //第三层 CYWLTModel cml3_1 = WTreeBLL.GetCYWLTModel(cml2 == null ? "" : cml2.Number, qs, "1"); if (cml3_1 != null) { dsc1.Text = "<a style='color:red' href='CommonlyNetwork.aspx?qsNumber=" + cml3_1.Number + "&EndNumber=" + ViewState["dc"] + "'>" + cml3_1.Number + "</a>"; dsc2.Text = cml3_1.PetName; dsc3.Text = cml3_1.Level; dsc4.Text = cml3_1.ZY; dsc5.Text = cml3_1.XY; dsc6.Text = cml3_1.SY; dsc7.Text = cml3_1.Left; dsc8.Text = cml3_1.Right; } CYWLTModel cml3_2 = WTreeBLL.GetCYWLTModel(cml2 == null ? "" : cml2.Number, qs, "2"); if (cml3_2 != null) { dsc9.Text = "<a style='color:red' href='CommonlyNetwork.aspx?qsNumber=" + cml3_2.Number + "&EndNumber=" + ViewState["dc"] + "'>" + cml3_2.Number + "</a>"; dsc10.Text = cml3_2.PetName; dsc11.Text = cml3_2.Level; dsc12.Text = cml3_2.ZY; dsc13.Text = cml3_2.XY; dsc14.Text = cml3_2.SY; dsc15.Text = cml3_2.Left; dsc16.Text = cml3_2.Right; } CYWLTModel cmr3_1 = WTreeBLL.GetCYWLTModel(cmr2 == null ? "" : cmr2.Number, qs, "1"); if (cmr3_1 != null) { dsc17.Text = "<a style='color:red' href='CommonlyNetwork.aspx?qsNumber=" + cmr3_1.Number + "&EndNumber=" + ViewState["dc"] + "'>" + cmr3_1.Number + "</a>"; dsc18.Text = cmr3_1.PetName; dsc19.Text = cmr3_1.Level; dsc20.Text = cmr3_1.ZY; dsc21.Text = cmr3_1.XY; dsc22.Text = cmr3_1.SY; dsc23.Text = cmr3_1.Left; dsc24.Text = cmr3_1.Right; } CYWLTModel cmr3_2 = WTreeBLL.GetCYWLTModel(cmr2 == null ? "" : cmr2.Number, qs, "2"); if (cmr3_2 != null) { dsc25.Text = "<a style='color:red' href='CommonlyNetwork.aspx?qsNumber=" + cmr3_2.Number + "&EndNumber=" + ViewState["dc"] + "'>" + cmr3_2.Number + "</a>"; dsc26.Text = cmr3_2.PetName; dsc27.Text = cmr3_2.Level; dsc28.Text = cmr3_2.ZY; dsc29.Text = cmr3_2.XY; dsc30.Text = cmr3_2.SY; dsc31.Text = cmr3_2.Left; dsc32.Text = cmr3_2.Right; } }
public void BindNet(string startBH, string EndBH, string qs) { if (WTreeBLL.IsRoot(startBH, qs, EndBH) == false) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("007461", " 您没有权限查看") + "!')</script>"); return; } SetLianLuTu(EndBH, startBH, qs); txNumber.Text = startBH; //横/竖 线div List <NumberClass> lhx = new List <NumberClass>(); //第二层 DataTable dt2 = WTreeBLL.GetGraphNet_AZ(startBH, qs, "0"); List <NumberClass> ln2 = new List <NumberClass>(); for (int i = 0; i < dt2.Rows.Count; i++) { NumberClass nc = new NumberClass(); nc.Number = dt2.Rows[i]["Number"].ToString(); nc.Left = i * nc.Width; nc.Top = 400; nc.Level = dt2.Rows[i]["JiBie"].ToString(); nc.Z = dt2.Rows[i]["TotalNetRecord"].ToString(); nc.X = dt2.Rows[i]["CurrentOneMark"].ToString(); nc.Y = dt2.Rows[i]["syyj"].ToString(); ln2.Add(nc); } //第三层 List <NumberClass> ln3 = new List <NumberClass>(); for (int i = 0; i < dt2.Rows.Count; i++) { DataTable dt3 = WTreeBLL.GetGraphNet_AZ(dt2.Rows[i]["Number"].ToString(), qs, "0"); NumberClass hxdiv = new NumberClass();//第三层横线div for (int j = 0; j < dt3.Rows.Count; j++) { NumberClass nc = new NumberClass(); nc.Number = dt3.Rows[j]["Number"].ToString(); nc.Left = ln2[i].Left + j * nc.Width; nc.Top = 600; nc.Level = dt3.Rows[j]["JiBie"].ToString(); nc.Z = dt3.Rows[j]["TotalNetRecord"].ToString(); nc.X = dt3.Rows[j]["CurrentOneMark"].ToString(); nc.Y = dt3.Rows[j]["syyj"].ToString(); ln3.Add(nc); //横线 if (j == 0) { hxdiv.Left = nc.Left + 186 / 2; hxdiv.Height = 2; hxdiv.Top = nc.Top - 66 / 2; } else if (j == dt3.Rows.Count - 1) { hxdiv.Width = nc.Left + 186 / 2 - hxdiv.Left; lhx.Add(hxdiv); } //向上竖线 NumberClass sxdiv3 = new NumberClass(); sxdiv3.Left = nc.Left + 186 / 2; sxdiv3.Height = 33; sxdiv3.Top = nc.Top - 33; sxdiv3.Width = 2; lhx.Add(sxdiv3); } //第二层根据第三层的个数进行向右移动 if (dt3.Rows.Count > 0) { int _left = (dt3.Rows.Count - 1) * 186 / 2; for (int k = i; k < ln2.Count; k++) { if (k == i) //自身 { ln2[k].Left = ln2[k].Left + _left; } else { ln2[k].Left = ln2[k].Left + _left + _left; } } } } //第一层 int div1Left = 0; if (ln2.Count > 1) { div1Left = (ln2[ln2.Count - 1].Left - ln2[0].Left - 186) / 2 + ln2[0].Left + 186 / 2; } else if (ln2.Count == 1) { div1Left = ln2[0].Left; } else { div1Left = 0; } DataTable dt1 = WTreeBLL.GetGraphNet_AZ(startBH, qs, "1"); NumberClass div1nc = new NumberClass(); div1nc.Number = dt1.Rows[0]["Number"].ToString(); div1nc.Left = div1Left; div1nc.Top = 200; div1nc.Level = dt1.Rows[0]["JiBie"].ToString(); div1nc.Z = dt1.Rows[0]["TotalNetRecord"].ToString(); div1nc.X = dt1.Rows[0]["CurrentOneMark"].ToString(); div1nc.Y = dt1.Rows[0]["syyj"].ToString(); string div1 = "<div style='position:absolute;left:" + (div1nc.Left + 50) + "px;top:" + div1nc.Top + "px;width:" + div1nc.Width + "px;height:" + div1nc.Height + "px;' align='center'>" + "<div style='width:166px;height:100%;border:gray solid 1px;'>" + GetTable(div1nc) + "</div></div>\r\n"; //第一层下竖线 if (ln2.Count > 0) { NumberClass _sxdiv1 = new NumberClass(); _sxdiv1.Left = div1nc.Left + 186 / 2; _sxdiv1.Height = 33; _sxdiv1.Top = div1nc.Top + div1nc.Height; _sxdiv1.Width = 2; lhx.Add(_sxdiv1); } //第二层div横线 if (ln2.Count > 1) { NumberClass hxdiv2 = new NumberClass();//横线div hxdiv2.Left = ln2[0].Left + 186 / 2; hxdiv2.Height = 2; hxdiv2.Top = ln2[0].Top - 66 / 2; hxdiv2.Width = ln2[ln2.Count - 1].Left + 186 / 2 - hxdiv2.Left; lhx.Add(hxdiv2); } //第二层竖线div for (int i = 0; i < ln2.Count; i++) { //上竖线 NumberClass sxdiv = new NumberClass(); sxdiv.Left = ln2[i].Left + 186 / 2; sxdiv.Height = 33; sxdiv.Top = ln2[i].Top - 33; sxdiv.Width = 2; lhx.Add(sxdiv); //下竖线 if (WTreeBLL.IsExistsAZ(ln2[i].Number, qs)) { NumberClass sxdiv2 = new NumberClass(); sxdiv2.Left = ln2[i].Left + 186 / 2; sxdiv2.Height = 33; sxdiv2.Top = ln2[i].Top + ln2[i].Height; sxdiv2.Width = 2; lhx.Add(sxdiv2); } } // //显示内容div string netStr = div1; for (int i = 0; i < ln2.Count; i++) { netStr = netStr + "<div style='position:absolute;left:" + (ln2[i].Left + 50) + "px;top:" + ln2[i].Top + "px;width:" + ln2[i].Width + "px;height:" + ln2[i].Height + "px;' align='center'>" + "<div style='width:166px;height:100%;border:gray solid 1px;'>" + GetTable(ln2[i]) + "</div></div>\r\n"; } for (int i = 0; i < ln3.Count; i++) { netStr = netStr + "<div style='position:absolute;left:" + (ln3[i].Left + 50) + "px;top:" + ln3[i].Top + "px;width:" + ln3[i].Width + "px;height:" + ln3[i].Height + "px;' align='center'>" + "<div style='width:166px;height:100%;border:gray solid 1px;'>" + GetTable(ln3[i]) + "</div></div>\r\n"; } //显示横线div for (int i = 0; i < lhx.Count; i++) { netStr = netStr + "<div style='position:absolute;left:" + (lhx[i].Left + 50) + "px;top:" + lhx[i].Top + "px;width:" + lhx[i].Width + "px;height:" + lhx[i].Height + "px;background-color:rgb(100,181,208);overflow:hidden;'></div>\r\n"; } network.Text = netStr; }
protected void Page_Load(object sender, EventArgs e) { Permissions.MemRedirect(Page, Permissions.redirUrl); Response.Cache.SetExpires(DateTime.Now); AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass)); if (!IsPostBack) { if (Request.QueryString["isAnzhi"] != null) { if (Request.QueryString["isAnzhi"].ToString() == "az") { ViewState["isAnZhi_TuiJian"] = "az"; Button2.Visible = true; Button4.Visible = true; PTitle = GetTran("000395", "推荐网络图"); } else { ViewState["isAnZhi_TuiJian"] = "tj"; Button3.Text = GetTran("000420", "常用"); PTitle = GetTran("000366", "安置网络图"); } Session["jglx"] = Request.QueryString["isAnzhi"].ToString(); } else { if (Session["jglx"] == null) { Session["jglx"] = "tj"; } } Button1.Attributes["onclick"] = "document.getElementById('txt_PressKeyFlag').value='y';"; CommonDataBLL.BindQishuList(DropDownList_QiShu, false); if (Request.QueryString["SelectGrass"] != null) { DropDownList_QiShu.SelectedValue = Request.QueryString["SelectGrass"].ToString(); } if (Request.QueryString["net"] != null) { switch (Request.QueryString["net"].ToString().Trim()) { case "tj": ViewState["isAnZhi_TuiJian"] = "tj"; Button3.Text = GetTran("000420", "常用"); break; default: ViewState["isAnZhi_TuiJian"] = "az"; break; } } if (Session["jgbh"] == null || Session["jgbh"].ToString() == "") { Session["jgbh"] = Session["Member"].ToString(); } this.TextBox1.Text = getBH(); ViewState["bh"] = getBH(); #region 当前会员,是否有权限访问该网络的会员 if (WTreeBLL.IsRoot(getBH(), this.DropDownList_QiShu.SelectedValue, GetLoginMember()) == false) { Response.Write("<script>alert('" + GetTran("000892", "您不能查看该网络") + "');</script>"); return; } #endregion Session["jgbh"] = TextBox1.Text; this.WangLuoTu_Commom(getBH(), ViewState["isAnZhi_TuiJian"].ToString()); SetDaoHang(); } txt_PressKeyFlag.Text = "n"; Translations(); }
protected void Button1_Click(object sender, System.EventArgs e) { if (this.TextBox1.Text.Trim() == "") { Response.Write("<script>alert('" + GetTran("007307", "请先填写网络起点编号") + "!');</script>"); return; } if (DAL.MemberInfoDAL.SelectMemberExist(this.TextBox1.Text.Trim()) == false) { Response.Write("<script>alert('" + GetTran("000892", "您不能查看该网络") + "');</script>"); return; } bool flag = registermemberBLL.isNet(Session["jglx"].ToString(), Convert.ToString(Session["jgbh"]), getBH()); if (flag == false) { Response.Write("<script>alert('" + GetTran("000892", "您不能查看该网络") + "');</script>"); return; } if (ViewState["isAnZhi_TuiJian"].ToString() == "az") { if (WTreeBLL.IsRoot(this.TextBox1.Text.Trim(), this.DropDownList_QiShu.SelectedValue, GetLoginMember()) == false) { Response.Write("<script>alert('" + GetTran("000892", "您不能查看该网络") + "');</script>"); return; } } else { if (WTreeBLL.IsRoot_II(this.TextBox1.Text.Trim(), this.DropDownList_QiShu.SelectedValue, GetLoginMember()) == false) { Response.Write("<script>alert('" + GetTran("000892", "您不能查看该网络") + "');</script>"); return; } } if (ViewState["isAnZhi_TuiJian"].ToString() == "az") { if (this.TextBox1.Text.Trim() != "") { Divt1.InnerHtml = JieGouNew2.Direct_Table_New(this.TextBox1.Text.Trim(), Convert.ToInt32(this.DropDownList_QiShu.SelectedValue), 1); } else { Divt1.InnerHtml = JieGouNew2.Direct_Table_New(ViewState["bh"].ToString(), Convert.ToInt32(this.DropDownList_QiShu.SelectedValue), 1); } } else { if (this.TextBox1.Text.Trim() != "") { Divt1.InnerHtml = JieGouNew2.Direct_Table_New(this.TextBox1.Text.Trim(), Convert.ToInt32(this.DropDownList_QiShu.SelectedValue), 2); } else { Divt1.InnerHtml = JieGouNew2.Direct_Table_New(ViewState["bh"].ToString(), Convert.ToInt32(this.DropDownList_QiShu.SelectedValue), 2); } } SetDaoHang(); }