Beispiel #1
0
    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();
                    if (member.Type == 2)
                    {
                        Session["Areaid"] = Session["curAreaid"] = esf.GetFireHouse((short)member.LinkId).Aid;
                    }
                }
                else if (member.Type == 3)
                {
                    SysFunc esf = new SysFunc();
                    if (member.Type == 3)
                    {
                        Session["Areaid"] = Session["curAreaid"] = esf.GetControlCenter((short)member.LinkId).Aid;
                    }
                }
                else
                {
                    Session["Areaid"] = "7";
                }
                Response.Redirect("HomePage.aspx");

                //登陆日志
                Log info = new Log();

                Response.Redirect("HomePage.aspx");
            }
            else
            {
                this.Label_notic.Text = "密码错误!";
            }
        }
    }
Beispiel #2
0
        /// <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);
        }