예제 #1
0
        public byte[] Build(string documentType, string printViewName, object printViewSource, PrintViewFileFormat priiViewFormat = PrintViewFileFormat.Pdf)
        {
            if (string.IsNullOrEmpty(documentType))
            {
                throw new ArgumentNullException(nameof(documentType));
            }

            if (string.IsNullOrEmpty(printViewName))
            {
                throw new ArgumentNullException(nameof(printViewName));
            }

            //Build view name

            var printViewMetadata = _metadataApi.GetMetadata($"PrintViews.{documentType}.{printViewName}");

            if (printViewMetadata == null)
            {
                throw new ArgumentException($"Print view '{documentType}/{printViewName}' not found.");
            }

            var printViewData = _printViewBuilder.BuildFile(printViewMetadata, printViewSource, priiViewFormat);

            return(printViewData);
        }
        private Task <object> GetMetadataItem(IHttpRequest request)
        {
            dynamic requestForm  = request.Form.changesObject;
            string  documentType = requestForm.MetadataObject;
            string  viewName     = requestForm.MetadataName;

            var result = _metadataApi.GetMetadata($"Views.{documentType}.{viewName}");

            return(Task.FromResult <object>(result));
        }
예제 #3
0
 public Task <DeviceMetadata> GetMetadataAsync(string deviceId)
 {
     return(client.GetMetadata(deviceId));
 }