Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //if (!this.IsPostBack)
     //{
     if (Session["uid"].ToString() == "")
     {
         this.Response.Redirect("login.aspx?url=" + this.Request.RawUrl.ToString());
     }
     else
     {
         TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers(Session["uid"].ToString());
         lbluserinfo.Text = JpUsers.uname;
         if (JpUsers.deptid != "")
         {
             TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts();
             DataTable dt = JpDepts.GetDept(JpUsers.deptid);
             if (dt.Rows.Count > 0)
             {
                 lbluserinfo.Text += "(" + dt.Rows[0]["deptname"].ToString() + ")";
             }
         }
         TPortalClass.JpSite JpSite = new TPortalClass.JpSite();
         webname.Text = JpSite.SiteName;
         weburl.Text = JpSite.host;
         webcompany.Text = "宁波移信";
         dbname.Text = JpSite.dbname;
         versions.Text = JpSite.version;
         //读取登录信息
         TPortalClass.JpLog JpLog = new TPortalClass.JpLog();
         DataTable dt_log = JpLog.Getlogs();
         if (dt_log.Rows.Count > 0)
         {
             litIP.Text = dt_log.Rows[0]["hy_oppip"].ToString();
         }
         if (dt_log.Rows.Count > 1)
         {
             litBackIP.Text = dt_log.Rows[1]["hy_oppip"].ToString();
             litBackTime.Text = dt_log.Rows[1]["hy_createtime"].ToString();
         }
     }
     //}
 }
Example #2
0
 private void DataPlay()
 {
     if (this.Request.QueryString["op"] != null)
     {
         this.txtop.Value = this.Request.QueryString["op"].ToString();           //新增还是修改
     }
     if (this.Request.QueryString["id"] != null)
     {
         this.txtdeptid.Text = this.Request.QueryString["id"].ToString();     //部门ID
     }
     if (this.Request.QueryString["lastid"] != null)
     {
         this.txtlastdeptid.Value = this.Request.QueryString["lastid"].ToString();     //上级部门ID
     }
     TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts();
     //新文档
     if (this.txtop.Value == "add")
     {
         this.txtdeptid.Text = JpDepts.GetMaxDeptid(txtlastdeptid.Value);
     }
     //旧文档
     if (this.txtop.Value == "modify")
     {
         DataTable dt = JpDepts.GetDept(this.txtdeptid.Text);
         if (dt.Rows.Count > 0)
         {
             this.txtdeptname.Text = dt.Rows[0]["deptname"].ToString();
             this.txtdeptsort.Text = dt.Rows[0]["deptsort"].ToString();
         }
     }
 }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["uid"].ToString() == "")
        {
            this.Response.Redirect("login.aspx?url=" + this.Request.RawUrl.ToString());
        }
        else
        {
            TPortalClass.JpUsers JpUsers = new TPortalClass.JpUsers(Session["uid"].ToString());
            DataTable dt = new DataTable();
            lbluserinfo.Text = JpUsers.uname;
            if (JpUsers.deptid != "")
            {
                TPortalClass.JpDepts JpDepts = new TPortalClass.JpDepts();
                dt = JpDepts.GetDept(JpUsers.deptid);
                if (dt.Rows.Count > 0)
                {
                    lbluserinfo.Text += "(" + dt.Rows[0]["deptname"].ToString() + ")";
                }
            }

            #region 根据权限判断导航显示情况
            this.pis_wzfb.Visible = false;
            this.pis_wztg.Visible = false;
            this.pis_wzsh.Visible = false;
            this.pis_yhgl.Visible = false;
            this.pis_lmgl.Visible = false;
            this.pis_xtsz.Visible = false;
            this.pis_plgl.Visible = false;
            this.pis_gggl.Visible = false;
            this.pis_hdgl.Visible = false;

            this.li_adv_tg.Visible = false;
            this.li_adv_sh.Visible = false;

            li_activity_tg.Visible = false;
            li_activity_sh.Visible = false;
            li_activityusers.Visible = false;
            pis_wqgl.Visible = false;
            this.pis_xwgl.Visible = false;
            pis_ssyz.Visible = false;
            //文章发布
            if (ChkRole("Role0001") == "1")
            {
                this.pis_wzfb.Visible = true;
            }
            else
            {
                if (ChkRole("Role0002") == "1")
                {
                    ls_gobal1 = "global_channel_tree2";
                    ls_gobal2 = "global_channel_tree1";
                }
                else
                {
                    if (ChkRole("Role0003") == "1")
                    {
                        ls_gobal1 = "global_channel_tree3";
                        ls_gobal3 = "global_channel_tree1";
                    }
                }
            }
            //文章投稿
            if (ChkRole("Role0002") == "1")
            {
                this.pis_wztg.Visible = true;
            }
            //文章审核
            if (ChkRole("Role0003") == "1")
            {
                this.pis_wzsh.Visible = true;
            }
            //评论管理
            if (ChkRole("Role0004") == "1")
            {
                this.pis_plgl.Visible = true;
            }
            //维权帮办
            if (ChkRole("Role0012") == "1")
            {
                this.pis_wqgl.Visible = true;
            }
            //新闻爆料
            if (ChkRole("Role0013") == "1")
            {
                this.pis_xwgl.Visible = true;
            }
            //新闻爆料
            if (ChkRole("Role0014") == "1")
            {
                this.pis_ssyz.Visible = true;
            }
            //活动管理
            if (ChkRole("Role0005") == "1")
            {
                this.pis_hdgl.Visible = true;
                TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();

                if (JpRoles.ifshowcolumn_tg(Session["uid"].ToString(), "008"))
                {
                    li_activity_tg.Visible = true;
                }
                if (JpRoles.ifshowcolumn_sh(Session["uid"].ToString(), "008"))
                {
                    li_activity_sh.Visible = true;
                }
            }
            //广告管理
            if (ChkRole("Role0006") == "1")
            {
                this.pis_gggl.Visible = true;
                TPortalClass.JpRoles JpRoles = new TPortalClass.JpRoles();

                if (JpRoles.ifshowcolumn_tg(Session["uid"].ToString(), "007"))
                {
                    li_adv_tg.Visible = true;
                }
                if (JpRoles.ifshowcolumn_sh(Session["uid"].ToString(), "007"))
                {
                    li_adv_sh.Visible = true;
                }
            }
            //活动报名审核
            if (ChkRole("Role0010") == "1")
            {
                this.li_activityusers.Visible = true;
            }
            //用户管理
            if (ChkRole("Role0007") == "1")
            {
                this.pis_yhgl.Visible = true;
            }
            //栏目管理
            if (ChkRole("Role0008") == "1")
            {
                this.pis_lmgl.Visible = true;
            }
            //系统设置
            if (ChkRole("Role0011") == "1")
            {
                this.pis_xtsz.Visible = true;
            }
            #endregion
        }
    }