Example #1
0
 public OnlineRegPersonModel LoadExistingPerson(int id, int index)
 {
     var person = DbUtil.Db.LoadPersonById(id);
     var p = new OnlineRegPersonModel
     {
         index = index,
         dob = person.DOB,
         email = person.EmailAddress.HasValue() ? person.EmailAddress : user.EmailAddress,
         first = person.PreferredName,
         last = person.LastName,
         PeopleId = id,
         phone = Util.PickFirst(person.CellPhone, person.HomePhone),
         orgid = orgid,
         masterorgid = masterorgid,
         classid = classid,
         IsFamily = true,
         LoggedIn = true,
         Found = true,
         IsValidForExisting = true,
     };
     if (p.LoggedIn && org != null)
     {
         var setting = settings[org.OrganizationId];
         if (setting.AllowReRegister)
         {
             var om = org.OrganizationMembers.SingleOrDefault(mm => mm.PeopleId == id);
             if (om != null)
                 p.PopulateRegistrationFromDb(om);
         }
     }
     return p;
 }
Example #2
0
 public OnlineRegPersonModel LoadExistingPerson(int id, int index)
 {
     var person = DbUtil.Db.LoadPersonById(id);
     var p = new OnlineRegPersonModel
     {
         index = index,
         dob = person.DOB,
         email = person.EmailAddress.HasValue() ? person.EmailAddress : user.EmailAddress,
         first = person.PreferredName,
         last = person.LastName,
         PeopleId = id,
         phone = Util.PickFirst(person.CellPhone, person.HomePhone),
         orgid = orgid,
         masterorgid = masterorgid,
         classid = classid,
         IsFamily = true,
         LoggedIn = true,
         Found = true,
         IsValidForExisting = true,
     };
     return p;
 }
Example #3
0
 // Set suggested giving fee for an indidividual person
 private static void CheckSetFee(OnlineRegModel m, OnlineRegPersonModel p)
 {
     if (m.OnlineGiving() && p.setting.ExtraValueFeeName.HasValue())
     {
         var f = CmsWeb.Models.OnlineRegPersonModel.Funds().SingleOrDefault(ff => ff.Text == p.setting.ExtraValueFeeName);
         var evamt = p.person.GetExtra(p.setting.ExtraValueFeeName).ToDecimal();
         if (f != null && evamt > 0)
             p.FundItem[f.Value.ToInt()] = evamt;
     }
 }
Example #4
0
File: Enroll.cs Project: vs06/bvcms
 private void RecordAllFamilyAttends(OrganizationMember om)
 {
     om.AddToGroup(DbUtil.Db, "Attended");
     om.AddToGroup(DbUtil.Db, "Registered");
     foreach (var fm in FamilyAttend)
     {
         if (fm.PeopleId == -1)
             continue;
         Person pp = null;
         OrganizationMember omm = null;
         if (!fm.PeopleId.HasValue && fm.Attend)
         {
             if (!fm.Name.HasValue())
                 continue;
             string first, last;
             Util.NameSplit(fm.Name, out first, out last);
             if (!first.HasValue())
             {
                 first = last;
                 last = LastName;
             }
             Person uperson = DbUtil.Db.LoadPersonById(PeopleId.Value);
             var p = new OnlineRegPersonModel()
             {
                 FirstName = first,
                 LastName = last,
                 DateOfBirth = fm.Birthday,
                 EmailAddress = fm.Email,
                 gender = fm.GenderId,
                 married = fm.MaritalId
             };
             p.AddPerson(uperson, org.EntryPointId ?? 0);
             pp = p.person;
             omm = OrganizationMember.InsertOrgMembers(DbUtil.Db, org.OrganizationId, pp.PeopleId,
                 MemberTypeCode.Member, DateTime.Now, null, false);
         }
         else
         {
             pp = DbUtil.Db.LoadPersonById(fm.PeopleId.Value);
             if (fm.Attend)
                 omm = OrganizationMember.InsertOrgMembers(DbUtil.Db, org.OrganizationId, pp.PeopleId,
                     MemberTypeCode.Member, DateTime.Now, null, false);
             else
             {
                 omm = OrganizationMember.Load(DbUtil.Db, pp.PeopleId, org.OrganizationId);
                 if (omm != null)
                     omm.RemoveFromGroup(DbUtil.Db, "Attended");
             }
         }
         if (omm == null)
             continue;
         if (fm.Attend)
             omm.AddToGroup(DbUtil.Db, "Attended");
         if (!fm.PeopleId.HasValue)
             omm.AddToGroup(DbUtil.Db, "Added");
     }
 }