Beispiel #1
0
        public static void RenderAttendees(TextWriter writer, AttendeeType type, CalendarItemBase item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            bool flag = true;
            int  num  = 0;

            foreach (Attendee attendee in item.AttendeeCollection)
            {
                if (attendee.AttendeeType == type)
                {
                    if (!flag && attendee.Participant.RoutingType != null)
                    {
                        writer.Write("; ");
                    }
                    AddressBookHelper.RenderParticipant(writer, num, attendee.Participant);
                    flag = false;
                }
                num++;
            }
            if (flag)
            {
                writer.Write(" ");
            }
        }
Beispiel #2
0
 public Attendee Add(Participant participant, AttendeeType attendeeType = AttendeeType.Required, ResponseType?responseType = null, ExDateTime?replyTime = null, bool checkExisting = false)
 {
     return(AttendeeCollection.InternalAdd(this, delegate
     {
         int num;
         Attendee attendee = OccurrenceAttendeeCollection.FindAttendee(this.exceptionAttendeeCollection, participant, this.occurrence.Session as MailboxSession, out num);
         if (attendee != null && attendee.HasFlags(RecipientFlags.ExceptionalDeleted))
         {
             attendee.RecipientFlags &= ~RecipientFlags.ExceptionalDeleted;
             this.exceptionAttendeeCollection.Remove(attendee);
             this.exceptionAttendeeCollection.LocationIdentifierHelperInstance.SetLocationIdentifier(46965U);
             attendee = this.exceptionAttendeeCollection.AddClone(attendee);
             attendee.AttendeeType = attendeeType;
             if (responseType != null)
             {
                 attendee.ResponseType = responseType.Value;
             }
             if (replyTime != null)
             {
                 attendee.ReplyTime = replyTime.Value;
             }
         }
         else
         {
             attendee = this.exceptionAttendeeCollection.Add(participant, attendeeType, responseType, replyTime, checkExisting);
         }
         this.attendeeCollection.Add(attendee);
         return attendee;
     }, participant, attendeeType, responseType, checkExisting));
 }
Beispiel #3
0
        public async void Initialize(AttendeeType attendeeType)
        {
            await Refresh();

            BindingContext = this;
            InitializeComponent();
        }
Beispiel #4
0
    public TestData(
        string checkInsFirstName,
        string checkInsLastName,
        string peopleFirstName,
        string peopleLastName,
        long checkInsId,
        long?peopleId,
        AttendeeType attendanceType,
        TestLocationIds testLocation,
        IImmutableList <TestFieldData> fieldData,
        bool expectedMayLeaveAlone,
        bool expectedHasPeopleWithoutPickupPermission,
        long householdId,
        string householdName,
        string?securityCode = null
        )
    {
        CheckInsFirstName     = checkInsFirstName;
        CheckInsLastName      = checkInsLastName;
        PeopleFirstName       = peopleFirstName;
        PeopleLastName        = peopleLastName;
        CheckInsId            = checkInsId;
        PeopleId              = peopleId;
        AttendanceType        = attendanceType;
        TestLocation          = testLocation;
        ExpectedMayLeaveAlone = expectedMayLeaveAlone;
        ExpectedHasPeopleWithoutPickupPermission = expectedHasPeopleWithoutPickupPermission;
        FieldData = fieldData;

        HouseholdId   = householdId;
        HouseholdName = householdName;

        SecurityCode    = SetSecurityCode(securityCode: securityCode);
        LocationGroupId = GetLocationGroup(testLocationId: testLocation);
    }
