protected void Submit_OnClick(object sender, EventArgs e) { string[] accountIdArray = mm_HiddenMember.Value.Split(','); long accountId = 0; int groupId = 0, role = 0; if (!int.TryParse(mm_HiddenGroupId.Value, out groupId)) { throw new Exception("参数错误"); } group = CY.UME.Core.Business.Group.Load(groupId); if (group == null) { throw new Exception("参数错误"); } if (!int.TryParse(DDLOperation.SelectedValue, out role)) { throw new Exception("参数错误"); } if (role != 0 && role != 1 && role != -1) { throw new Exception("参数错误"); } foreach (string strAccountId in accountIdArray) { if (!long.TryParse(strAccountId, out accountId)) { continue; } CY.UME.Core.Business.Account account = CY.UME.Core.Business.Account.Load(accountId); if (account == null) { continue; } CY.UME.Core.Business.AccountGroup ag = new CY.UME.Core.Business.AccountGroup(); IList<CY.UME.Core.Business.AccountGroup> agList = ag.GetAccountGroupByGroupIdAndAccountId(account, group); if (agList.Count > 0) { ag = CY.UME.Core.Business.AccountGroup.Load(agList[0].Id); } if (role == -1) { ag.DeleteOnSave(); } else { ag.Role = role; } ag.Save(); } BindData(group); }