protected void show_landata(object sender, CommandEventArgs e) { this.U_landdata1.Visible = false; this.U_updateLandata1.Visible = true; UseFunc uf = new UseFunc(); this.U_updateLandata1.landata = uf.GetLandata(int.Parse(e.CommandName.ToString())); }
//ExUserFunction eu = new ExUserFunction(); protected void Page_Load(object sender, EventArgs e) { if (Session["Areaid"] == null || Session["LinkId"] == null || Session["Type"] == null) { Response.Write("<script language='javascript'>alert('连接超时,请重新登录.'); location.href='Loginpage.aspx'</script>"); } else { short type = short.Parse(Session["Type"].ToString()); if (type != 0 && type != 3 && type != 1 && type != 6) { Response.Write("<script language='javascript'>alert('该账号无此操作权限.'); location.href='HomePage.aspx'</script>"); return; } if (!IsPostBack) { this.U_landdata1.Visible = false; IList <LanData> lanlist = new List <LanData>(); SysFunc sf = new SysFunc(); UseFunc uf = new UseFunc(); Area currentarea = sf.GetArea(short.Parse(Session["Areaid"].ToString())); int linkid = int.Parse(Session["LinkId"].ToString()); if (type == 0) // 超级权限 { lanlist = uf.GetLandataList(); } else if (type == 6) { lanlist.Add(uf.GetLandata(short.Parse(Session["LinkId"].ToString()))); } else { if (currentarea.Type == true) { IList <Area> areas = sf.GetAreaList(currentarea.Cid, false); for (int i = 0; i < areas.Count; i++) { IList <LanData> tmp = uf.GetLandataList(areas[i].ID); for (int j = 0; j < tmp.Count; j++) { lanlist.Add(tmp[j]); } } } else { lanlist = uf.GetLandataList(currentarea.ID); } } bindlist(lanlist); } //this.Button_back.Attributes["onclick"] = "javascript:location.href='HomePage.aspx'"; //this.ImageButton_submit.Attributes["onclick"] = "javascript:return confirm('确认提交?提交后无法更改');"; } }
private static string mainurl = StrUtil.mainurl;//ConfigurationManager.AppSettings["hostname"]; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string url = HttpContext.Current.Request.Url.Query; int id = int.Parse(url.Substring(1)); Session["Lanid"] = id.ToString(); UseFunc uf = new UseFunc(); LanData ld = uf.GetLandata(id); this.Label_maptitle1.Text = ld.Building; IList <NodeData> nodelist = uf.GetNodedataList(id); bindlist(nodelist); } }
private IList <LanData> get_my_lanlist() { IList <LanData> landatalist = new List <LanData>(); SysFunc sf = new SysFunc(); UseFunc uf = new UseFunc(); Area currentarea = sf.GetArea(short.Parse(Session["curAreaid"].ToString())); short type = short.Parse(Session["Type"].ToString()); if (type == 0) // 超级权限 { landatalist = uf.GetLandataList(); } else if (type == 6) { landatalist.Add(uf.GetLandata(short.Parse(Session["LinkId"].ToString()))); } else if (type == 5) { landatalist = uf.GetLandataListPt(short.Parse(Session["LinkId"].ToString())); } else if (type == 4) { landatalist = uf.GetLandataListMt(short.Parse(Session["LinkId"].ToString())); } else { if (currentarea.Type == true) { IList <Area> areas = sf.GetAreaList(currentarea.Cid, false); for (int i = 0; i < areas.Count; i++) { IList <LanData> tmp = uf.GetLandataList(areas[i].ID); for (int j = 0; j < tmp.Count; j++) { landatalist.Add(tmp[j]); } } //landatalist = eu.getLandatalist_by_areaid(short.Parse(Session["Areaid"].ToString())); } else { landatalist = uf.GetLandataList(currentarea.ID); } } return(landatalist); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { UseFunc uf = new UseFunc(); LanData ld = uf.GetLandata(int.Parse(Session["Lanid"].ToString())); //LanData ld = uf.GetLandata(36); IList <FireHouse> fhlist = uf.GetFirehouse(ld.AreaData); this.Label_building.Text = ld.Building + "," + ld.Address; IList <double> result = new List <double>(); for (int i = 0; i < fhlist.Count; i++) { double tmp = (fhlist[i].Lng - ld.Lng) * (fhlist[i].Lng - ld.Lng) + (fhlist[i].Lat - ld.Lat) * (fhlist[i].Lat - ld.Lat); result.Add(tmp); } if (result.Count > 2) { } int first = 0; for (int j = 1; j < result.Count; j++) { if (result[first] > result[j]) { first = j; } } int second = 1; this.S_CountPath1.s1_Lng = fhlist[first].Lng; this.S_CountPath1.s1_Lat = fhlist[first].Lat; this.S_CountPath1.s2_Lng = fhlist[second].Lng; this.S_CountPath1.s2_Lat = fhlist[second].Lat; this.S_CountPath1.e_Lng = ld.Lng; this.S_CountPath1.e_Lat = ld.Lat; } }
/// <summary> /// 获取可见大楼信息 /// </summary> /// <param name="mb">用户信息</param> /// <returns></returns> public IList <LanData> getbuildings(string mid) { SysFunc sf = new SysFunc(); UseFunc uf = new UseFunc(); Members mb = uf.GetMembers(int.Parse(mid)); IList <LanData> landatalist = new List <LanData>(); if (mb.Type == 0) // 超级权限 { landatalist = uf.GetLandataList(); } else if (mb.Type == 1) { Area curArea = sf.GetArea((short)sf.GetFireManage((short)mb.LinkId).Aid); if (curArea.Type == true) { IList <Area> areas = sf.GetAreaList(curArea.Cid, false); for (int i = 0; i < areas.Count; i++) { IList <LanData> tmp = uf.GetLandataList(areas[i].ID); for (int j = 0; j < tmp.Count; j++) { landatalist.Add(tmp[j]); } } } else { landatalist = uf.GetLandataList(curArea.ID); } } else if (mb.Type == 2) { Area curArea = sf.GetArea((short)sf.GetFireHouse((short)mb.LinkId).Aid); if (curArea.Type == true) { IList <Area> areas = sf.GetAreaList(curArea.Cid, false); for (int i = 0; i < areas.Count; i++) { IList <LanData> tmp = uf.GetLandataList(areas[i].ID); for (int j = 0; j < tmp.Count; j++) { landatalist.Add(tmp[j]); } } } else { landatalist = uf.GetLandataList(curArea.ID); } } else if (mb.Type == 3) { Area curArea = sf.GetArea((short)sf.GetControlCenter((short)mb.LinkId).Aid); if (curArea.Type == true) { IList <Area> areas = sf.GetAreaList(curArea.Cid, false); for (int i = 0; i < areas.Count; i++) { IList <LanData> tmp = uf.GetLandataList(areas[i].ID); for (int j = 0; j < tmp.Count; j++) { landatalist.Add(tmp[j]); } } } else { landatalist = uf.GetLandataList(curArea.ID); } } else if (mb.Type == 6) { landatalist.Add(uf.GetLandata((int)mb.LinkId)); } else if (mb.Type == 5) { landatalist = uf.GetLandataListPt((short)mb.LinkId); } else if (mb.Type == 4) { landatalist = uf.GetLandataListMt((short)mb.LinkId); } else { landatalist = null; } return(landatalist); }
protected void Button_submit_Click(object sender, EventArgs e) { Members my = new Members(); my.Account = this.TextBox_account.Text; my.Password = this.TextBox_password.Text; UseFunc uf = new UseFunc(); Members member = uf.userLogin(my); if (member == null) { this.Label_notic.Text = "无此用户!"; } else { if (member.Password == member.Account) { this.Label_notic.Text = "登陆成功!"; Session["Userid"] = member.Id; Session["Account"] = member.Account; Session["Password"] = member.Password; Session["Name"] = member.Name; Session["Type"] = member.Type; Session["LinkId"] = member.LinkId; //Session["WebType"] = "Myself"; if (member.Type == 0) { Session["Areaid"] = Session["curAreaid"] = "0"; } else if (member.Type == 1) { SysFunc esf = new SysFunc(); Session["Areaid"] = Session["curAreaid"] = esf.GetFireManage((short)member.LinkId).Aid; } else if (member.Type == 2) { SysFunc esf = new SysFunc(); Session["Areaid"] = Session["curAreaid"] = esf.GetFireHouse((short)member.LinkId).Aid; } else if (member.Type == 3) { SysFunc esf = new SysFunc(); Session["Areaid"] = Session["curAreaid"] = esf.GetControlCenter((short)member.LinkId).Aid; } else if (member.Type == 4) { Session["Areaid"] = Session["curAreaid"] = "0"; } else if (member.Type == 5) { Session["Areaid"] = Session["curAreaid"] = "0"; } else if (member.Type == 6) { Session["Areaid"] = Session["curAreaid"] = uf.GetLandata((short)member.LinkId).AreaData; } else { Session["Areaid"] = "7"; } Response.Redirect("HomePage.aspx"); //登陆日志 Log info = new Log(); Response.Redirect("HomePage.aspx"); } else { this.Label_notic.Text = "密码错误!"; } } }
//private ExUserFunction eu = new ExUserFunction(); //private LbsMaker lm = new LbsMaker(); protected void Page_Load(object sender, EventArgs e) { if (Session["curAreaid"] == null || Session["LinkId"] == null || Session["Type"] == null) { Response.Write("<script language='javascript'>alert('请重新登录.'); location.href='Loginpage.aspx'</script>"); } if (!IsPostBack) { IList <LanData> landatalist = new List <LanData>(); SysFunc sf = new SysFunc(); UseFunc uf = new UseFunc(); Area currentarea = sf.GetArea(short.Parse(Session["curAreaid"].ToString())); short type = short.Parse(Session["Type"].ToString()); if (type == 0) // 超级权限 { landatalist = uf.GetLandataList(); } else if (type == 6) { landatalist.Add(uf.GetLandata(int.Parse(Session["LinkId"].ToString()))); } else if (type == 5) { landatalist = uf.GetLandataListPt(short.Parse(Session["LinkId"].ToString())); } else if (type == 4) { landatalist = uf.GetLandataListMt(short.Parse(Session["LinkId"].ToString())); } else { if (currentarea.Type == true) { IList <Area> areas = sf.GetAreaList(currentarea.Cid, false); for (int i = 0; i < areas.Count; i++) { IList <LanData> tmp = uf.GetLandataList(areas[i].ID); for (int j = 0; j < tmp.Count; j++) { landatalist.Add(tmp[j]); } } //landatalist = eu.getLandatalist_by_areaid(short.Parse(Session["Areaid"].ToString())); } else { landatalist = uf.GetLandataList(currentarea.ID); } } // 读取数据,制造地图 if (landatalist.Count() > 0) { this.Label_notic.Text = ""; string gpscenter = currentarea.Lng + "," + currentarea.Lat; string zoom = currentarea.Zoom.ToString(); // 如果选择全部城区,则生成热力图 if (currentarea.Type == true) { //标记指标点 this.Literal_map.Text = LbsMaker.MakeMap(gpscenter, zoom, LbsMaker.MakeMapPoints(landatalist)); //区域标签 //this.Literal_map.Text = LbsMaker.MakeLabel(currentarea.GpsCenter, zoom, LbsMaker.MakeLabelPoints(landatalist, eu.getArea_All(true))); //热力图 //this.Literal_map.Text = LbsMaker.MakeHeat(currentarea.GpsCenter, zoom, LbsMaker.MakeHeatPoints(landatalist)); } else { this.Literal_map.Text = LbsMaker.MakeMap(gpscenter, zoom, LbsMaker.MakeMapPoints(landatalist)); } } else { this.Label_notic.Text = "暂无数据,请选择其他区域"; this.Literal_map.Text = ""; } } }