public ActionResult GroupsSettings(LeagueGroup group)
        {
            try
            {
                var memId = RDN.Library.Classes.Account.User.GetMemberId();
                var league = MemberCache.GetLeagueOfMember(memId);
                foreach (var mem in league.LeagueMembers)
                {
                    if (!String.IsNullOrEmpty(Request.Form[mem.MemberId + "-check"]))
                    {
                        bool cb = Request.Form[mem.MemberId + "-check"].ToString().Contains("true");

                        LeagueGroupMember m = new LeagueGroupMember();
                        m.MemberId = mem.MemberId;
                        if (!String.IsNullOrEmpty(HttpContext.Request.Form[mem.MemberId + "-memType"]))
                            m.MemberAccessLevelEnum = (GroupMemberAccessLevelEnum)Enum.Parse(typeof(GroupMemberAccessLevelEnum), HttpContext.Request.Form[mem.MemberId + "-memType"].ToString());
                        if (cb)
                        {
                            m.IsApartOfGroup = true;
                        }
                        group.GroupMembers.Add(m);

                    }
                }


                bool updated = LeagueGroupFactory.UpdateGroup(group);
                MemberCache.Clear(memId);
                MemberCache.ClearApiCache(memId);

                MemberCache.UpdateCurrentLeagueMemberCache(memId);
                if (updated)
                    return Redirect(Url.Content("~/league/groups?u=" + SiteMessagesEnum.sag));
            }
            catch (Exception exception)
            {
                ErrorDatabaseManager.AddException(exception, exception.GetType());
            }
            return Redirect(Url.Content("~/league/groups?u=" + SiteMessagesEnum.sww));
        }
        public ActionResult GroupsAdd(LeagueGroup group)
        {
            try
            {
                var memId = RDN.Library.Classes.Account.User.GetMemberId();
                var league = MemberCache.GetLeagueOfMember(memId);
                foreach (var mem in league.LeagueMembers)
                {
                    if (!String.IsNullOrEmpty(Request.Form[mem.MemberId + "-check"]))
                    {
                        bool cb = Request.Form[mem.MemberId + "-check"].ToString().Contains("true");
                        if (cb)
                        {
                            LeagueGroupMember m = new LeagueGroupMember();
                            m.MemberId = mem.MemberId;
                            if (!String.IsNullOrEmpty(HttpContext.Request.Form[mem.MemberId + "-memType"]))
                                m.MemberAccessLevelEnum = (GroupMemberAccessLevelEnum)Enum.Parse(typeof(GroupMemberAccessLevelEnum), HttpContext.Request.Form[mem.MemberId + "-memType"].ToString());

                            group.GroupMembers.Add(m);
                        }
                    }
                }


                if (LeagueGroupFactory.AddGroup(group))
                {
                    foreach (var mem in group.GroupMembers)
                    {
                        LeagueGroupFactory.EmailMemberAboutAddedToGroup(group.GroupName, mem.MemberId);
                        MemberCache.Clear(mem.MemberId);
                        MemberCache.ClearApiCache(mem.MemberId);
                        SiteCache.ResetGroups();
                    }
                    MemberCache.Clear(RDN.Library.Classes.Account.User.GetMemberId());
                    return Redirect(Url.Content("~/league/groups?u=" + SiteMessagesEnum.sag));
                }
            }
            catch (Exception exception)
            {
                ErrorDatabaseManager.AddException(exception, exception.GetType());
            }
            return Redirect(Url.Content("~/league/groups?u=" + SiteMessagesEnum.sww));
        }