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


C# Visitor.AssignVisitorAccessCard方法代码示例

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


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

示例1: 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

示例2: MapAsync

        /// <summary>
        /// Maps the asynchronous.
        /// </summary>
        /// <param name="visitorEntity">The visitor entities.</param>
        /// <returns>Return instance of visitor.</returns>
        private static Visitor MapAsync(Entities.Visitor visitorEntity)
        {
            var visitor = new Visitor();

            if (visitorEntity != null)
            {
                visitor.VisitorId = visitorEntity.VisitorId;
                visitor.PersonalDetail = visitorEntity.PersonalDetail;
                visitor.VisitorTypeId = visitorEntity.VisitorTypeId;
                visitor.SecurityPhotoAddress = visitorEntity.SecurityPhotoAddress;
                visitor.VisitorInfo = new AdditionalInfo();
                visitor.VisitorInfo.CompanyName = visitorEntity.CompanyName;

                visitor.PersonalDetail = visitor.PersonalDetail ?? new PersonalDetail();
                visitor.PersonalDetail.DepartmentId = visitorEntity.PersonalDetail.DepartmentId;

                var passportDetail = visitorEntity.Identifications.FirstOrDefault(a => a.DocumentTypeId.Equals(ApplicationSetting.DocumentTypeId, StringComparison.OrdinalIgnoreCase));
                if (passportDetail != null)
                {
                    visitor.PersonalDetail.DocumentNumber = passportDetail.Number;
                    visitor.PersonalDetail.DocumentTypeId = passportDetail.DocumentTypeId;
                }
                else
                {
                    var identificationDetail = visitorEntity.Identifications.FirstOrDefault();
                    if (identificationDetail != null)
                    {
                        visitor.PersonalDetail.DocumentNumber = identificationDetail.Number;
                        visitor.PersonalDetail.DocumentTypeId = identificationDetail.DocumentTypeId;
                    }
                }

                if (visitorEntity.VisitorAccessCards.Count > 0)
                {
                    visitor.AssignVisitorAccessCard(visitorEntity.VisitorAccessCards);
                }

                if (visitorEntity.Visits.Count > 0)
                {
                    var visit = visitorEntity.Visits.FirstOrDefault();
                    visitor.VisitorInfo.VisitPurpose = visit != null ? visit.VisitPurposeId : null;
                }

                if (visitorEntity.Phones.Count > 0)
                {
                    var phone = visitorEntity.Phones.FirstOrDefault();
                    if (phone != null)
                    {
                        visitor.VisitorInfo.ContactNumber = phone.AreaCode + "-" + phone.Number;
                    }
                }
            }

            return visitor;
        }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:60,代码来源:VisitorMapper.cs


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