Exemplo n.º 1
0
        public override void ExecuteJob()
        {
            var user = SecurityFacade.CurrentUser();
            var app  = MetadataProvider.Application("asset").ApplyPoliciesWeb(new ApplicationMetadataSchemaKey("RI104Export"));

            var sliced = MetadataProvider.SlicedEntityMetadata(app);
            var dto    = R104ExtractorHelper.BuildDTO();
            var rows   = _entityRepository.Get(sliced, dto);

            var csvBytes   = _excelUtil.ConvertGridToCsv(user, app.Schema, rows);
            var outputPath = FileBaseDirectoryPath + FileName;

            if (ApplicationConfiguration.IsLocal())
            {
                outputPath = "c:\\softwrench\\hapag\\Active_Assets.csv";
            }
            File.WriteAllBytes(outputPath, csvBytes);
        }