public static MCommunication_Alert MCommunication_Alert(Alert dbAlert)
 {
     return(new MCommunication_Alert()
     {
         AlertId = dbAlert.AlertId,
         AlertType = GetValue.MCommunication_AlertType(dbAlert.AlertTypeCode),
         CreateDateTimeUtc = dbAlert.CreateDateTimeUtc,
         AcknowledgementDateTimeUtc = dbAlert.AcknowledgementDateTimeUtc,
         Description = dbAlert.Description,
         Exception = dbAlert.Exception,
         ParticipantId = dbAlert.ParticipantId,
         ParticipantReference = dbAlert.Participant?.ParticipantReference,
         TopicId = dbAlert.TopicId,
         TopicReference = dbAlert.Topic?.TopicReference,
         Email = dbAlert.EmailRequestId.HasValue ? MCommunication_Email(dbAlert.EmailRequest) : null
     });
 }
Exemplo n.º 2
0
 public static MProject_ProjectSnapshotComponent MProject_ProjectSnapshotComponent(ProjectSnapshotComponent dbProjectSnapshotComponent, MInventory_LibraryEntry mInventoryItem, InventoryItemType dbInventoryItemType, UnitOfMeasure dbUnitOfMeasure, decimal unitPrice, decimal totalPrice)
 {
     return(new MProject_ProjectSnapshotComponent()
     {
         ProjectSnapshotComponentId = dbProjectSnapshotComponent.ProjectSnapshotComponentId,
         Description = mInventoryItem.Name,
         Quantity = dbProjectSnapshotComponent.Quantity,
         UnitPrice = unitPrice,
         TotalPrice = totalPrice,
         ConsumableReference = CreateConsumableReference.FromInventoryItemId(mInventoryItem.InventoryItemId),
         Sku = mInventoryItem.Sku,
         UnitOfMeasure = GetValue.MCommon_UnitOfMeasure(dbUnitOfMeasure.UnitOfMeasureCode),
         UnitOfMeasureName = dbUnitOfMeasure.Name,
         Category = dbInventoryItemType.Name,
         Collection = mInventoryItem.Collection,
         Manufacturer = mInventoryItem.Manufacturer
     });
 }
            public static MCommunication_Notification MCommunication_Notification(Notification dbNotification, bool includeEmails)
            {
                IList <MCommunication_Email> emails = includeEmails
                    ? dbNotification.NotificationEmailRequests.Select(r => MCommunication_Email(r.EmailRequest)).ToList()
                    : null;

                return(new MCommunication_Notification()
                {
                    NotificationId = dbNotification.NotificationId,
                    NotificationType = GetValue.MCommunication_NotificationType(dbNotification.NotificationTypeCode),
                    Text = dbNotification.NotificationTypeCodeNavigation.Name,
                    CreateDateTimeUtc = dbNotification.CreateDateTimeUtc,
                    AcknowledgementDateTimeUtc = dbNotification.AcknowledgementDateTimeUtc,
                    Fields = MCommunication_TopicFields(dbNotification.Topic),
                    ParticipantId = dbNotification.ParticipantId,
                    ParticipantReference = dbNotification.Participant.ParticipantReference,
                    TopicId = dbNotification.TopicId,
                    TopicReference = dbNotification.Topic.TopicReference,
                    Emails = emails
                });
            }