public static Entities.Notification ToEntity(BusinessObject.Notification businessObject)
        {
            if (businessObject == null)
                return null;

            Entities.Notification entity = new Entities.Notification
            {
                OrderId = businessObject.OrderId,
                IsRead = businessObject.IsRead,
                NotificationId = businessObject.NotificationId,
                NotificationMessage = businessObject.NotificationMessage,
                NotificationTypeId = (int)businessObject.NotificationType
            };

            return entity;
        }
예제 #2
0
        public static BusinessObject.Notification ToBusinessObject(Entities.Notification entity)
        {
            if (entity == null)
            {
                return(null);
            }

            BusinessObject.Notification businessObject = new BusinessObject.Notification
            {
                OrderId             = entity.OrderId,
                IsRead              = entity.IsRead,
                NotificationId      = entity.NotificationId,
                NotificationMessage = entity.NotificationMessage,
                NotificationType    = (Enumeration.NotificationType)entity.NotificationTypeId
            };

            return(businessObject);
        }
예제 #3
0
        public static Entities.Notification ToEntity(BusinessObject.Notification businessObject)
        {
            if (businessObject == null)
            {
                return(null);
            }

            Entities.Notification entity = new Entities.Notification
            {
                OrderId             = businessObject.OrderId,
                IsRead              = businessObject.IsRead,
                NotificationId      = businessObject.NotificationId,
                NotificationMessage = businessObject.NotificationMessage,
                NotificationTypeId  = (int)businessObject.NotificationType
            };

            return(entity);
        }
 public int UpdateNotification(Notification notification)
 {
     return NotificationData.UpdateByNotificationId(notification);
 }
        public static int UpdateByNotificationId(Notification notification)
        {
            using (ObjectConnection objectConnection = new ObjectConnection())
            {
                using (UpdateNotificationByNotificationIdCommand objectCommand = new UpdateNotificationByNotificationIdCommand(objectConnection))
                {
                    objectCommand.NotificationId = notification.NotificationId;
                    objectCommand.OrderId = notification.OrderId;
                    objectCommand.NotificationMessage = notification.NotificationMessage;
                    objectCommand.NotificationTypeId = notification.NotificationTypeId;
                    objectCommand.IsRead = notification.IsRead;

                    objectConnection.Open();
                    objectCommand.ExecuteNonQuery();

                    return objectCommand.ReturnValue;
                }
            }
        }