예제 #1
0
        void s_AddGroup(object sender, AddGroupEventArgs e)
        {
            LinkSection ls = e.LinkSection;

            if (ls.Title == "SP SIN")
            {
                ls.Template_OtherControls = new FixTemplate();
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 protected virtual void FireAfterAddGroup(AddGroupEventArgs e)
 {
     if (AfterAddGroup != null)
     {
         AfterAddGroup(this, e);
     }
 }
예제 #4
0
 protected virtual void FireBeforeAddGroup(AddGroupEventArgs e)
 {
     if (BeforeAddGroup != null)
     {
         BeforeAddGroup(this, e);
     }
 }