📄 grouplist.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 GroupList : UserControl
{
protected Repeater list;
protected override void OnLoad(EventArgs e)
{
if (!Page.IsPostBack && !AjaxManager.IsCallBack)
{
BindData();
}
AjaxManager.Register(this, "AjaxMethod");
}
private void BindData()
{
if (list == null)
{
return;
}
list.DataSource = BusinessManager.GetGroupList(RequestBuilder.BuildGroupListRequest());
list.DataBind();
}
#region Ajax Method
[AjaxMethod(IncludeControlValuesWithCallBack = false)]
public void DeleteGroup(int groupId)
{
BusinessManager.DeleteGroup(groupId);
}
[AjaxMethod(IncludeControlValuesWithCallBack = false)]
public void DeleteGroups(string groupIds)
{
if (string.IsNullOrEmpty(groupIds))
{
return;
}
string[] groupIdArray = groupIds.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
int groupId = 0;
foreach (string stringGroupId in groupIdArray)
{
try
{
groupId = Int32.Parse(stringGroupId);
}
catch
{
continue;
}
if (groupId > 0)
{
DeleteGroup(groupId);
}
}
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -