⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 groupedit.cs

📁 这是一个简单的论坛程序源码
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NetFocus.Web.Core;

namespace NetFocus.Web.Applications.Forum
{
    public class GroupEdit : UserControl
    {
        protected ValuedTextBox subjectTextBox;
        protected ValuedCheckBox enabledCheckBox;
        protected ResourceButton saveButton;

        protected override void OnLoad(EventArgs e)
        {
            if (!Page.IsPostBack && !AjaxManager.IsCallBack)
            {
                BindData();
            }
            saveButton.Click += new EventHandler(SaveSection);
        }

        private void BindData()
        {
            Group group = BusinessManager.GetGroup(WebContext.Current.EntityId);
            if (group != null)
            {
                subjectTextBox.Value = group.Subject;
                enabledCheckBox.Checked = group.Enabled == 1 ? true : false;
            }
        }
        private void SaveSection(object sender, EventArgs e)
        {
            Group group = BusinessManager.GetGroup(WebContext.Current.EntityId);
            if (group != null)
            {
                group.Subject = subjectTextBox.Value;
                group.Enabled = enabledCheckBox.Checked ? 1 : 0;
                BusinessManager.UpdateGroup(group);
            }

            Page.Response.Redirect(SiteUrls.Instance().GetGroupListUrl());

        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -