Esempio n. 1
0
        public static ReportState FromTask(
            DistributedTask task,
            IHttpContextAccessor httpContextAccessor,
            int tenantId,
            Guid userId)
        {
            var data = new ReportStateData(
                task.GetProperty <string>("fileName"),
                task.GetProperty <string>("tmpFileName"),
                task.GetProperty <string>("script"),
                task.GetProperty <int>("reportType"),
                task.GetProperty <ReportOrigin>("reportOrigin"),
                null,
                null,
                tenantId,
                userId
                );

            return(new ReportState(null, data, httpContextAccessor)
            {
                Id = task.GetProperty <string>("id"),
                FileId = task.GetProperty <int>("fileId"),
                Status = task.GetProperty <ReportStatus>("status"),
                Exception = task.GetProperty <string>("exception")
            });
        }
Esempio n. 2
0
 public ReportState(IServiceProvider serviceProvider, ReportStateData reportStateData, IHttpContextAccessor httpContextAccessor)
 {
     TaskInfo        = new DistributedTask();
     ServiceProvider = serviceProvider;
     FileName        = reportStateData.FileName;
     TmpFileName     = reportStateData.TmpFileName;
     Script          = reportStateData.Script;
     ReportType      = reportStateData.ReportType;
     Origin          = reportStateData.Origin;
     SaveFileAction  = reportStateData.SaveFileAction;
     Obj             = reportStateData.Obj;
     TenantId        = reportStateData.TenantId;
     UserId          = reportStateData.UserId;
     ContextUrl      = httpContextAccessor.HttpContext?.Request.GetUrlRewriter().ToString();
 }