コード例 #1
0
ファイル: update.ascx.cs プロジェクト: nhatgiaoict/gencenter
    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)");
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string sLang = Globals.CurrentLang;

        if (sLang == "vn")
        {
            sLang     = "vi";
            test_lang = 1;
        }
        else
        {
            test_lang = 2;
        }
        group = new Groups(1);
        if (!this.IsPostBack)
        {
            // Set Editor
            Globals.CKEditor(txtContent);

            ltlGroup.Text               = Language.GetTextByID(424);
            ltlNote.Text                = Language.GetTextByID(28);
            ltlRequireGroup.Text        = Language.GetTextByID(94);
            ltlRequireTitle.Text        = "Nhập đầy đủ các trường bắt buộc";
            rdpPublishDate.SelectedDate = DateTime.Now;
            BtPost.Text = Language.GetTextByID(427);

            if (Membertask.IsAdministrator() || (Membertask.IsTaonoidung() != string.Empty && Membertask.IsPostOn() != string.Empty))
            {
                BtPost.Visible = true;
            }
            else
            {
                BtPost.Visible = false;
            }
            //Trees view
            treeview1.ShowCheckBoxes = TreeNodeTypes.All;
            treeview1.ShowLines      = true;
            treeview1.ExpandDepth    = 1;
            BildRoot(treeview1);
            // Thuộc tính
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string sLang = Globals.CurrentLang;

        if (sLang == "vn")
        {
            sLang     = "vi";
            test_lang = 1;
        }
        else
        {
            test_lang = 2;
        }
        group = new Groups(0);
        if (!this.IsPostBack)
        {
            // Set Editor
            Globals.CKEditor(txtContent);
            // End Set Editor
            txtFileImages.Attributes.Add("style", "Width:250px");
            //tbxWidth.Attributes.Add("style", "Width:50px");
            //tbxHeight.Attributes.Add("style", "Width:50px");
            //ltlWidth.Text = Language.GetTextByID(231);
            //ltlHeight.Text = Language.GetTextByID(232);

            imgIconHeader.ImageUrl      = Globals.UrlImages + "icon_menu1.gif";;
            ltlHeader.Text              = Language.GetTextByID(159);
            ltlNote.Text                = Language.GetTextByID(28);
            ltlRequireTitle.Text        = "Nhập đầy đủ các trường bắt buộc!";
            ltlRequireGroup.Text        = Language.GetTextByID(94);
            rdpPublishDate.SelectedDate = DateTime.Now;
            ltlRequireContent.Text      = Language.GetTextByID(36);
            BtPost.Text = Language.GetTextByID(218);

            if (Membertask.IsAdministrator() || (Membertask.IsTaonoidung() != string.Empty && Membertask.IsPostOn() != string.Empty))
            {
                BtPost.Visible = true;
            }
            else
            {
                BtPost.Visible = false;
            }

            //Trees view
            treeview1.ShowCheckBoxes = TreeNodeTypes.All;
            treeview1.ShowLines      = true;
            treeview1.ExpandDepth    = 0;
            BildRoot(treeview1);
        }
    }