예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Membertask.IsAdministrator() && Membertask.IsChuyenmuc() == string.Empty)
     {
         Response.Redirect(Globals.UrlRoot);
     }
 }
예제 #2
0
 public clsHoivien()
 {
     //
     // TODO: Add constructor logic here
     //
     if (Globals.CheckExist)
     {
         try
         {
             //Create Table
             string Sql = "CREATE TABLE IF NOT EXISTS " + TableHoiVien + "(";
             Sql += "id nvarchar(255) NOT NULL default '', ";
             Sql += "title nvarchar(500) default NULL, ";
             Sql += "summary mediumtext, ";
             Sql += "status tinyint(4) default 0, ";
             Sql += "inquiry tinyint(4) default 0, ";
             Sql += "idx tinyint(4) default 0, ";
             Sql += "PRIMARY KEY  (id)) ";
             Sql += "ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;";
             DbTask db = new DbTask();
             db.ExecuteNonQuery(Sql);
         }
         catch
         {
         }
     }
     if (!Membertask.IsAdministrator())
     {
         _mIdAllow = Membertask.IsChuyenmuc();
     }
     else
     {
         _mIdAllow = string.Empty;
     }
 }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (id == "" || id == string.Empty || id == null)
        {
            Response.Redirect(Globals.URLCurrent + "manager.aspx");
        }

        if (!this.IsPostBack)
        {
            if (dr == null)
            {
                Response.Redirect(Globals.URLCurrent + "manager.aspx");
            }

            ltlMember.Text = dr["fullname"].ToString() + " (" + dr["username"].ToString() + ")";
            string sUserName = dr["username"].ToString();

            imgIconHeader.ImageUrl = Globals.UrlImages + "icon_menu1.gif";;
            ltlHeader.Text         = Language.GetTextByID(90);
            ltlNote.Text           = Language.GetTextByID(28);

            ltlRole.Text        = "(*) " + Language.GetTextByID(69);
            ltlRequireRole.Text = Language.GetTextByID(70);
            btnRegister.Text    = Language.GetTextByID(37);

            cbxAdministrator.Text = Language.GetTextByID(68);
            cbxChuyenmuc.Text     = Language.GetTextByID(93);
            cbxThanhvien.Text     = Language.GetTextByID(3);
            cbxQTNoidung.Text     = Language.GetTextByID(8);
            cbxPostOn.Text        = Language.GetTextByID(243);

            if (Membertask.IsAdministrator(sUserName))
            {
                cbxAdministrator.Checked = true;
            }
            if (Membertask.IsThanhvien(sUserName) != string.Empty)
            {
                cbxThanhvien.Checked = true;
            }
            if (Membertask.IsChuyenmuc(sUserName) != string.Empty)
            {
                cbxChuyenmuc.Checked = true;
            }
            if (Membertask.IsNewsTask(sUserName) != string.Empty)
            {
                cbxQTNoidung.Checked = true;
            }
            if (Membertask.IsPostOn(sUserName) != string.Empty)
            {
                cbxPostOn.Checked = true;
            }
            cbxAdministrator.Attributes.Add("onclick", "AdminCheck('Form1', this)");
        }
    }
예제 #4
0
 public Groups()
 {
     if (Globals.CheckExist)
     {
         try
         {
             //Create Table
             string Sql = "CREATE TABLE IF NOT EXISTS " + TableName + "(";
             Sql += "id nvarchar(255) NOT NULL default '', ";
             Sql += "parentid nvarchar(255) NOT NULL default '', ";
             Sql += "title nvarchar(500) default NULL, ";
             Sql += "link nvarchar(500) default NULL, ";
             Sql += "summary mediumtext, ";
             Sql += "status tinyint(4) default 0, ";
             Sql += "idx tinyint(4) default 0, ";
             Sql += "kind tinyint(4) default 0, ";
             Sql += "advert tinyint(4) default 1, ";
             Sql += "inquiry tinyint(4) default 0, ";
             Sql += "PRIMARY KEY  (id)) ";
             Sql += "ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;";
             DbTask db = new DbTask();
             db.ExecuteNonQuery(Sql);
         }
         catch
         {
         }
     }
     if (!Membertask.IsAdministrator())
     {
         _mIdAllow = Membertask.IsChuyenmuc();
     }
     else
     {
         _mIdAllow = string.Empty;
     }
 }
