本文整理汇总了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();
}