void s_AddGroup(object sender, AddGroupEventArgs e) { LinkSection ls = e.LinkSection; if (ls.Title == "SP SIN") { ls.Template_OtherControls = new FixTemplate(); } }
public void AddGroup(int GroupId) { AddGroupEventArgs e = new AddGroupEventArgs(); e.GroupId = GroupId; FireBeforeAddGroup(e); if (!e.Cancel) { IParameter[] parameters = new IParameter[] { SqlHelper.CreateParameter("@id", Id), SqlHelper.CreateParameter("@groupId", GroupId) }; bool exists = SqlHelper.ExecuteScalar<int>("SELECT COUNT(member) FROM cmsMember2MemberGroup WHERE member = @id AND memberGroup = @groupId", parameters) > 0; if (!exists) SqlHelper.ExecuteNonQuery("INSERT INTO cmsMember2MemberGroup (member, memberGroup) values (@id, @groupId)", parameters); populateGroups(); FireAfterAddGroup(e); } }
protected virtual void FireAfterAddGroup(AddGroupEventArgs e) { if (AfterAddGroup != null) { AfterAddGroup(this, e); } }
protected virtual void FireBeforeAddGroup(AddGroupEventArgs e) { if (BeforeAddGroup != null) { BeforeAddGroup(this, e); } }