예제 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            Member  mem = new Member();
            DataRow dr  = mem.GetInfoName(Membertask.Name);
            ltlWelcome.Text = Language.GetTextByID(109) + ": " + dr["fullname"].ToString();

            //ddlLang.DataSource = Language.GetAllLanguage();
            //ddlLang.DataValueField = "id";
            //ddlLang.DataTextField = "title";
            //ddlLang.DataBind();
            //ddlLang.Attributes.Add("style", "border:1 solid #ff0000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; color: #ff0000; width:130px");
            //try
            //{
            //    ddlLang.SelectedValue = Globals.CurrentLang;
            //}
            //catch
            //{
            //}
            // ltlLanguage.Text = Language.GetTextByID(1);
            ltlProfile.Text = Language.GetTextByID(24);

            hlProfile.Text        = Language.GetTextByID(25);
            hlProfile.NavigateUrl = Globals.UrlRoot + "profile/profile.aspx";

            hlChangePwd.Text        = Language.GetTextByID(26);
            hlChangePwd.NavigateUrl = Globals.UrlRoot + "profile/changepwd.aspx";

            hlSignout.Text        = Language.GetTextByID(27);
            hlSignout.NavigateUrl = Globals.UrlRoot + "profile/signout.aspx";

            //=========== Thanh vien ===========
            if (!Membertask.IsAdministrator() && Membertask.IsThanhvien() == string.Empty)
            {
                tblMember.Visible = false;
            }
            else
            {
                tblMember.Visible           = true;
                ltlMember.Text              = Language.GetTextByID(2);
                hlRegMember.Text            = Language.GetTextByID(4);
                hlRegMember.NavigateUrl     = Globals.UrlRoot + "member/register.aspx";
                hlMemberManager.Text        = Language.GetTextByID(3);
                hlMemberManager.NavigateUrl = Globals.UrlRoot + "member/manager.aspx";
            }
            //=========== Chuyen muc ===========
            if (!Membertask.IsAdministrator() && Membertask.IsChuyenmuc() == string.Empty)
            {
                tblGroups.Visible = false;
            }
            else
            {
                tblGroups.Visible = true;
                ltlGroup.Text     = Language.GetTextByID(91);
                //tin
                hlRegGroup.Text            = Language.GetTextByID(92);
                hlRegGroup.NavigateUrl     = Globals.UrlRoot + "groups/register.aspx";
                hlGroupManager.Text        = Language.GetTextByID(93);
                hlGroupManager.NavigateUrl = Globals.UrlRoot + "groups/manager.aspx";
                hlMenus.Text        = Language.GetTextByID(14);
                hlMenus.NavigateUrl = Globals.UrlRoot + "groups/menu.aspx";
            }
            //=========== Tao bai viet ===========
            if (!Membertask.IsAdministrator() && Membertask.IsNewsTask() == string.Empty)
            {
                tblCreate_new.Visible = false;
            }
            else
            {
                tblCreate_new.Visible  = true;
                ltlCreate_content.Text = "Quản trị nội dung"; //Language.GetTextByID(158);
                hlCreate.Text          = Language.GetTextByID(159);
                hlCreate.NavigateUrl   = Globals.UrlRoot + "news/register.aspx";

                hlList.Text        = Language.GetTextByID(160);
                hlList.NavigateUrl = Globals.UrlRoot + "news/listbaiviet.aspx";
            }
            //=========== To Chuc ============
            if (!Membertask.IsAdministrator() && Membertask.IsTochuc() == string.Empty)
            {
                tblOrgNews.Visible = false;
            }
            else
            {
                tblOrgNews.Visible   = true;
                ltlOrgNews.Text      = Language.GetTextByID(11);
                hrBanner.Text        = Language.GetTextByID(342);
                hrBanner.NavigateUrl = Globals.UrlRoot + "Slideshow/Slideshow.aspx";
                hrfooter.Text        = Language.GetTextByID(343);
                hrfooter.NavigateUrl = Globals.UrlRoot + "publish/footer.aspx";
            }
            //========Quan tri Web ===========
            if (!Membertask.IsAdministrator())
            {
                tblAdministrator.Visible = false;
            }
            else
            {
                tblAdministrator.Visible = true;
                ltlAdministrator.Text    = Language.GetTextByID(312);

                hlInforWeb.Text        = Language.GetTextByID(314);
                hlInforWeb.NavigateUrl = Globals.UrlRoot + "webmanager/infor_manager.aspx";
            }
        }
    }