#pragma warning disable 1591
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
namespace Disco.Web.Areas.Config.Views.Shared
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Shared/_DeviceGroupDocumentBulkGenerate.cshtml")]
public partial class _DeviceGroupDocumentBulkGenerate : Disco.Services.Web.WebViewPage
{
public _DeviceGroupDocumentBulkGenerate()
{
}
public override void Execute()
{
#line 2 "..\..\Areas\Config\Views\Shared\_DeviceGroupDocumentBulkGenerate.cshtml"
if (Model.BulkGenerateDocumentTemplates != null && Model.BulkGenerateDocumentTemplates.Any())
{
List allowedTargets = new List();
if (Authorization.HasAll(Claims.Device.Actions.GenerateDocuments, Claims.Config.DocumentTemplate.BulkGenerate))
{
allowedTargets.Add(AttachmentTypes.Device);
}
if (Authorization.HasAll(Claims.Job.Actions.GenerateDocuments, Claims.Config.DocumentTemplate.BulkGenerate))
{
allowedTargets.Add(AttachmentTypes.Job);
}
if (Authorization.HasAll(Claims.User.Actions.GenerateDocuments, Claims.Config.DocumentTemplate.BulkGenerate))
{
allowedTargets.Add(AttachmentTypes.User);
}
var allowedTemplates = Model.BulkGenerateDocumentTemplates.Where(m => allowedTargets.Contains(m.AttachmentType)).ToList();
if (allowedTemplates.Any())
{
string targetDescription;
int targetId = Model.DeviceGroupId;
Func urlDelegate;
if (Model is Disco.Web.Areas.Config.Models.DeviceBatch.ShowModel)
{
targetDescription = "Batch";
urlDelegate = MVC.API.DocumentTemplate.BulkGenerateDeviceBatch;
}
else if (Model is Disco.Web.Areas.Config.Models.DeviceModel.ShowModel)
{
urlDelegate = MVC.API.DocumentTemplate.BulkGenerateDeviceModel;
targetDescription = "Model";
}
else if (Model is Disco.Web.Areas.Config.Models.DeviceProfile.ShowModel)
{
urlDelegate = MVC.API.DocumentTemplate.BulkGenerateDeviceProfile;
targetDescription = "Profile";
}
else
{
throw new NotSupportedException("Unsupported Device Group Model");
}
#line default
#line hidden
WriteLiteral("