예제 #1
0
        public CheckInOrganization(CmsData.View.CheckinFamilyMember familyMember, int day, int tzOffset)
        {
            peopleID = familyMember.Id ?? 0;

            id     = familyMember.OrgId.Value;
            name   = familyMember.OrgName;
            leader = familyMember.Leader;
            member = familyMember.MemberVisitor == "M";

            checkedIn = familyMember.CheckedIn.Value;
            //labels = familyMember.NumLabels.Value;

            if (familyMember.Hour.HasValue)
            {
                hour = familyMember.Hour.Value;

                var theirTime = DateTime.Now.AddHours(tzOffset);

                if (DateTime.Now.DayOfWeek.ToInt() != day)
                {
                    int dayDiff = day - DateTime.Now.DayOfWeek.ToInt();

                    if (dayDiff < 0)
                    {
                        theirTime = theirTime.AddDays(7 + dayDiff);
                    }
                    else
                    {
                        theirTime = theirTime.AddDays(dayDiff);
                    }
                }

                leadTime = (int)familyMember.Hour.Value.Subtract(theirTime).TotalMinutes;
            }
        }
예제 #2
0
        public CheckInFamilyMember(CmsData.View.CheckinFamilyMember member, int day, int tzOffset)
        {
            id       = member.Id ?? 0;
            age      = member.Age ?? 0;
            position = member.Position ?? 100;
            genderID = member.Genderid ?? 0;

            name    = member.Name;
            altName = member.AltName;

            Person p = DbUtil.Db.LoadPersonById(id);

            if (p.Picture != null)
            {
                Image image = ImageData.DbUtil.Db.Images.SingleOrDefault(i => i.Id == p.Picture.SmallId);

                if (image != null)
                {
                    picture  = Convert.ToBase64String(image.Bits);
                    pictureX = p.Picture.X ?? 0;
                    pictureY = p.Picture.Y ?? 0;
                }
            }

            addOrg(member, day, tzOffset);
        }
예제 #3
0
        public CheckInOrganization(CmsData.View.CheckinFamilyMember familyMember, int day, int tzOffset)
        {
            peopleID = familyMember.Id ?? 0;

            id     = familyMember.OrgId.Value;
            name   = familyMember.OrgName;
            leader = familyMember.Leader;
            member = familyMember.MemberVisitor == "M";

            checkedIn = familyMember.CheckedIn.Value;
            //labels = familyMember.NumLabels.Value;

            Organization orgInfo = DbUtil.Db.Organizations.SingleOrDefault(a => a.OrganizationId == familyMember.OrgId);

            if (orgInfo != null)
            {
                allowOverlap = orgInfo.AllowAttendOverlap;
            }

            if (familyMember.Hour.HasValue)
            {
                hour = familyMember.Hour.Value;

                var theirTime = DateTime.Now.AddHours(tzOffset);

                if (DateTime.Now.DayOfWeek.ToInt() != day)
                {
                    int dayDiff = day - DateTime.Now.DayOfWeek.ToInt();

                    if (dayDiff < 0)
                    {
                        theirTime = theirTime.AddDays(7 + dayDiff);
                    }
                    else
                    {
                        theirTime = theirTime.AddDays(dayDiff);
                    }
                }

                leadTime = (int)familyMember.Hour.Value.Subtract(theirTime).TotalMinutes;
            }
        }
예제 #4
0
        public void addMember(CmsData.View.CheckinFamilyMember newMember, int day, int tzOffset)
        {
            if (members.Count == 0)
            {
                members.Add(new CheckInFamilyMember(newMember, day, tzOffset));
            }
            else
            {
                foreach (var member in members)
                {
                    if (member.id == newMember.Id)
                    {
                        member.addOrg(newMember, day, tzOffset);
                        return;
                    }
                }

                members.Add(new CheckInFamilyMember(newMember, day, tzOffset));
            }
        }
예제 #5
0
        public void addOrg(CmsData.View.CheckinFamilyMember member, int day, int tzOffset)
        {
            CheckInOrganization org = new CheckInOrganization(member, day, tzOffset);

            orgs.Add(org);
        }