Beispiel #1
0
        public string GetFullInstanceList_HtmlPage(int taskId)
        {
            List <DtoFullInstance> instancesByteData = _repository.GetFullInstancesByTaskId(taskId);
            var instances = new List <RFullInstance>();

            foreach (var instance in instancesByteData)
            {
                var rinstance = _mapper.Map <RFullInstance>(instance);
                rinstance.Data     = _archiver.ExtractFromByteArchive(instance.Data);
                rinstance.ViewData = _archiver.ExtractFromByteArchive(instance.ViewData);
                instances.Add(rinstance);
            }

            var jsonInstances = JsonConvert.SerializeObject(instances);

            return(_tableView.ExecuteHtml("", jsonInstances));
        }
Beispiel #2
0
        public void Execute(IReportTaskRunContext taskContext)
        {
            var query    = $"select DataSet from [OperInstance] with(nolock) where id={OperInstanceId}";
            var instance = repos.GetBaseQueryResult(query);

            var package = OperationPackage.Parser.ParseFrom(archiver.ExtractFromByteArchive(instance as byte[]));

            taskContext.Packages[Properties.PackageName] = package;
        }
        public async Task ExecuteAsync(IReportTaskRunContext taskContext)
        {
            var query = $@"select ""DataSet"" from ""OperInstance"" with(nolock) where ""Id""={OperInstanceId}";

            var instance = await repos.GetBaseQueryResult(query, taskContext.CancelSource.Token);

            var package = OperationPackage.Parser.ParseFrom(archiver.ExtractFromByteArchive(instance as byte[]));

            taskContext.Packages[Properties.PackageName] = package;
        }
Beispiel #4
0
        public string GetFullOperInstanceByIdJson(int id)
        {
            var instance    = repository.GetFullOperInstanceById(id);
            var apiInstance = mapper.Map <ApiOperInstance>(instance);

            apiInstance.DataSet = archiver.ExtractFromByteArchive(instance.DataSet);

            apiInstance.OperName = operations.FirstOrDefault(op =>
                                                             op.Id == apiInstance.OperationId)?.Name;

            return(JsonConvert.SerializeObject(apiInstance));
        }
Beispiel #5
0
        public ContentResult GetFullOperInstance(long operInstanceid)
        {
            try
            {
                var instance = logic
                               .GetFullOperInstanceById(operInstanceid);

                var apiInstance = mapper.Map <ApiOperInstance>(instance);
                apiInstance.DataSet = archiver.ExtractFromByteArchive(instance.DataSet);

                return(GetSuccessfulResult(JsonConvert.SerializeObject(apiInstance)));
            }
            catch
            {
                return(GetInternalErrorResult());
            }
        }