GetResults() публичный Метод

public GetResults ( CMSDataContext db2 ) : string
db2 CMSDataContext
Результат string
Пример #1
0
        public string PrepareSummaryText()
        {
            if (RecordFamilyAttendance())
                return SummarizeFamilyAttendance();

            var om = GetOrgMember();
            if (om == null)
                return "";
            var si = new SummaryInfo(DbUtil.Db, om.PeopleId, om.OrganizationId);
            return si.GetResults(DbUtil.Db);
        }
Пример #2
0
        public void SendEventReminders(int id)
        {
            var org = Db.LoadOrganizationById(id);
            Db.SetCurrentOrgId(id);
            var setting = Db.CreateRegistrationSettings(id);

            const string noSubject = "no subject";
            const string noBody = "no body";

            var subject = Util.PickFirst(setting.ReminderSubject, noSubject);
            var message = Util.PickFirst(setting.ReminderBody, noBody);
            if (subject == noSubject || message == noBody)
                throw new Exception("no subject or body");

            var currmembers = from om in org.OrganizationMembers
                              where (om.Pending ?? false) == false
                              where om.MemberTypeId != CmsData.Codes.MemberTypeCode.InActive
                              select om;
            var notify = Db.StaffPeopleForOrg(org.OrganizationId).FirstOrDefault();
            if (notify == null)
                throw new Exception("no notify person");

            foreach (var om in currmembers)
            {
                var si = new SummaryInfo(Db, om.PeopleId, om.OrganizationId);
                var details = si.GetResults(Db);
                var organizationName = org.OrganizationName;

                subject = Util.PickFirst(setting.ReminderSubject, noSubject);
                message = Util.PickFirst(setting.ReminderBody, noBody);

                string location = org.Location;
                message = MessageReplacements(Db, om.Person, null, org.OrganizationId, organizationName, location, message);

                message = message.Replace("{phone}", org.PhoneNumber.FmtFone7());
                message = message.Replace("{details}", details);

                Db.Email(notify.FromEmail, om.Person, subject, message);
            }
        }
Пример #3
0
        public void SendEventReminders(Guid id)
        {
            var org = Db.LoadOrganizationById(Db.CurrentOrgId0);
            var setting = Db.CreateRegistrationSettings(org.OrganizationId);

            const string noSubject = "no subject";
            const string noBody = "no body";

            var subject = Util.PickFirst(setting.ReminderSubject, noSubject);
            var message = Util.PickFirst(setting.ReminderBody, noBody);
            if (subject == noSubject || message == noBody)
                throw new Exception("no subject or body");

            var q = from p in Db.PeopleQuery(id)
                join om in Db.OrganizationMembers on
                    new {p.PeopleId, org.OrganizationId}
                    equals new {om.PeopleId, om.OrganizationId} into j
                from om in j
                select om;

            var notify = Db.StaffPeopleForOrg(org.OrganizationId).FirstOrDefault();
            if (notify == null)
                throw new Exception("no notify person");

            foreach (var om in q)
            {
                var si = new SummaryInfo(Db, om.PeopleId, om.OrganizationId);
                var details = si.GetResults(Db);
                var organizationName = org.OrganizationName;

                subject = Util.PickFirst(setting.ReminderSubject, noSubject);
                message = Util.PickFirst(setting.ReminderBody, noBody);

                string location = org.Location;
                message = MessageReplacements(Db, om.Person, null, org.OrganizationId, organizationName, location, message);

                message = message.Replace("{phone}", org.PhoneNumber.FmtFone7());
                message = message.Replace("{details}", details);

                Db.Email(notify.FromEmail, om.Person, subject, message);
            }
        }