当前位置: 首页>>代码示例>>C#>>正文


C# Visitor.AssignMessages方法代码示例

本文整理汇总了C#中Visitor.AssignMessages方法的典型用法代码示例。如果您正苦于以下问题:C# Visitor.AssignMessages方法的具体用法?C# Visitor.AssignMessages怎么用?C# Visitor.AssignMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Visitor的用法示例。


在下文中一共展示了Visitor.AssignMessages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MapVisitors

 /// <summary>
 /// Maps the visitors.
 /// </summary>
 /// <param name="visitor">The visitor.</param>
 /// <param name="personMessages">The messages.</param>
 /// <param name="messageTypeList">The message Type Master List.</param>
 internal static void MapVisitors(Visitor visitor, ListResult<DataAccess.Entities.PersonMessage> personMessages, ListResult<DataAccess.Entities.MessageType> messageTypeList)
 {
     var messageCollection = MessageMapper.MapCollection(personMessages.Items, visitor.VisitorId, messageTypeList);
     if (messageCollection != null && messageCollection.Count > 0)
     {
         visitor.HasMessage = true;
         visitor.AssignMessages(messageCollection);
     }
 }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:15,代码来源:PersonMessagesMapper.cs

示例2: VisitorMapper

 /// <summary>
 /// Visitors the mapper.
 /// </summary>
 /// <param name="visitorCollection">The visitor.</param>
 /// <param name="visitor">The p.</param>
 public static void VisitorMapper(VisitorCollection visitorCollection, PersonBase visitor)
 {
     var visitorMember = new Visitor();
     if (visitor != null && visitorCollection != null)
     {
         visitorMember.VisitorId = visitor.PersonId;
         visitorMember.PersonalDetail = visitor.PersonalDetail;
         visitorMember.Photo = visitor.Photo;
         visitorMember.SecurityPhotoAddress = visitor.SecurityPhotoAddress;
         visitorMember.IsOnboard = visitor.IsOnboard;
         visitorMember.AreAllMessagesGotAcknowledged = visitor.AreAllMessagesGotAcknowledged;
         visitorMember.LastDateTime = visitor.LastDateTime;
         visitorMember.LastEvent = visitor.LastEvent;
         visitorMember.HasAlert = visitor.HasAlert;
         visitorMember.HasMessage = visitor.HasMessage;
         visitorMember.CardNumber = visitor.CardNumber;
         visitorMember.AssignAlerts(visitor.Alerts);
         visitorMember.AssignMessages(visitor.Messages);
         visitorMember.AllowOnboardAlert = visitor.AllowOnboardAlert;
         visitorCollection.Add(visitorMember);
     }
 }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:27,代码来源:PersonMapper.cs

示例3: MapVisitorData

        /// <summary>
        /// Maps the visitor data.
        /// </summary>
        /// <param name="visitor">The visitor.</param>
        /// <param name="persons">The persons.</param>
        /// <param name="eventType">Type of the event.</param>
        private static void MapVisitorData(Visitor visitor, Person persons, NotificationEventType eventType)
        {
            var selectedPerson = RetrieveSelectedPerson();
            Visitor retrievedVisitor = persons.Visitors.FirstOrDefault();

            if (visitor != null)
            {
                if (eventType == NotificationEventType.PersonData)
                {
                    visitor.PersonalDetail.FirstName = retrievedVisitor.PersonalDetail.FirstName;
                    visitor.PersonalDetail.LastName = retrievedVisitor.PersonalDetail.LastName;
                    visitor.PersonalDetail.Gender = retrievedVisitor.PersonalDetail.Gender;
                    visitor.PersonalDetail.Age = retrievedVisitor.PersonalDetail.Age;
                    visitor.PersonalDetail.Birthdate = retrievedVisitor.PersonalDetail.Birthdate;
                    visitor.SecurityPhotoAddress = retrievedVisitor.SecurityPhotoAddress;
                    visitor.PersonalDetail.Country = RetriveCountry(retrievedVisitor.PersonalDetail);
                    if (visitor.PersonalDetail.Country != null)
                    {
                        visitor.PersonalDetail.Country.Name = retrievedVisitor.PersonalDetail.Country.Name;
                    }

                    visitor.PersonalDetail.DocumentType = retrievedVisitor.PersonalDetail.DocumentType;
                    visitor.PersonalDetail.DocumentNumber = retrievedVisitor.PersonalDetail.DocumentNumber;
                    visitor.PersonalDetail.Title = retrievedVisitor.PersonalDetail.Title;
                    visitor.PersonalDetail.DepartmentPOC = retrievedVisitor.PersonalDetail.DepartmentPOC;
                    visitor.VisitorType = retrievedVisitor.VisitorType;

                    if (visitor.VisitorInfo == null)
                    {
                        visitor.VisitorInfo = new VisitorInfo();
                    }

                    visitor.VisitorInfo.VisitPurpose = retrievedVisitor.VisitorInfo.VisitPurpose;
                    visitor.AssignVisitorAccessCard(retrievedVisitor.VisitorAccessCards);
                    visitor.VisitorInfo.CompanyName = retrievedVisitor.VisitorInfo.CompanyName;
                    visitor.PersonalDetail.DepartmentName = retrievedVisitor.PersonalDetail.DepartmentName;
                    visitor.VisitorInfo.ContactNumber = retrievedVisitor.VisitorInfo.ContactNumber;
                    visitor.VisitorInfo.CompanyContactNumber = retrievedVisitor.VisitorInfo.CompanyContactNumber;
                }
                else if (eventType == NotificationEventType.BoardingStatus)
                {
                    visitor.IsOnboard = retrievedVisitor.IsOnboard;
                    visitor.LastEvent = retrievedVisitor.LastEvent;
                    visitor.LastDateTime = retrievedVisitor.LastDateTime;

                    if (visitor.VisitorId.Equals(selectedPerson.PersonId, StringComparison.OrdinalIgnoreCase))
                    {
                        selectedPerson.IsOnboard = retrievedVisitor.IsOnboard;
                        selectedPerson.LastEvent = retrievedVisitor.LastEvent;
                        selectedPerson.LastDateTime = retrievedVisitor.LastDateTime;
                    }
                }
                else if (eventType == NotificationEventType.Alert)
                {
                    visitor.HasAlert = retrievedVisitor.HasAlert;
                    visitor.AssignAlerts(retrievedVisitor.Alerts);

                    selectedPerson.HasAlert = retrievedVisitor.HasAlert;
                    selectedPerson.AssignAlerts(retrievedVisitor.Alerts);
                    Messenger.Instance.Notify(MessengerMessage.NotifyPersonAlert, selectedPerson);
                    Messenger.Instance.Notify(MessengerMessage.NotifyAlertDetails, selectedPerson);
                }
                else if (eventType == NotificationEventType.Message)
                {
                    var messageAcknowledge = retrievedVisitor.Messages.All(m => m.StatusId.Equals(CommonConstants.MessageAcknowledgeStatusId));
                    visitor.AreAllMessagesGotAcknowledged = messageAcknowledge;
                    visitor.AssignMessages(retrievedVisitor.Messages);

                    selectedPerson.AreAllMessagesGotAcknowledged = messageAcknowledge;
                    selectedPerson.AssignPersonMessages(retrievedVisitor.Messages);
                    Messenger.Instance.Notify(MessengerMessage.NotifyPersonMessage, selectedPerson);
                    Messenger.Instance.Notify(MessengerMessage.NotifyMessageDetails, selectedPerson);
                }
            }
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:81,代码来源:NotificationManager.cs


注:本文中的Visitor.AssignMessages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。