Пример #1
0
        /// <summary>
        /// Handles the DeleteClick event of the groupMemberRow control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        void groupMemberRow_DeleteClick(object sender, EventArgs e)
        {
            NewGroupMembersRow row = sender as NewGroupMembersRow;
            var groupMember        = GroupMembers.FirstOrDefault(m => m.Person.Guid.Equals(row.PersonGuid));

            if (groupMember != null)
            {
                GroupMembers.Remove(groupMember);
            }

            CreateControls(true);
        }
Пример #2
0
        void lbRemoveMember_Click(object sender, EventArgs e)
        {
            Guid personGuid  = ((LinkButton)sender).ID.Substring(15).Replace("_", "-").AsGuid();
            var  groupMember = GroupMembers.Where(f => f.Person.Guid.Equals(personGuid)).FirstOrDefault();

            if (groupMember != null)
            {
                GroupMembers.Remove(groupMember);
                Duplicates.Remove(personGuid);
                if (!GroupMembers.Any())
                {
                    AddGroupMember();
                    CurrentPageIndex = 0;
                }
                CreateControls(true);
            }
        }