Beispiel #5
0
        private void UpdateParticipantsOnCalendarItem(CalendarItemBase calendarItem, bool isReadOnlyItem)
        {
            this.CheckDisposed("ProcessParticipants");
            base.LocationIdentifierHelperInstance.SetLocationIdentifier(62325U, LastChangeAction.ProcessParticipants);
            IAttendeeCollection attendeeCollection = calendarItem.AttendeeCollection;

            calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(37749U);
            attendeeCollection.Clear();
            bool flag = false;

            if (base.From != null)
            {
                calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(54133U);
                attendeeCollection.Add(base.From, AttendeeType.Required, null, null, false).RecipientFlags = (RecipientFlags.Sendable | RecipientFlags.Organizer);
                flag = true;
            }
            List <BlobRecipient> list = this.GetUnsendableRecipients();

            if (!isReadOnlyItem)
            {
                this.SetUnsendableRecipients(list);
            }
            list = MeetingRequest.MergeRecipientLists(base.Recipients, list);
            Participant participant = null;

            if (base.IsDelegated())
            {
                participant = (Participant)base.TryGetProperty(InternalSchema.ReceivedBy);
            }
            foreach (BlobRecipient blobRecipient in list)
            {
                RecipientFlags valueOrDefault = blobRecipient.GetValueOrDefault <RecipientFlags>(InternalSchema.RecipientFlags);
                bool           flag2          = (valueOrDefault & RecipientFlags.Organizer) == RecipientFlags.Organizer;
                if (flag2)
                {
                    if (flag)
                    {
                        continue;
                    }
                    flag = true;
                }
                if (!blobRecipient.Participant.AreAddressesEqual(base.From))
                {
                    RecipientItemType type         = MapiUtil.MapiRecipientTypeToRecipientItemType(blobRecipient.GetValueOrDefault <RecipientType>(InternalSchema.RecipientType, RecipientType.To));
                    AttendeeType      attendeeType = Attendee.RecipientItemTypeToAttendeeType(type);
                    Participant       participant2 = blobRecipient.Participant;
                    if (participant != null && Participant.HasSameEmail(participant2, participant, base.MailboxSession, true))
                    {
                        calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(41845U);
                        attendeeCollection.Add(base.ReceivedRepresenting, attendeeType, null, null, false);
                        participant = null;
                    }
                    else
                    {
                        calendarItem.LocationIdentifierHelperInstance.SetLocationIdentifier(58229U);
                        attendeeCollection.Add(participant2, attendeeType, null, null, false);
                    }
                }
            }
        }
