initial source commit

This commit is contained in:
Gary Sharp
2013-02-01 12:35:28 +11:00
parent 543a005d31
commit 0a93429800
1103 changed files with 285609 additions and 0 deletions
+114
View File
@@ -0,0 +1,114 @@
@model Disco.Web.Models.Device.AddOfflineModel
@{
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Add Offline");
}
@using (Html.BeginForm())
{
@Html.ValidationSummary(true)
<div class="form" style="width: 450px">
<table>
<tr>
<th>
Serial Number:
</th>
<td>
@Html.TextBoxFor(model => model.Device.SerialNumber)<br />
@Html.ValidationMessageFor(model => model.Device.SerialNumber)
</td>
</tr>
<tr>
<th>
Asset Number:
</th>
<td>@Html.TextBoxFor(model => model.Device.AssetNumber)<br />
@Html.ValidationMessageFor(model => model.Device.AssetNumber)
</td>
</tr>
<tr>
<th>
Location:
</th>
<td>@Html.TextBoxFor(model => model.Device.Location)<br />
@Html.ValidationMessageFor(model => model.Device.Location)
</td>
</tr>
<tr>
<th>
Device Batch:
</th>
<td>
@Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches) <br />
@Html.ValidationMessageFor(model => model.Device.DeviceBatchId)
</td>
</tr>
<tr>
<th>
Device Profile:
</th>
<td>
@Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId))<br />
@Html.ValidationMessageFor(model => model.Device.DeviceProfileId)
</td>
</tr>
<tr>
<th>
Assigned User:
</th>
<td>
@Html.TextBoxFor(model => model.Device.AssignedUserId)<br />
@Html.ValidationMessageFor(model => model.Device.AssignedUserId)
</td>
</tr>
</table>
<p class="actions">
<input type="submit" class="button" value="Add" />
</p>
<script type="text/javascript">
$(function () {
$SerialNumber = $('#Device_SerialNumber');
$AssetNumber = $('#Device_AssetNumber');
$Location = $('#Device_Location');
$AssignedUserId = $('#Device_AssignedUserId');
$SerialNumber.focus().keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssetNumber.keydown(function (e) {
if (e.which == 13) {
$Location.focus();
return false;
}
});
$Location.keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssignedUserId
.watermark('Search Users')
.focus(function () { $AssignedUserId.select() })
.autocomplete({
source: '@(Url.Action(MVC.API.User.UpstreamUsers()))',
minLength: 2,
focus: function (e, ui) {
$AssignedUserId.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
},
select: function (e, ui) {
$AssignedUserId.val(ui.item.Id).blur();
return false;
}
}).data('autocomplete')._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
.appendTo(ul);
};
});
</script>
</div>
}
@@ -0,0 +1,304 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Device
{
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.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/AddOffline.cshtml")]
public class AddOffline : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.AddOfflineModel>
{
public AddOffline()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Device\AddOffline.cshtml"
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Add Offline");
#line default
#line hidden
WriteLiteral("\r\n");
#line 5 "..\..\Views\Device\AddOffline.cshtml"
using (Html.BeginForm())
{
#line default
#line hidden
#line 7 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 7 "..\..\Views\Device\AddOffline.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 450px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n S" +
"erial Number:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 15 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.SerialNumber));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 16 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.SerialNumber));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Asset Number:\r\n </th>\r\n <td" +
">");
#line 23 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.AssetNumber));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 24 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.AssetNumber));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Location:\r\n </th>\r\n <td>");
#line 31 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.Location));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 32 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.Location));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Batch:\r\n </th>\r\n <td" +
">\r\n");
WriteLiteral(" ");
#line 40 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.DropDownListFor(model => model.Device.DeviceBatchId, Model.DeviceBatches));
#line default
#line hidden
WriteLiteral(" <br />\r\n");
WriteLiteral(" ");
#line 41 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.DeviceBatchId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Profile:\r\n </th>\r\n <" +
"td>\r\n");
WriteLiteral(" ");
#line 49 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.DropDownListFor(model => model.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.DefaultDeviceProfileId)));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 50 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.DeviceProfileId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Assigned User:\r\n </th>\r\n <t" +
"d>\r\n");
WriteLiteral(" ");
#line 58 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.TextBoxFor(model => model.Device.AssignedUserId));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 59 "..\..\Views\Device\AddOffline.cshtml"
Write(Html.ValidationMessageFor(model => model.Device.AssignedUserId));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n <p");
WriteLiteral(" class=\"actions\"");
WriteLiteral(">\r\n <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Add\"");
WriteLiteral(" />\r\n </p>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$SerialNumber = $('#Device_SerialNumber');
$AssetNumber = $('#Device_AssetNumber');
$Location = $('#Device_Location');
$AssignedUserId = $('#Device_AssignedUserId');
$SerialNumber.focus().keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssetNumber.keydown(function (e) {
if (e.which == 13) {
$Location.focus();
return false;
}
});
$Location.keydown(function (e) {
if (e.which == 13) {
$AssignedUserId.focus();
return false;
}
});
$AssignedUserId
.watermark('Search Users')
.focus(function () { $AssignedUserId.select() })
.autocomplete({
source: '");
#line 95 "..\..\Views\Device\AddOffline.cshtml"
Write(Url.Action(MVC.API.User.UpstreamUsers()));
#line default
#line hidden
WriteLiteral(@"',
minLength: 2,
focus: function (e, ui) {
$AssignedUserId.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
},
select: function (e, ui) {
$AssignedUserId.val(ui.item.Id).blur();
return false;
}
}).data('autocomplete')._renderItem = function (ul, item) {
return $(""<li></li>"")
.data(""item.autocomplete"", item)
.append(""<a><strong>"" + item.DisplayName + ""</strong><br>"" + item.Id + "" ("" + item.Type + "")</a>"")
.appendTo(ul);
};
});
</script>
</div>
");
#line 114 "..\..\Views\Device\AddOffline.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,193 @@
@model Disco.Web.Models.Device.ShowModel
@{
Html.BundleDeferred("~/Style/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
}
<table id="deviceShowResources">
<tr>
<td id="Attachments">
<div class="attachmentOutput">
@if (Model.Device.DeviceAttachments != null)
{
foreach (var da in Model.Device.DeviceAttachments)
{
<a href="@Url.Action(MVC.API.Device.AttachmentDownload(da.Id))" data-attachmentid="@da.Id" data-mimetype="@da.MimeType">
<span class="icon" title="@da.Filename">
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id)))" /></span>
<span class="comments" title="@da.Comments">
@{if (!string.IsNullOrEmpty(da.DocumentTemplateId))
{ @da.DocumentTemplate.Description}
else
{ @da.Comments }}
</span><span class="author">@da.TechUser.ToString()</span><span class="remove"></span><span class="timestamp" title="@da.Timestamp.ToFullDateTime()">@da.Timestamp.ToFuzzy()</span>
</a>
}
}
</div>
<div class="attachmentInput clearfix">
<span class="action upload"></span><span class="action photo"></span>
</div>
<script type="text/javascript">
Shadowbox.init({
skipSetup: true,
modal: true
});
$(function () {
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
document.DiscoFunctions.addAttachment = addAttachment;
$Attachments = $('#Attachments');
$attachmentOutput = $Attachments.find('.attachmentOutput');
$attachmentOutput.find('span.remove').click(removeAttachment);
$('#dialogUpload').dialog({ autoOpen: false,
draggable: false,
modal: true,
resizable: false,
width: 860,
height: 550,
close: function () {
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
}
});
$('#dialogRemoveAttachment').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
var onLoadNavigation = null;
var isLoaded = null;
Silverlight.createObject(
'@(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap)',
$('#silverlightHostUploadAttachment').get(0),
'silverlightUploadAttachment',
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
{ onLoad: function () {
if (onLoadNavigation) {
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
isLoaded = true;
}
}
},
'UploadUrl=@(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)))'
);
$attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.photo').click(function () {
showDialog('/WebCam');
});
$attachmentInput.find('.upload').click(function () {
showDialog('/File');
});
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
function showDialog(navigationPath) {
$('#dialogUpload').dialog('open');
if (isLoaded) {
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
} else {
onLoadNavigation = navigationPath;
}
};
function addAttachment(id, quick) {
var data = { id: id };
$.ajax({
url: '@Url.Action(MVC.API.Device.Attachment())',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
var a = d.Attachment;
var e = $('<a><span class="icon"><img alt="Attachment Thumbnail" /></span><span class="comments"></span><span class="author"></span><span class="remove"></span><span class="timestamp"></span></a>');
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.Device.AttachmentDownload()))/' + a.Id);
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.Device.AttachmentThumbnail()))/' + a.Id);
e.find('.comments').text(a.Comments);
e.find('.author').text(a.Author);
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
e.find('.remove').click(removeAttachment);
if (!quick)
e.hide();
$attachmentOutput.append(e);
if (!quick)
e.show('slow');
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
} else {
alert('Unable to add attachment: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add attachment: ' + textStatus);
}
});
}
function removeAttachment() {
$this = $(this).closest('a');
var data = { id: $this.attr('data-attachmentid') };
var $dialogRemoveAttachment = $('#dialogRemoveAttachment');
$dialogRemoveAttachment.dialog("enable");
$dialogRemoveAttachment.dialog('option', 'buttons', {
"Remove": function () {
$dialogRemoveAttachment.dialog("disable");
$dialogRemoveAttachment.dialog("option", "buttons", null);
$.ajax({
url: '@Url.Action(MVC.API.Device.AttachmentRemove())',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$this.hide(300).delay(300).queue(function () {
var $this = $(this);
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
Shadowbox.removeCache(this);
$this.remove();
});
} else {
alert('Unable to remove attachment: ' + d);
}
$dialogRemoveAttachment.dialog("close");
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to remove attachment: ' + textStatus);
$dialogRemoveAttachment.dialog("close");
}
});
},
"Cancel": function () {
$dialogRemoveAttachment.dialog("close");
}
});
$dialogRemoveAttachment.dialog('open');
return false;
}
$attachmentOutput.children('a').each(function () {
$this = $(this);
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
});
});
</script>
</td>
</tr>
</table>
<div id="dialogUpload" title="Upload Attachment">
<div id="silverlightHostUploadAttachment">
</div>
</div>
<div id="dialogRemoveAttachment" title="Remove this Attachment?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?</p>
</div>
@@ -0,0 +1,480 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Device.DeviceParts
{
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.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/Resources.cshtml")]
public class Resources : System.Web.Mvc.WebViewPage<Disco.Web.Models.Device.ShowModel>
{
public Resources()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Html.BundleDeferred("~/Style/Shadowbox");
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
#line default
#line hidden
WriteLiteral("\r\n<table");
WriteLiteral(" id=\"deviceShowResources\"");
WriteLiteral(">\r\n <tr>\r\n <td");
WriteLiteral(" id=\"Attachments\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" class=\"attachmentOutput\"");
WriteLiteral(">\r\n");
#line 10 "..\..\Views\Device\DeviceParts\Resources.cshtml"
#line default
#line hidden
#line 10 "..\..\Views\Device\DeviceParts\Resources.cshtml"
if (Model.Device.DeviceAttachments != null)
{
foreach (var da in Model.Device.DeviceAttachments)
{
#line default
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 476), Tuple.Create("\"", 536)
#line 14 "..\..\Views\Device\DeviceParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 483), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentDownload(da.Id))
#line default
#line hidden
, 483), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 14 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(da.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 14 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(da.MimeType);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 638), Tuple.Create("\"", 658)
#line 15 "..\..\Views\Device\DeviceParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 646), Tuple.Create<System.Object, System.Int32>(da.Filename
#line default
#line hidden
, 646), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 721), Tuple.Create("\"", 783)
#line 16 "..\..\Views\Device\DeviceParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 727), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.AttachmentThumbnail(da.Id))
#line default
#line hidden
, 727), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 842), Tuple.Create("\"", 862)
#line 17 "..\..\Views\Device\DeviceParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 850), Tuple.Create<System.Object, System.Int32>(da.Comments
#line default
#line hidden
, 850), false)
);
WriteLiteral(">\r\n");
#line 18 "..\..\Views\Device\DeviceParts\Resources.cshtml"
#line default
#line hidden
#line 18 "..\..\Views\Device\DeviceParts\Resources.cshtml"
if (!string.IsNullOrEmpty(da.DocumentTemplateId))
{
#line default
#line hidden
#line 19 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(da.DocumentTemplate.Description);
#line default
#line hidden
#line 19 "..\..\Views\Device\DeviceParts\Resources.cshtml"
}
else
{
#line default
#line hidden
#line 21 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(da.Comments);
#line default
#line hidden
#line 21 "..\..\Views\Device\DeviceParts\Resources.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n </span><span");
WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 22 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(da.TechUser.ToString());
#line default
#line hidden
WriteLiteral("</span><span");
WriteLiteral(" class=\"remove\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"timestamp\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1232), Tuple.Create("\"", 1270)
#line 22 "..\..\Views\Device\DeviceParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1240), Tuple.Create<System.Object, System.Int32>(da.Timestamp.ToFullDateTime()
#line default
#line hidden
, 1240), false)
);
WriteLiteral(">");
#line 22 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(da.Timestamp.ToFuzzy());
#line default
#line hidden
WriteLiteral("</span>\r\n </a> \r\n");
#line 24 "..\..\Views\Device\DeviceParts\Resources.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <div");
WriteLiteral(" class=\"attachmentInput clearfix\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"action upload\"");
WriteLiteral("></span><span");
WriteLiteral(" class=\"action photo\"");
WriteLiteral("></span>\r\n </div>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
Shadowbox.init({
skipSetup: true,
modal: true
});
$(function () {
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
document.DiscoFunctions.addAttachment = addAttachment;
$Attachments = $('#Attachments');
$attachmentOutput = $Attachments.find('.attachmentOutput');
$attachmentOutput.find('span.remove').click(removeAttachment);
$('#dialogUpload').dialog({ autoOpen: false,
draggable: false,
modal: true,
resizable: false,
width: 860,
height: 550,
close: function () {
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
}
});
$('#dialogRemoveAttachment').dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false
});
var onLoadNavigation = null;
var isLoaded = null;
Silverlight.createObject(
'");
#line 67 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
#line default
#line hidden
WriteLiteral(@"',
$('#silverlightHostUploadAttachment').get(0),
'silverlightUploadAttachment',
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
{ onLoad: function () {
if (onLoadNavigation) {
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
isLoaded = true;
}
}
},
'UploadUrl=");
#line 78 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentUpload(Model.Device.SerialNumber, null)));
#line default
#line hidden
WriteLiteral(@"'
);
$attachmentInput = $Attachments.find('.attachmentInput');
$attachmentInput.find('.photo').click(function () {
showDialog('/WebCam');
});
$attachmentInput.find('.upload').click(function () {
showDialog('/File');
});
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
function showDialog(navigationPath) {
$('#dialogUpload').dialog('open');
if (isLoaded) {
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
} else {
onLoadNavigation = navigationPath;
}
};
function addAttachment(id, quick) {
var data = { id: id };
$.ajax({
url: '");
#line 101 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(Url.Action(MVC.API.Device.Attachment()));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
if (d.Result == 'OK') {
var a = d.Attachment;
var e = $('<a><span class=""icon""><img alt=""Attachment Thumbnail"" /></span><span class=""comments""></span><span class=""author""></span><span class=""remove""></span><span class=""timestamp""></span></a>');
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
#line 110 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentDownload()));
#line default
#line hidden
WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', " +
"\'");
#line 111 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentThumbnail()));
#line default
#line hidden
WriteLiteral("/\' + a.Id);\r\n e.find(\'.comments\').text(a.Comme" +
"nts);\r\n e.find(\'.author\').text(a.Author);\r\n " +
" e.find(\'.timestamp\').text(a.TimestampFuzzy).at" +
"tr(\'title\', a.TimestampFull);\r\n e.find(\'.remo" +
"ve\').click(removeAttachment);\r\n if (!quick)\r\n" +
" e.hide();\r\n " +
" $attachmentOutput.append(e);\r\n if (!qu" +
"ick)\r\n e.show(\'slow\');\r\n " +
" if (a.MimeType.toLowerCase().indexOf(\'image/\') == 0)\r\n " +
" e.shadowbox({ gallery: \'attachments\', player: \'" +
"img\', title: a.Comments });\r\n } else {\r\n " +
" alert(\'Unable to add attachment: \' + d.Result);\r\n " +
" }\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to add attachment: \' + textStatus);\r\n " +
" }\r\n });\r\n }\r\n " +
" function removeAttachment() {\r\n $this = $(this)." +
"closest(\'a\');\r\n\r\n var data = { id: $this.attr(\'data-attac" +
"hmentid\') };\r\n var $dialogRemoveAttachment = $(\'#dialogRe" +
"moveAttachment\');\r\n $dialogRemoveAttachment.dialog(\"enabl" +
"e\");\r\n $dialogRemoveAttachment.dialog(\'option\', \'buttons\'" +
", {\r\n \"Remove\": function () {\r\n " +
" $dialogRemoveAttachment.dialog(\"disable\");\r\n " +
" $dialogRemoveAttachment.dialog(\"option\", \"buttons\", null);\r\n " +
" $.ajax({\r\n url: \'");
#line 143 "..\..\Views\Device\DeviceParts\Resources.cshtml"
Write(Url.Action(MVC.API.Device.AttachmentRemove()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n " +
" data: data,\r\n success: function" +
" (d) {\r\n if (d == \'OK\') {\r\n " +
" $this.hide(300).delay(300).queue(function () {\r\n " +
" var $this = $(this);\r\n " +
" if ($this.attr(\'data-mimetype\').toLowerCase(" +
").indexOf(\'image/\') == 0)\r\n S" +
"hadowbox.removeCache(this);\r\n $th" +
"is.remove();\r\n });\r\n " +
" } else {\r\n ale" +
"rt(\'Unable to remove attachment: \' + d);\r\n " +
" }\r\n $dialogRemoveAttachment.dialog(\"clo" +
"se\");\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to remove attachment: \' + textStatus);\r\n " +
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
" }\r\n });\r\n " +
" },\r\n \"Cancel\": function () {\r\n " +
" $dialogRemoveAttachment.dialog(\"close\");\r\n " +
" }\r\n });\r\n\r\n $dialogR" +
"emoveAttachment.dialog(\'open\');\r\n \r\n " +
" return false;\r\n }\r\n\r\n $attachmentOutput" +
".children(\'a\').each(function () {\r\n $this = $(this);\r\n " +
" if ($this.attr(\'data-mimetype\').toLowerCase().indexOf(\'imag" +
"e/\') == 0)\r\n $this.shadowbox({ gallery: \'attachments\'" +
", player: \'img\', title: $this.find(\'.comments\').text() });\r\n " +
"});\r\n });\r\n </script>\r\n </td>\r\n </tr>\r\n</tab" +
"le>\r\n<div");
WriteLiteral(" id=\"dialogUpload\"");
WriteLiteral(" title=\"Upload Attachment\"");
WriteLiteral(">\r\n <div");
WriteLiteral(" id=\"silverlightHostUploadAttachment\"");
WriteLiteral(">\r\n </div>\r\n</div>\r\n<div");
WriteLiteral(" id=\"dialogRemoveAttachment\"");
WriteLiteral(" title=\"Remove this Attachment?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n Are you sure?</p>\r\n</div>");
}
}
}
#pragma warning restore 1591
+9
View File
@@ -0,0 +1,9 @@
@{
ViewBag.Title = "Devices";
}
<h3>
Search for a Device</h3>
@Html.Partial(MVC.Shared.Views._SearchDialog, "devices")
<div class="actionBar">
@Html.ActionLinkButton("Add Offline Device", MVC.Device.AddOffline())
</div>
+80
View File
@@ -0,0 +1,80 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Device
{
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.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/Index.cshtml")]
public class Index : System.Web.Mvc.WebViewPage<dynamic>
{
public Index()
{
}
public override void Execute()
{
#line 1 "..\..\Views\Device\Index.cshtml"
ViewBag.Title = "Devices";
#line default
#line hidden
WriteLiteral("\r\n<h3>\r\n Search for a Device</h3>\r\n");
#line 6 "..\..\Views\Device\Index.cshtml"
Write(Html.Partial(MVC.Shared.Views._SearchDialog, "devices"));
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 8 "..\..\Views\Device\Index.cshtml"
Write(Html.ActionLinkButton("Add Offline Device", MVC.Device.AddOffline()));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
}
}
}
#pragma warning restore 1591
+467
View File
@@ -0,0 +1,467 @@
@model Disco.Web.Models.Device.ShowModel
@{
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), string.Format("{0} ({1})", Model.Device.ComputerName, Model.Device.SerialNumber));
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
}
<table class="deviceShow">
<tr>
<td class="details">
<table>
<tr>
<th class="name">
Computer Name:
</th>
<td class="value">
@if (string.IsNullOrWhiteSpace(Model.Device.ComputerName))
{
<span class="smallMessage">&lt;Unknown/Not Allocated&gt;</span>
}
else
{
@Model.Device.ComputerName
}
</td>
</tr>
<tr>
<th class="name">
Asset Number:
</th>
<td class="value">
@Html.TextBoxFor(m => m.Device.AssetNumber)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $ajaxSave = $('#Device_AssetNumber').next('.ajaxSave');
$('#Device_AssetNumber').watermark('Asset Number').keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).change(function () {
var $this = $(this);
$ajaxSave.hide();
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { AssetNumber: $this.val() };
$.getJSON('@(Url.Action(@MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Asset Number:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
}).blur(function () {
$ajaxSave.hide();
}).focus(function () {
$(this).select();
});
});
</script>
</td>
</tr>
<tr>
<th class="name">
Location:
</th>
<td class="value">
@Html.TextBoxFor(m => m.Device.Location)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
var $ajaxSave = $('#Device_Location').next('.ajaxSave');
$('#Device_Location').watermark('Location').keydown(function (e) {
$ajaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).change(function () {
var $this = $(this);
$ajaxSave.hide();
var $ajaxLoading = $ajaxSave.next('.ajaxLoading').show();
var data = { Location: $this.val() };
$.getJSON('@(Url.Action(@MVC.API.Device.UpdateLocation(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Location:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
}).blur(function () {
$ajaxSave.hide();
}).focus(function () {
$(this).select();
});
});
</script>
</td>
</tr>
<tr>
<th class="name">
Batch:
</th>
<td class="value">
@Html.DropDownListFor(m => m.Device.DeviceBatchId, Model.DeviceBatches)
@AjaxHelpers.AjaxLoader() <span id="deviceBatchEdit" class="icon16" title="Edit">
</span>
<script type="text/javascript">
$(function () {
var $DeviceBatchId = $('#Device_DeviceBatchId');
var $DeviceBatchDetails = $('#deviceBatchDetails');
var $DeviceBatchEdit = $('#deviceBatchEdit');
var jsonDate = function (json, unknownValue) {
if (json && json.indexOf('') == 0) {
return $.datepicker.formatDate('yy-mm-dd', new Date(parseInt(json.substr(6, json.length - 8))));
} else
return unknownValue;
}
var updateDetails = function (deviceBatchId) {
$.getJSON('@(Url.Action(MVC.API.DeviceBatch.Index()))/' + deviceBatchId, function (response, result) {
if (result == 'success') {
if (response.Supplier)
$DeviceBatchDetails.find('.supplier').text(response.Supplier);
else
$DeviceBatchDetails.find('.supplier').text('Unknown');
$DeviceBatchDetails.find('.purchaseDate').text(jsonDate(response.PurchaseDate, 'Unknown'));
$DeviceBatchDetails.find('.warrantyValidUntil').text(jsonDate(response.WarrantyValidUntil, 'Unknown'));
if (response.InsuranceSupplier)
$DeviceBatchDetails.find('.insuranceSupplier').text(response.InsuranceSupplier);
else
$DeviceBatchDetails.find('.insuranceSupplier').text('Unknown');
$DeviceBatchDetails.find('.insuredUntil').text(jsonDate(response.InsuredUntil, 'Unknown'));
$DeviceBatchDetails.slideDown('fast');
$DeviceBatchEdit.fadeIn();
} else {
alert('Unable to load Device Batch details:\n' + response);
}
});
};
$DeviceBatchEdit.click(function () {
window.location.href = '@(Url.Action(MVC.Config.DeviceBatch.Index(null)))/' + $DeviceBatchId.val();
});
$DeviceBatchId.change(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
$DeviceBatchDetails.hide();
$DeviceBatchEdit.hide();
var data = { DeviceBatchId: $this.val() };
$.getJSON('@(Url.Action(MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Device Batch:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
if ($DeviceBatchId.val())
updateDetails($DeviceBatchId.val());
}
});
});
$DeviceBatchEdit.hide();
if ($DeviceBatchId.val())
updateDetails($DeviceBatchId.val());
});
</script>
<div id="deviceBatchDetails">
<table class="sub">
<tr>
<th style="width: 50px">
<strong>Purchased:</strong>
</th>
<td>
Supplier: <span class="supplier"></span>
<br />
On: <span class="purchaseDate"></span>
</td>
<th style="width: 50px">
<strong>Warranty:</strong>
</th>
<td>
Valid Until: <span class="warrantyValidUntil"></span>
</td>
<th style="width: 50px">
<strong>Insurance:</strong>
</th>
<td>
Supplier: <span class="insuranceSupplier"></span>
<br />
Until: <span class="insuredUntil"></span>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<th class="name">
Profile:
</th>
<td class="value">
@if (Model.Device.DecommissionedDate.HasValue)
{
@Model.Device.DeviceProfile.ToString()
}
else
{
@Html.DropDownListFor(m => m.Device.DeviceProfileId, Model.DeviceProfiles.ToSelectListItems(Model.Device.DeviceProfile))
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () {
$('#Device_DeviceProfileId').change(function () {
var $this = $(this);
var $ajaxLoading = $this.next('.ajaxLoading').show();
var data = { DeviceProfileId: $this.val() };
$.getJSON('@(Url.Action(MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Device Profile:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
});
});
});
</script>
}
</td>
</tr>
<tr>
<th class="name">
Created:
</th>
<td class="value">
@CommonHelpers.FriendlyDate(Model.Device.CreatedDate)
</td>
</tr>
<tr>
<th class="name">
Enrolment:
</th>
<td class="value">
First:
@CommonHelpers.FriendlyDate(Model.Device.EnrolledDate)
@if (Model.Device.AllowUnauthenticatedEnrol)
{
<a class="unlocked16" href="@Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "false", true))" title="Unauthenticated Enrolment is Allowed">
&nbsp;</a>
}
else
{
<a class="locked16" href="@Url.Action(MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, "true", true))" title="Unauthenticated Enrolment is Blocked">
&nbsp;</a>
}
<br />
Last:
@CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate)
</td>
</tr>
<tr>
<th class="name">
Decommissioned:
</th>
<td class="value">
@CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate)
</td>
</tr>
<tr>
<th class="name">
Last Network Logon:
</th>
<td class="value">
<span id="lastNetworkLogonDate" class="nowrap">@CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate)</span>
@if (!string.IsNullOrEmpty(Model.Device.ComputerName))
{
<script type="text/javascript">
$(function () {
var span = $('#lastNetworkLogonDate');
$('<span>').addClass('ajaxHelperIcon ajaxLoading ajaxShowInitially').attr('title', 'Loading...').appendTo(span);
$.getJSON('@(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber)))', function (response, result) {
if (result != 'success') {
alert('Unable to retrieve latest network logon date:\n' + response);
$('<span>').addClass('smallMessage').text('[may not be current]').appendTo(span);
} else {
span.find('.ajaxLoading').hide();
span.attr('title', response.Formatted).text(response.Friendly);
}
});
});
</script>
}
</td>
</tr>
@if (!Model.Device.DecommissionedDate.HasValue)
{
<tr>
<th class="name">
Assigned User:
</th>
<td class="value">
@Html.TextBoxFor(m => m.Device.AssignedUser, new { userId = Model.Device.AssignedUserId })
@AjaxHelpers.AjaxRemove()
@AjaxHelpers.AjaxLoader()
<br />
<a href="#" id="Device_AssignedUser_History_Trigger" class="smallLink">Show Assignment
History (<span id="Device_AssignedUser_History_RecordCount"></span>)</a> <span id="Device_AssignedUser_History_None"
class="smallMessage" style="display: none">No Assignment History Available</span>
<div id="dialogRemoveAssignedUser" title="Remove this Device Assignment?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
// Common Objects
var $assignedUser = $('#Device_AssignedUser');
var $ajaxLoading = $assignedUser.nextAll('.ajaxLoading').first();
var $ajaxRemove = $assignedUser.nextAll('.ajaxRemove').first();
// Assign User
$assignedUser
.watermark('No Assigned User')
.focus(function () { $assignedUser.select() })
.autocomplete({
source: '@(Url.Action(MVC.API.User.UpstreamUsers()))',
minLength: 2,
focus: function (e, ui) {
$assignedUser.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
},
select: function (e, ui) {
updateAssignedUser(ui.item.Id);
$assignedUser.val(ui.item.DisplayName + ' (' + ui.item.Id + ')');
return false;
}
})
.data('autocomplete')._renderItem = function (ul, item) {
return $("<li></li>")
.data("item.autocomplete", item)
.append("<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
.appendTo(ul);
};
var $dialogRemoveAssignedUser = $('#dialogRemoveAssignedUser');
$dialogRemoveAssignedUser.dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Remove": function () {
updateAssignedUser('');
$assignedUser.val('');
$dialogRemoveAssignedUser.dialog("close");
},
"Cancel": function () {
$dialogRemoveAssignedUser.dialog("close");
}
}
});
// Un-Assign User
if ($assignedUser.val() != '')
$ajaxRemove.show();
$ajaxRemove.click(function () {
$dialogRemoveAssignedUser.dialog('open');
return false;
});
// History
var deviceUserAssignmentCount = @(Model.Device.DeviceUserAssignments.Count);
if (deviceUserAssignmentCount > 0) {
$('#Device_AssignedUser_History_Trigger').click(function () {
$(this).hide();
$('#Device_AssignedUser_History_Host').show();
$('#Device_AssignedUser_History').slideDown('slow');
return false;
});
var recordCountText = deviceUserAssignmentCount + ' record';
if (deviceUserAssignmentCount != 1)
recordCountText += 's';
$('#Device_AssignedUser_History_RecordCount').text(recordCountText)
}
else {
$('#Device_AssignedUser_History_Trigger').hide();
$('#Device_AssignedUser_History_None').show();
};
function updateAssignedUser(userId) {
$ajaxLoading.show();
$ajaxRemove.hide();
var data = { AssignedUserId: userId };
$.getJSON('@(Url.Action(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Assigned User:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
if (userId != '')
$ajaxRemove.fadeIn('fast');
}
});
}
});
</script>
</td>
</tr>
}
<tr id="Device_AssignedUser_History_Host" style="@(Model.Device.DecommissionedDate.HasValue ? "" : "display: none")">
<td colspan="2">
<div id="Device_AssignedUser_History" style="@(Model.Device.DecommissionedDate.HasValue ? "" : "display: none")">
<h2>
Assigned User History</h2>
@Html.Partial(MVC.Device.Views._DeviceUserAssignmentHistoryTable, Model.Device)
</div>
</td>
</tr>
<tr>
<th class="name">
Generate Documents:
</th>
<td class="value" colspan="3">
@Html.DropDownList("DocumentTemplates", Model.DocumentTemplatesSelectListItems)
<script type="text/javascript">
$(function () {
var generatePdfUrl = '@Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber, null))?DocumentTemplateId=';
var $documentTemplates = $('#DocumentTemplates');
$documentTemplates.change(function () {
var v = $documentTemplates.val();
if (v) {
window.location.href = generatePdfUrl + v;
$documentTemplates.val('');
}
});
});
</script>
</td>
</tr>
</table>
</td>
<td class="model">
<table>
<tr>
<td class="subtleHighlight">
<img alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))" />
<h2>
<a href="@(Url.Action(MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)))">@Model.Device.DeviceModel.ToString()</a></h2>
</td>
</tr>
</table>
</td>
</tr>
</table>
<h2>
Certificates</h2>
@Html.Partial(MVC.Device.Views._CertificateTable, Model.Certificates)
<h2>
Attachments</h2>
@Html.Partial(MVC.Device.Views.DeviceParts.Resources, Model)
<h2>
Jobs</h2>
@Html.Partial(MVC.Shared.Views._JobTable, Model.Jobs)
@Html.Partial(MVC.Device.Views._DeviceActions, Model.Device)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,43 @@
@model IEnumerable<Disco.Models.Repository.DeviceCertificate>
<div class="genericData certificateTable">
@if (Model.Count() > 0)
{
<table class="genericData certificateTable">
<tr>
<th>
Name
</th>
<th>
Enabled
</th>
<th>
Allocated
</th>
<th>
Expires
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.ActionLink(item.Name, MVC.API.WirelessCertificate.Download(item.Id))
</td>
<td>
@item.Enabled
</td>
<td>
@CommonHelpers.FriendlyDate(item.AllocatedDate)
</td>
<td>
@CommonHelpers.FriendlyDate(item.ExpirationDate)
</td>
</tr>
}
</table>
}
else
{
<span class="smallMessage">No Certificates Allocated</span>
}
</div>
@@ -0,0 +1,180 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Device
{
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.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_CertificateTable.cshtml")]
public class CertificateTable : System.Web.Mvc.WebViewPage<IEnumerable<Disco.Models.Repository.DeviceCertificate>>
{
public CertificateTable()
{
}
public override void Execute()
{
WriteLiteral("<div");
WriteLiteral(" class=\"genericData certificateTable\"");
WriteLiteral(">\r\n");
#line 3 "..\..\Views\Device\_CertificateTable.cshtml"
#line default
#line hidden
#line 3 "..\..\Views\Device\_CertificateTable.cshtml"
if (Model.Count() > 0)
{
#line default
#line hidden
WriteLiteral(" <table");
WriteLiteral(" class=\"genericData certificateTable\"");
WriteLiteral(@">
<tr>
<th>
Name
</th>
<th>
Enabled
</th>
<th>
Allocated
</th>
<th>
Expires
</th>
</tr>
");
#line 20 "..\..\Views\Device\_CertificateTable.cshtml"
#line default
#line hidden
#line 20 "..\..\Views\Device\_CertificateTable.cshtml"
foreach (var item in Model)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
#line 24 "..\..\Views\Device\_CertificateTable.cshtml"
Write(Html.ActionLink(item.Name, MVC.API.WirelessCertificate.Download(item.Id)));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 27 "..\..\Views\Device\_CertificateTable.cshtml"
Write(item.Enabled);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 30 "..\..\Views\Device\_CertificateTable.cshtml"
Write(CommonHelpers.FriendlyDate(item.AllocatedDate));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 33 "..\..\Views\Device\_CertificateTable.cshtml"
Write(CommonHelpers.FriendlyDate(item.ExpirationDate));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 36 "..\..\Views\Device\_CertificateTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n");
#line 38 "..\..\Views\Device\_CertificateTable.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Certificates Allocated</span>\r\n");
#line 42 "..\..\Views\Device\_CertificateTable.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,124 @@
@model Disco.Models.Repository.Device
<div class="actionBar">
@if (Model.CanDecommission())
{
@Html.ActionLinkButton("Decommission", MVC.API.Device.Decommission(Model.SerialNumber, true), "buttonDeviceDecommission")
<div id="dialogConfirmDecommission" title="Decommission this Device?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
var button = $('#buttonDeviceDecommission');
var buttonDialog = $('#dialogConfirmDecommission');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Decommission": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
</script>
}
@if (Model.CanRecommission())
{
@Html.ActionLinkButton("Recommission", MVC.API.Device.Recommission(Model.SerialNumber, true), "buttonDeviceRecommission")
<div id="dialogConfirmRecommission" title="Recommission this Device?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
var button = $('#buttonDeviceRecommission');
var buttonDialog = $('#dialogConfirmRecommission');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
"Recommission": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
</script>
}
@if (Model.CanDelete())
{
@Html.ActionLinkButton("Delete Device", MVC.API.Device.Delete(Model.SerialNumber, true), "buttonDeviceDelete")
<div id="dialogConfirmDelete" title="Delete this Device?">
<p>
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
This item will be permanently deleted and cannot be recovered.<br />
Jobs linked to this Device (but not to a User) will be deleted also.<br />
Are you sure?</p>
</div>
<script type="text/javascript">
$(function () {
var button = $('#buttonDeviceDelete');
var buttonDialog = $('#dialogConfirmDelete');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
height: 200,
modal: true,
autoOpen: false,
buttons: {
"Delete": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
</script>
}
@if (Model.CanCreateJob())
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
@Html.ActionLinkButton("Create Job", MVC.Job.Create(Model.SerialNumber, Model.AssignedUserId), "buttonCreateJob")
}
</div>
@@ -0,0 +1,326 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Device
{
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.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_DeviceActions.cshtml")]
public class DeviceActions : System.Web.Mvc.WebViewPage<Disco.Models.Repository.Device>
{
public DeviceActions()
{
}
public override void Execute()
{
WriteLiteral("<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 3 "..\..\Views\Device\_DeviceActions.cshtml"
#line default
#line hidden
#line 3 "..\..\Views\Device\_DeviceActions.cshtml"
if (Model.CanDecommission())
{
#line default
#line hidden
#line 5 "..\..\Views\Device\_DeviceActions.cshtml"
Write(Html.ActionLinkButton("Decommission", MVC.API.Device.Decommission(Model.SerialNumber, true), "buttonDeviceDecommission"));
#line default
#line hidden
#line 5 "..\..\Views\Device\_DeviceActions.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"dialogConfirmDecommission\"");
WriteLiteral(" title=\"Decommission this Device?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n Are you sure?</p>\r\n </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var button = $('#buttonDeviceDecommission');
var buttonDialog = $('#dialogConfirmDecommission');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
""Decommission"": function () {
var $this = $(this);
$this.dialog(""disable"");
$this.dialog(""option"", ""buttons"", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog(""close"");
}
}
});
});
</script>
");
#line 40 "..\..\Views\Device\_DeviceActions.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 41 "..\..\Views\Device\_DeviceActions.cshtml"
if (Model.CanRecommission())
{
#line default
#line hidden
#line 43 "..\..\Views\Device\_DeviceActions.cshtml"
Write(Html.ActionLinkButton("Recommission", MVC.API.Device.Recommission(Model.SerialNumber, true), "buttonDeviceRecommission"));
#line default
#line hidden
#line 43 "..\..\Views\Device\_DeviceActions.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"dialogConfirmRecommission\"");
WriteLiteral(" title=\"Recommission this Device?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n Are you sure?</p>\r\n </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var button = $('#buttonDeviceRecommission');
var buttonDialog = $('#dialogConfirmRecommission');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
""Recommission"": function () {
var $this = $(this);
$this.dialog(""disable"");
$this.dialog(""option"", ""buttons"", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog(""close"");
}
}
});
});
</script>
");
#line 78 "..\..\Views\Device\_DeviceActions.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 79 "..\..\Views\Device\_DeviceActions.cshtml"
if (Model.CanDelete())
{
#line default
#line hidden
#line 81 "..\..\Views\Device\_DeviceActions.cshtml"
Write(Html.ActionLinkButton("Delete Device", MVC.API.Device.Delete(Model.SerialNumber, true), "buttonDeviceDelete"));
#line default
#line hidden
#line 81 "..\..\Views\Device\_DeviceActions.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"dialogConfirmDelete\"");
WriteLiteral(" title=\"Delete this Device?\"");
WriteLiteral(">\r\n <p>\r\n <span");
WriteLiteral(" class=\"ui-icon ui-icon-alert\"");
WriteLiteral(" style=\"float: left; margin: 0 7px 20px 0;\"");
WriteLiteral("></span>\r\n This item will be permanently deleted and cannot be rec" +
"overed.<br />\r\n Jobs linked to this Device (but not to a User) wi" +
"ll be deleted also.<br />\r\n Are you sure?</p>\r\n </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var button = $('#buttonDeviceDelete');
var buttonDialog = $('#dialogConfirmDelete');
var buttonLink = button.attr('href');
button.attr('href', '#');
button.click(function () {
buttonDialog.dialog('open');
return false;
});
buttonDialog.dialog({
resizable: false,
height: 200,
modal: true,
autoOpen: false,
buttons: {
""Delete"": function () {
var $this = $(this);
$this.dialog(""disable"");
$this.dialog(""option"", ""buttons"", null);
window.location.href = buttonLink;
},
Cancel: function () {
$(this).dialog(""close"");
}
}
});
});
</script>
");
#line 118 "..\..\Views\Device\_DeviceActions.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
#line 119 "..\..\Views\Device\_DeviceActions.cshtml"
if (Model.CanCreateJob())
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
#line default
#line hidden
#line 122 "..\..\Views\Device\_DeviceActions.cshtml"
Write(Html.ActionLinkButton("Create Job", MVC.Job.Create(Model.SerialNumber, Model.AssignedUserId), "buttonCreateJob"));
#line default
#line hidden
#line 122 "..\..\Views\Device\_DeviceActions.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,89 @@
@model IEnumerable<Disco.Models.BI.Search.DeviceSearchResultItem>
<div class="genericData deviceTable">
@if (Model != null && Model.Count() > 0)
{
<table class="genericData deviceTable">
<thead>
<tr>
<th>
Serial#
</th>
<th>
Asset#
</th>
<th>
Name
</th>
<th>
Model
</th>
<th>
Profile
</th>
<th>
Assigned User
</th>
<th>
Jobs
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr class="@(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty)">
<td>
@Html.ActionLink(item.SerialNumber, MVC.Device.Show(item.SerialNumber))
</td>
<td>
@item.AssetNumber
@if (item.DecommissionedDate.HasValue)
{ <span class="smallMessage">(Decommissioned
@CommonHelpers.FriendlyDate(item.DecommissionedDate.Value))</span> }
</td>
<td>
@if (string.IsNullOrWhiteSpace(item.ComputerName))
{
<span class="smallMessage">Unknown</span>
}
else
{
@item.ComputerName
}
</td>
<td>
@if (item.DeviceModelDescription != null)
{
<span>@item.DeviceModelDescription</span>
}
else
{
<span class="smallMessage">Unknown</span>
}
</td>
<td>
@item.DeviceProfileDescription
</td>
<td>
@if (string.IsNullOrEmpty(item.AssignedUserId))
{
<span class="smallMessage">N/A</span>
}
else
{
<span>@item.AssignedUserDescription</span>
}
</td>
<td>
@item.JobCount
</td>
</tr>
}
</tbody>
</table>
}
else
{
<span class="smallMessage">No Devices Found</span>
}
</div>
@@ -0,0 +1,387 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Device
{
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.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_DeviceTable.cshtml")]
public class DeviceTable : System.Web.Mvc.WebViewPage<IEnumerable<Disco.Models.BI.Search.DeviceSearchResultItem>>
{
public DeviceTable()
{
}
public override void Execute()
{
WriteLiteral("<div");
WriteLiteral(" class=\"genericData deviceTable\"");
WriteLiteral(">\r\n");
#line 3 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 3 "..\..\Views\Device\_DeviceTable.cshtml"
if (Model != null && Model.Count() > 0)
{
#line default
#line hidden
WriteLiteral(" <table");
WriteLiteral(" class=\"genericData deviceTable\"");
WriteLiteral(@">
<thead>
<tr>
<th>
Serial#
</th>
<th>
Asset#
</th>
<th>
Name
</th>
<th>
Model
</th>
<th>
Profile
</th>
<th>
Assigned User
</th>
<th>
Jobs
</th>
</tr>
</thead>
<tbody>
");
#line 32 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 32 "..\..\Views\Device\_DeviceTable.cshtml"
foreach (var item in Model)
{
#line default
#line hidden
WriteLiteral(" <tr");
WriteAttribute("class", Tuple.Create(" class=\"", 1005), Tuple.Create("\"", 1082)
#line 34 "..\..\Views\Device\_DeviceTable.cshtml"
, Tuple.Create(Tuple.Create("", 1013), Tuple.Create<System.Object, System.Int32>(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty
#line default
#line hidden
, 1013), false)
);
WriteLiteral(">\r\n <td>\r\n");
WriteLiteral(" ");
#line 36 "..\..\Views\Device\_DeviceTable.cshtml"
Write(Html.ActionLink(item.SerialNumber, MVC.Device.Show(item.SerialNumber)));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 39 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.AssetNumber);
#line default
#line hidden
WriteLiteral("\r\n");
#line 40 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 40 "..\..\Views\Device\_DeviceTable.cshtml"
if (item.DecommissionedDate.HasValue)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">(Decommissioned\r\n");
WriteLiteral(" ");
#line 42 "..\..\Views\Device\_DeviceTable.cshtml"
Write(CommonHelpers.FriendlyDate(item.DecommissionedDate.Value));
#line default
#line hidden
WriteLiteral(")</span> ");
#line 42 "..\..\Views\Device\_DeviceTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n <td>\r\n");
#line 45 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 45 "..\..\Views\Device\_DeviceTable.cshtml"
if (string.IsNullOrWhiteSpace(item.ComputerName))
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">Unknown</span>\r\n");
#line 48 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
#line default
#line hidden
#line 51 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.ComputerName);
#line default
#line hidden
#line 51 "..\..\Views\Device\_DeviceTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n <td>\r\n");
#line 55 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 55 "..\..\Views\Device\_DeviceTable.cshtml"
if (item.DeviceModelDescription != null)
{
#line default
#line hidden
WriteLiteral(" <span>");
#line 57 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.DeviceModelDescription);
#line default
#line hidden
WriteLiteral("</span>\r\n");
#line 58 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">Unknown</span> \r\n");
#line 62 "..\..\Views\Device\_DeviceTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 65 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.DeviceProfileDescription);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
#line 68 "..\..\Views\Device\_DeviceTable.cshtml"
#line default
#line hidden
#line 68 "..\..\Views\Device\_DeviceTable.cshtml"
if (string.IsNullOrEmpty(item.AssignedUserId))
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">N/A</span> \r\n");
#line 71 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span>");
#line 74 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.AssignedUserDescription);
#line default
#line hidden
WriteLiteral("</span>\r\n");
#line 75 "..\..\Views\Device\_DeviceTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 78 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.JobCount);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 81 "..\..\Views\Device\_DeviceTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </tbody>\r\n </table>\r\n");
#line 84 "..\..\Views\Device\_DeviceTable.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Devices Found</span>\r\n");
#line 88 "..\..\Views\Device\_DeviceTable.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,35 @@
@model Disco.Models.Repository.Device
@if (Model.DeviceUserAssignments.Count > 0)
{
<table class="genericData smallTable">
<tr>
<th>
User
</th>
<th>
Assigned
</th>
<th>
Unassigned
</th>
</tr>
@foreach (var dua in Model.DeviceUserAssignments.OrderByDescending(m => m.AssignedDate))
{
<tr>
<td>
@Html.ActionLink(dua.AssignedUser.ToString(), MVC.User.Show(dua.AssignedUserId))
</td>
<td>
@CommonHelpers.FriendlyDate(dua.AssignedDate)
</td>
<td>
@CommonHelpers.FriendlyDate(dua.UnassignedDate, "Current")
</td>
</tr>
}
</table>
}
else
{
<span class="smallMessage">No Assignment History Available</span>
}
@@ -0,0 +1,142 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Device
{
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.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_DeviceUserAssignmentHistoryTable.cshtml")]
public class DeviceUserAssignmentHistoryTable : System.Web.Mvc.WebViewPage<Disco.Models.Repository.Device>
{
public DeviceUserAssignmentHistoryTable()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
if (Model.DeviceUserAssignments.Count > 0)
{
#line default
#line hidden
WriteLiteral(" <table");
WriteLiteral(" class=\"genericData smallTable\"");
WriteLiteral(">\r\n <tr>\r\n <th>\r\n User\r\n </th>\r\n " +
" <th>\r\n Assigned\r\n </th>\r\n <th>\r\n " +
" Unassigned\r\n </th>\r\n </tr>\r\n");
#line 16 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
#line default
#line hidden
#line 16 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
foreach (var dua in Model.DeviceUserAssignments.OrderByDescending(m => m.AssignedDate))
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <td>\r\n");
WriteLiteral(" ");
#line 20 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
Write(Html.ActionLink(dua.AssignedUser.ToString(), MVC.User.Show(dua.AssignedUserId)));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 23 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
Write(CommonHelpers.FriendlyDate(dua.AssignedDate));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n <td>\r\n");
WriteLiteral(" ");
#line 26 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
Write(CommonHelpers.FriendlyDate(dua.UnassignedDate, "Current"));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 29 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n");
#line 31 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No Assignment History Available</span>\r\n");
#line 35 "..\..\Views\Device\_DeviceUserAssignmentHistoryTable.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
+3
View File
@@ -0,0 +1,3 @@
@{
Html.BundleDeferred("~/Style/Device");
}
@@ -0,0 +1,54 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Device
{
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.BI.Extensions;
using Disco.Models.Repository;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_ViewStart.cshtml")]
public class ViewStart : System.Web.Mvc.ViewStartPage
{
public ViewStart()
{
}
public override void Execute()
{
#line 1 "..\..\Views\Device\_ViewStart.cshtml"
Html.BundleDeferred("~/Style/Device");
#line default
#line hidden
}
}
}
#pragma warning restore 1591