@model Disco.Models.UI.Config.DocumentTemplate.ConfigDocumentTemplateBulkGenerate @using Disco.Services.Interop.ActiveDirectory; @{ if (Model == null) { throw new ArgumentNullException("Model", "Model cannot be null."); } var userModel = Model as Disco.Web.Areas.Config.Models.DocumentTemplate.BulkGenerateUserModel; var deviceModel = Model as Disco.Web.Areas.Config.Models.DocumentTemplate.BulkGenerateDeviceModel; string scope; if (userModel != null) { scope = "user"; } else if (deviceModel != null) { scope = "device"; } else { throw new InvalidOperationException("Unexpected model: " + Model.GetType().FullName); } }
Enter multiple User Ids separated by <new line>, commas (,) or semicolons (;)
@if (userModel != null) {
Security Groups can also be included. Members will be resolved and added
} @if (deviceModel != null) {
Devices associated with the users will be added
}

Examples:

user6
smi0099
@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
@if (userModel != null) { Domain Admins }
user6,smi0099,@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
user6;smi0099;@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerateAddUsers())) {
@Html.AntiForgeryToken() }
@if (deviceModel != null) {
Enter multiple Device Serial Numbers separated by <new line>, commas (,) or semicolons (;)

Examples:

LAPTOP-12345
TAB-987654
PHONE-ABC321
LAPTOP-12345,TAB-987654,PHONE-ABC321
LAPTOP-12345;TAB-987654;PHONE-ABC321
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerateAddDevices())) {
@Html.AntiForgeryToken() }
} @if (userModel != null) {
Add all members of a group (including recursive members)
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerateAddGroupMembers())) {
@Html.AntiForgeryToken() }
} @if (userModel != null && userModel.UserFlags.Any(f => f.Count > 0)) {
Add all users associated with the flag
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerateAddUserFlag())) {
@foreach (var flag in userModel.UserFlags) {
@flag.Item.Name (@flag.Count.ToString("N0") @scope@(flag.Count == 1 ? null : "s"))
}
@Html.AntiForgeryToken() }
} @if (deviceModel != null && deviceModel.DeviceFlags.Any(f => f.Count > 0)) {
Add all devices associated with the flag
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerateAddDeviceFlag())) {
@foreach (var flag in deviceModel.DeviceFlags) {
@flag.Item.Name (@flag.Count.ToString("N0") @scope@(flag.Count == 1 ? null : "s"))
}
@Html.AntiForgeryToken() }
} @if (Model.DeviceProfiles.Any(b => b.Count > 0)) {
@if (userModel != null) {
Add all users associated with a device in the selected profile
} @if (deviceModel != null) {
Add all devices in the selected profile
}
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerateAddDeviceProfile())) {
@foreach (var profile in Model.DeviceProfiles) {
@profile.Item.Name (@profile.Count.ToString("N0") @scope@(profile.Count == 1 ? null : "s"))
}
@Html.AntiForgeryToken() }
} @if (Model.DeviceBatches.Any(b => b.Count > 0)) {
@if (userModel != null) {
Add all users associated with a device in the selected batch
} @if (deviceModel != null) {
Add all devices in the selected batch
}
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerateAddDeviceBatch())) {
@foreach (var batch in Model.DeviceBatches) {
@batch.Item.Name (@batch.Count.ToString("N0") @scope@(batch.Count == 1 ? null : "s"))
}
@Html.AntiForgeryToken() }
} @if (Model.DocumentTemplates.Any(b => b.Count > 0)) {
@if (userModel != null) {
Add all users associated with an attachment of the selected document template
} @if (deviceModel != null) {
Add all devices associated with an attachment of the selected document template
})
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerateAddDocumentAttachment())) {
@foreach (var template in Model.DocumentTemplates) {
@template.Item.Id: @template.Item.Description (@template.Count.ToString("N0") @scope@(template.Count == 1 ? null : "s"))
}
@Html.AntiForgeryToken() }
} @if (Model.UserDetails.Any(b => b.Count > 0)) {
@if (userModel != null) {
Add all users with a matching user detail
} @if (deviceModel != null) {
Add all devices assigned to users with a matching user detail
}
@using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerateAddUserDetail())) {
@foreach (var key in Model.UserDetails) {
@key.Item.TrimEnd('*', '&') (@key.Count.ToString("N0") @scope@(key.Count == 1 ? null : "s"))
}
@Html.AntiForgeryToken() } @using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerateGetUserDetailValues())) {
@Html.AntiForgeryToken() }
}