当前位置: 首页>>代码示例>>C#>>正文


C# ApplicationManager.FindApplications方法代码示例

本文整理汇总了C#中ApplicationManager.FindApplications方法的典型用法代码示例。如果您正苦于以下问题:C# ApplicationManager.FindApplications方法的具体用法?C# ApplicationManager.FindApplications怎么用?C# ApplicationManager.FindApplications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ApplicationManager的用法示例。


在下文中一共展示了ApplicationManager.FindApplications方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Download

        /// <summary>
        /// Downloads a CSV document for an Application Search.
        /// </summary>
        /// <param name="context">The request context.</param>
        /// <param name="sessionData">The <see cref="SessionData"/> containing the application id.</param>
        /// <param name="formId">The form id.</param>
        /// <param name="filter">The search filter as JSON.</param>
        /// <param name="fileName">The file name.</param>
        /// <param name="applicationManager"><see cref="ApplicationManager"/> instance for performing application search.</param>
        /// <param name="userManager">The user manager.</param>
        private void Download(HttpContext context, SessionData sessionData, string formId, string filter, string fileName, ApplicationManager applicationManager, UserManager userManager)
        {
            var filterObj = JsonConvert.DeserializeObject<ApplicationSearchFilter>(filter);
            var apps = applicationManager.FindApplications(formId, sessionData.UserId, filterObj);

            var sb = new StringBuilder();

            ApplicationListCsvExporter csvExporter = new ApplicationListCsvExporter(userManager.GetUserById);
            csvExporter.GenerateCsv(apps, sb);

            var csvBytes = Encoding.UTF8.GetBytes(sb.ToString());

            var response = HttpContext.Current.Response;
            response.BuildBinaryFileResponse(string.Format("{0}.csv", fileName), csvBytes, Encoding.UTF8, InternetMediaType.ApplicationOctetStream);
            response.Flush();
            context.ApplicationInstance.CompleteRequest();
        }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:27,代码来源:CsvExportHandler.ashx.cs


注:本文中的ApplicationManager.FindApplications方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。