Пример #1
0
        OperationItem IAlarmWorkflowService.GetOperationById(string operationId, string detailLevel)
        {
            int rDetailLevel = 0;
            int rOperationId = -1;

            if (!int.TryParse(operationId, out rOperationId))
            {
                // Invalid case
                return(null);
            }
            int.TryParse(detailLevel, out rDetailLevel);

            Operation operation = _operationStore.GetOperationById(rOperationId);

            if (operation == null)
            {
                return(null);
            }

            OperationItemDetailLevel detail = OperationItemDetailLevel.Minimum;

            if (rDetailLevel >= 0 && rDetailLevel <= 1)
            {
                detail = (OperationItemDetailLevel)rDetailLevel;
            }

            return(new OperationItem(operation, detail));
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OperationItem"/> class.
        /// </summary>
        /// <param name="operation">The <see cref="Operation"/> to clone.</param>
        /// <param name="detailLevel">The level of detail of the copied information.</param>
        public OperationItem(Operation operation, OperationItemDetailLevel detailLevel)
            : this()
        {
            this.Id = operation.Id;
            this.OperationGuid = operation.OperationGuid;
            this.Timestamp = operation.Timestamp;
            this.OperationNumber = operation.OperationNumber;
            this.Messenger = operation.Messenger;
            this.Comment = operation.Comment;
            this.Einsatzort = operation.Einsatzort;
            this.Zielort = operation.Zielort;
            this.Priority = operation.Priority;
            this.Keywords = operation.Keywords;
            this.Picture = operation.Picture;
            this.OperationPlan = operation.OperationPlan;
            this.Resources = operation.Resources;
            this.IsAcknowledged = operation.IsAcknowledged;

            // Copy the expensive information only if requested
            if (detailLevel == OperationItemDetailLevel.Full)
            {
                this.RouteImage = operation.RouteImage;
                this.CustomData = operation.CustomData;
            }
        }
        OperationItem IAlarmWorkflowServiceInternal.GetOperationById(int operationId, OperationItemDetailLevel detailLevel)
        {
            Operation operation = _operationStore.GetOperationById(operationId);
            if (operation == null)
            {
                return null;
            }

            return new OperationItem(operation, detailLevel);
        }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OperationItem"/> class.
        /// </summary>
        /// <param name="operation">The <see cref="Operation"/> to clone.</param>
        /// <param name="detailLevel">The level of detail of the copied information.</param>
        public OperationItem(Operation operation, OperationItemDetailLevel detailLevel)
            : this()
        {
            this.Id              = operation.Id;
            this.Timestamp       = operation.Timestamp;
            this.OperationNumber = operation.OperationNumber;
            this.Messenger       = operation.Messenger;
            this.Location        = operation.Location;
            this.Street          = operation.Street;
            this.StreetNumber    = operation.StreetNumber;
            this.City            = operation.City;
            this.ZipCode         = operation.ZipCode;
            this.Property        = operation.Property;
            this.Comment         = operation.Comment;
            this.Keyword         = operation.Keyword;
            this.IsAcknowledged  = operation.IsAcknowledged;

            // Copy the expensive information only if requested
            if (detailLevel == OperationItemDetailLevel.Full)
            {
                this.RouteImage = operation.RouteImage;
                this.CustomData = operation.CustomData;
            }
        }
Пример #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OperationItem"/> class.
        /// </summary>
        /// <param name="operation">The <see cref="Operation"/> to clone.</param>
        /// <param name="detailLevel">The level of detail of the copied information.</param>
        public OperationItem(Operation operation, OperationItemDetailLevel detailLevel)
            : this()
        {
            this.Id = operation.Id;
            this.Timestamp = operation.Timestamp;
            this.OperationNumber = operation.OperationNumber;
            this.Messenger = operation.Messenger;
            this.Location = operation.Location;
            this.Street = operation.Street;
            this.StreetNumber = operation.StreetNumber;
            this.City = operation.City;
            this.ZipCode = operation.ZipCode;
            this.Property = operation.Property;
            this.Comment = operation.Comment;
            this.Keyword = operation.Keyword;
            this.IsAcknowledged = operation.IsAcknowledged;

            // Copy the expensive information only if requested
            if (detailLevel == OperationItemDetailLevel.Full)
            {
                this.RouteImage = operation.RouteImage;
                this.CustomData = operation.CustomData;
            }
        }
        OperationItem IAlarmWorkflowServiceInternal.GetOperationById(int operationId, OperationItemDetailLevel detailLevel)
        {
            Operation operation = _operationStore.GetOperationById(operationId);

            if (operation == null)
            {
                return(null);
            }

            return(new OperationItem(operation, detailLevel));
        }