Ejemplo n.º 1
0
        public ContentResult JoinAllVisitors(int id)
        {
            var m = new MeetingModel(id);
            int n = 0;

            foreach (var a in m.VisitAttends())
            {
                OrganizationMember.InsertOrgMembers(DbUtil.Db,
                                                    m.meeting.OrganizationId, a.PeopleId, MemberTypeCode.Member,
                                                    DateTime.Today, null, false);
                n++;
            }
            if (n > 0)
            {
                DbUtil.Db.UpdateMainFellowship(m.meeting.OrganizationId);
                return(Content("Joined {0} visitors".Fmt(n)));
            }
            return(Content("no visitors"));
        }
Ejemplo n.º 2
0
        public ContentResult JoinAllVisitors(int id)
        {
            var m = new MeetingModel(id, CurrentDatabase);
            var n = 0;

            foreach (var a in m.VisitAttends())
            {
                OrganizationMember.InsertOrgMembers(CurrentDatabase,
                                                    m.meeting.OrganizationId, a.PeopleId, MemberTypeCode.Member,
                                                    DateTime.Today, null, false);
                n++;
            }
            if (n > 0)
            {
                CurrentDatabase.UpdateMainFellowship(m.meeting.OrganizationId);
                return(Content($"Joined {n} visitors"));
            }
            return(Content("no visitors"));
        }