发布:2020/12/29 8:41:04作者:管理员 来源:本站 浏览次数:1382
<asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand" OnItemDataBound="Repeater1_ItemDataBound"></asp:Repeater>
Maticsoft.Model.DR_TRoles _TRoles = _bll_TRoles.GetModel(int.Parse(user.TRIdInt.ToString()));
if (_TRoles != null && _TRoles.Cids != null)
{
DataSet ds = _bll_TMenus.GetList(" TMIdInt in(" + _TRoles.Cids + ") order by SortTint ASC");
Repeater1.DataSource = ds;
Repeater1.DataBind();
string[] arr = user.Cids.Split(',');
for (int i = 0; i < arr.Length; i++)
{
foreach (Control c in this.Repeater1.Controls)
{
CheckBoxList cbx = (CheckBoxList)c.FindControl("CheckBoxList1");
if (cbx != null)
{
foreach (ListItem item in cbx.Items)
{
if (item.Value==arr[i])
{
item.Selected = true;
}
}
}
}
}
}
string cids = string.Empty;
foreach (Control c in this.Repeater1.Controls)
{
CheckBoxList cbx = (CheckBoxList)c.FindControl("CheckBoxList1");
if (cbx != null)
{
foreach (ListItem item in cbx.Items)
{
if (item.Selected == true)
{
cids += item.Value+",";
}
}
}
}
user.Cids = cids.TrimEnd(',');
© Copyright 2014 - 2025 柏港建站平台 ejk5.com. 渝ICP备16000791号-4