Beispiel #6
0
        public ActionResult DeleteConfirmed(int id)
        {
            AttendeeType attendeeType = db.AttendeeTypes.Find(id);

            db.AttendeeTypes.Remove(attendeeType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #7
0
 private static AttendanceTypeId MapAttendanceType(AttendeeType attendeeType)
 {
     return(attendeeType switch
     {
         AttendeeType.Guest => AttendanceTypeId.Guest,
         AttendeeType.Regular => AttendanceTypeId.Regular,
         AttendeeType.Volunteer => AttendanceTypeId.Volunteer,
         _ => throw new ArgumentOutOfRangeException(paramName: nameof(attendeeType), actualValue: attendeeType, message: null)
     });
        // GET: /Registration/IndivCheckin
        public ActionResult IndivCheckin(int id)
        {
            // pass the attendee to the view
            Attendee attendee = db.Attendees.Where(x => x.ID == id).FirstOrDefault();

            ViewBag.attendee = attendee;

            // get ids for the activity and agenda
            Parm checkinParm = db.Parms.Where(o => o.ParmName == "RegistrationAgendaID").FirstOrDefault();
            int  agendaID    = Int32.Parse(checkinParm.ParmValue);

            ViewBag.agendaId = agendaID;
            List <Activity> activities = db.Activities.Where(o => o.AgendaID == agendaID).ToList();

            ViewBag.activityId = activities[0].ID;

            // show attendee type
            int          participant_type = Int32.Parse(attendee.ParticipantType);
            AttendeeType attendeeType     = db.AttendeeTypes.Where(x => x.ID == participant_type).FirstOrDefault();

            ViewBag.attendeeType = attendeeType;

            // pass list of registered gift cards
            ViewBag.giftcards = GiftCard.GetIssued(db, attendee);

            // pass a list of waivers
            List <Parm> parms = db.Parms.Where(x => x.ParmName.StartsWith("ActivityWaiver-")).ToList();

            ViewBag.waivers = new List <Waiver>();
            foreach (Parm parm in parms)
            {
                // get the activity id
                int activityId = Int32.Parse(parm.ParmName.Substring(parm.ParmName.IndexOf('-') + 1));

                // parse out the url and name
                int    commaPos = parm.ParmValue.IndexOf(',');
                string url      = parm.ParmValue.Substring(0, commaPos);
                string name     = parm.ParmValue.Substring(commaPos + 1);

                // check for existing signature
                string name_encoded = new string (name.Where(Char.IsLetter).ToArray());
                string sig_url      = "/Content/activity_waivers/" + attendee.LastName + attendee.FirstName + "-WaiverSig-" + name_encoded + ".png";
                string sig_fname    = Server.MapPath("~") + "Content\\activity_waivers\\" + attendee.LastName + attendee.FirstName + "-WaiverSig-" + name_encoded + ".png";
                if (!System.IO.File.Exists(sig_fname))
                {
                    sig_url = null;
                }


                // store this waiver in the list
                ViewBag.waivers.Add(new Waiver(parm.ID, url, name, sig_url));
            }

            // display the view
            return(View());
        }
Beispiel #9
0
 public ActionResult Edit([Bind(Include = "ID,EventID,AttendeeType1,Name,IsGeneral")] AttendeeType attendeeType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(attendeeType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(attendeeType));
 }
Beispiel #10
0
            /// <summary>
            /// the xml parsing method
            /// </summary>
            /// <param name="node">the xml node holding the attendeeStatus</param>
            /// <returns>AttendeeType</returns>

            public static AttendeeType parse(XmlNode node)
            {
                AttendeeType attendee = null;

                if (String.Compare(node.NamespaceURI, BaseNameTable.gNamespace, true, CultureInfo.InvariantCulture) == 0)
                {
                    attendee       = new AttendeeType();
                    attendee.Value = Utilities.GetAttributeValue("value", node);
                }
                return(attendee);
            }
Beispiel #11
0
        public ActionResult Create([Bind(Include = "ID,EventID,AttendeeType1,Name,IsGeneral")] AttendeeType attendeeType)
        {
            if (ModelState.IsValid)
            {
                db.AttendeeTypes.Add(attendeeType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(attendeeType));
        }
Beispiel #12
0
        // GET: AttendeeTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AttendeeType attendeeType = db.AttendeeTypes.Find(id);

            if (attendeeType == null)
            {
                return(HttpNotFound());
            }
            return(View(attendeeType));
        }
Beispiel #13
0
        private static IList <IRecipientBase> GetCalendarItemRecipientCollection(AttendeeType type, CalendarItemBase item)
        {
            IList <IRecipientBase> list = new List <IRecipientBase>();

            for (int i = 0; i < item.AttendeeCollection.Count; i++)
            {
                Attendee attendee = item.AttendeeCollection[i];
                if (attendee.AttendeeType == type)
                {
                    list.Add(attendee);
                }
            }
            return(list);
        }
Beispiel #14
0
        internal static RecipientItemType AttendeeTypeToRecipientItemType(AttendeeType attendeeType)
        {
            switch (attendeeType)
            {
            case AttendeeType.Required:
                return(RecipientItemType.To);

            case AttendeeType.Optional:
                return(RecipientItemType.Cc);

            case AttendeeType.Resource:
                return(RecipientItemType.Bcc);

            default:
                ExTraceGlobals.StorageTracer.TraceDebug <AttendeeType>(0L, "AttendeeType::AttendeeTypeToRecipientType. Wrong Attendee.Type: {0}", attendeeType);
                throw new ArgumentException(ServerStrings.ExInvalidAttendeeType(attendeeType));
            }
        }
 public AttendanceData(
     string firstName,
     string lastName,
     long checkInsId,
     long?peopleId,
     AttendeeType attendanceType,
     TestLocationIds testLocation,
     string securityCode
     )
 {
     FirstName      = firstName;
     LastName       = lastName;
     CheckInsId     = checkInsId;
     PeopleId       = peopleId;
     AttendanceType = attendanceType;
     TestLocation   = testLocation;
     SecurityCode   = securityCode;
 }
Beispiel #16
0
 public Attendee Add(Participant participant, AttendeeType attendeeType = AttendeeType.Required, ResponseType?responseType = null, ExDateTime?replyTime = null, bool checkExisting = false)
 {
     return(AttendeeCollection.InternalAdd(this, delegate
     {
         Attendee attendeeToAdd = this.GetAttendeeToAdd(participant);
         attendeeToAdd.AttendeeType = attendeeType;
         if (responseType != null)
         {
             attendeeToAdd.ResponseType = responseType.Value;
         }
         if (replyTime != null)
         {
             attendeeToAdd.ReplyTime = replyTime.Value;
         }
         this.ReportRecipientChange(LastChangeAction.RecipientAdded);
         return attendeeToAdd;
     }, participant, attendeeType, responseType, checkExisting));
 }
Beispiel #17
0
    public TestData(
        string checkInsFirstName,
        string checkInsLastName,
        long checkInsId,
        long?peopleId,
        AttendeeType attendanceType,
        TestLocationIds testLocation,
        string?securityCode
        )
    {
        CheckInsFirstName = checkInsFirstName;
        CheckInsLastName  = checkInsLastName;
        CheckInsId        = checkInsId;
        PeopleId          = peopleId;
        AttendanceType    = attendanceType;
        TestLocation      = testLocation;
        SecurityCode      = SetSecurityCode(securityCode: securityCode);
        FieldData         = ImmutableList <TestFieldData> .Empty;

        LocationGroupId = GetLocationGroup(testLocationId: testLocation);
    }
Beispiel #18
0
    public CheckInsUpdate(
        long checkInsId,
        long?peopleId,
        AttendeeType attendeeType,
        string securityCode,
        int locationId,
        DateTime creationDate,
        PeopleUpdate kid,
        string?emergencyContactName,
        string?emergencyContactNumber)
    {
        CheckInsId   = checkInsId;
        PeopleId     = peopleId;
        SecurityCode = securityCode;

        LocationId             = locationId;
        CreationDate           = creationDate;
        Kid                    = kid;
        EmergencyContactName   = emergencyContactName;
        EmergencyContactNumber = emergencyContactNumber;
        AttendeeType           = attendeeType;
    }
Beispiel #19
0
        public Attendee(string email, AttendeeType type, string responseStatus)
        {
            this.Email    = email;
            this.Required = type == AttendeeType.Required;
            switch (responseStatus)
            {
            case "accepted":
                this.Status = OlResponseStatus.olResponseAccepted;
                break;

            case "declined":
                this.Status = OlResponseStatus.olResponseDeclined;
                break;

            case "tentative":
                this.Status = OlResponseStatus.olResponseTentative;
                break;

            default:
                this.Status = OlResponseStatus.olResponseNotResponded;
                break;
            }
        }
Beispiel #20
0
        private static EditCalendarItemHelper.CalendarItemUpdateFlags AddAttendees(IAttendeeCollection attendees, AttendeeType attendeeType, string wellName, UserContext userContext, HttpRequest request)
        {
            EditCalendarItemHelper.CalendarItemUpdateFlags calendarItemUpdateFlags = EditCalendarItemHelper.CalendarItemUpdateFlags.None;
            bool        flag          = false;
            Participant participant   = null;
            string      formParameter = Utilities.GetFormParameter(request, wellName, false);

            if (string.IsNullOrEmpty(formParameter))
            {
                return(calendarItemUpdateFlags);
            }
            ArrayList arrayList = new ArrayList();

            RecipientWell.ResolveRecipients(formParameter, arrayList, userContext, userContext.UserOptions.CheckNameInContactsFirst);
            for (int i = 0; i < arrayList.Count; i++)
            {
                RecipientWellNode recipientWellNode = (RecipientWellNode)arrayList[i];
                flag |= Utilities.CreateExchangeParticipant(out participant, recipientWellNode.DisplayName, recipientWellNode.RoutingAddress, recipientWellNode.RoutingType, recipientWellNode.AddressOrigin, recipientWellNode.StoreObjectId, recipientWellNode.EmailAddressIndex);
                if (participant != null)
                {
                    attendees.Add(participant, attendeeType, null, null, false);
                    calendarItemUpdateFlags |= EditCalendarItemHelper.CalendarItemUpdateFlags.AttendeesChanged;
                }
            }
            if (flag)
            {
                calendarItemUpdateFlags |= EditCalendarItemHelper.CalendarItemUpdateFlags.HasUnresolvedAttendees;
            }
            return(calendarItemUpdateFlags);
        }
Beispiel #21
0
 /// <summary>
 /// the xml parsing method
 /// </summary>
 /// <param name="node">the xml node holding the attendeeStatus</param>
 /// <returns>AttendeeType</returns>
 public static AttendeeType parse(XmlNode node)
 {
     AttendeeType attendee = null;
     if (String.Compare(node.NamespaceURI, BaseNameTable.gNamespace, true) == 0)
     {
         attendee = new AttendeeType();
         if (node.Attributes != null)
         {
             attendee.Value = node.Attributes["value"].Value;
         }
     }
     return attendee;
 }
Beispiel #22
0
 internal static Attendee InternalAdd(IAttendeeCollection attendeeCollection, Func <Attendee> performAdd, Participant participant, AttendeeType attendeeType = AttendeeType.Required, ResponseType?responseType = null, bool checkExisting = false)
 {
     if (participant == null)
     {
         throw new ArgumentNullException("participant");
     }
     EnumValidator.ThrowIfInvalid <AttendeeType>(attendeeType, "attendeeType");
     if (responseType != null)
     {
         EnumValidator.ThrowIfInvalid <ResponseType>(responseType.Value, "responseType");
     }
     if (checkExisting)
     {
         int num = AttendeeCollection.IndexOf(attendeeCollection, participant, false);
         if (num != -1)
         {
             Attendee attendee = attendeeCollection[num];
             if (attendeeType != AttendeeType.Required || attendee.AttendeeType == AttendeeType.Required)
             {
                 return(attendee);
             }
             attendeeCollection.RemoveAt(num);
         }
     }
     return(performAdd());
 }
Beispiel #23
0
            /// <summary>
            /// the xml parsing method
            /// </summary>
            /// <param name="node">the xml node holding the attendeeStatus</param>
            /// <returns>AttendeeType</returns>

            public static AttendeeType parse(XmlNode node)
            {
                AttendeeType attendee = null;
                if (String.Compare(node.NamespaceURI, BaseNameTable.gNamespace, true, CultureInfo.InvariantCulture) == 0)
                {
                    attendee = new AttendeeType();
                    attendee.Value = Utilities.GetAttributeValue("value", node);
                }
                return attendee;
            }
Beispiel #24
0
        //////////////////////////////////////////////////////////////////////
        /// <summary>Parses an xml node to create a Where  object.</summary>
        /// <param name="node">the node to parse node</param>
        /// <param name="parser">the xml parser to use if we need to dive deeper</param>
        /// <returns>the created Where  object</returns>
        //////////////////////////////////////////////////////////////////////
        public IExtensionElementFactory CreateInstance(XmlNode node, AtomFeedParser parser)
        {
            Tracing.TraceCall();
            Who who = null;

            if (node != null)
            {
                object localname = node.LocalName;
                if (!localname.Equals(this.XmlName) ||
                    !node.NamespaceURI.Equals(this.XmlNameSpace))
                {
                    return(null);
                }
            }

            who = new Who();
            if (node != null)
            {
                if (node.Attributes != null)
                {
                    if (node.Attributes[GDataParserNameTable.XmlAttributeRel] != null)
                    {
                        who.Rel = node.Attributes[GDataParserNameTable.XmlAttributeRel].Value;
                    }

                    if (node.Attributes[GDataParserNameTable.XmlAttributeValueString] != null)
                    {
                        who.valueString = node.Attributes[GDataParserNameTable.XmlAttributeValueString].Value;
                    }
                    if (node.Attributes[GDataParserNameTable.XmlAttributeEmail] != null)
                    {
                        who.email = node.Attributes[GDataParserNameTable.XmlAttributeEmail].Value;
                    }
                }

                if (node.HasChildNodes)
                {
                    XmlNode childNode = node.FirstChild;
                    while (childNode != null)
                    {
                        if (childNode is XmlElement)
                        {
                            if (childNode.LocalName == GDataParserNameTable.XmlAttendeeTypeElement)
                            {
                                who.Attendee_Type = AttendeeType.parse(childNode);
                            }
                            else if (childNode.LocalName == GDataParserNameTable.XmlAttendeeStatusElement)
                            {
                                who.Attendee_Status = AttendeeStatus.parse(childNode);
                            }
                            else if (childNode.LocalName == GDataParserNameTable.XmlEntryLinkElement)
                            {
                                who.EntryLink = EntryLink.ParseEntryLink(childNode, parser);
                            }
                        }
                        childNode = childNode.NextSibling;
                    }
                }
            }
            return(who);
        }
Beispiel #25
0
 public AttendeeData(Participant participant, AttendeeType attendeeType)
 {
     this.attendeeType = attendeeType;
     this.participant  = AttendeeData.CloneParticipant(participant);
 }