Update: Job Entity -> Enum Support 2
Support the DistributionType Enum in Device Profiles
This commit is contained in:
@@ -75,7 +75,8 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
DeviceProfile = new DeviceProfile()
|
||||
{
|
||||
ComputerNameTemplate = "DeviceProfile.ShortName + '-' + SerialNumber",
|
||||
ProvisionADAccount = true
|
||||
ProvisionADAccount = true,
|
||||
DistributionType = DeviceProfile.DistributionTypes.OneToMany
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceProfile
|
||||
ShortName = dp.ShortName,
|
||||
Address = dp.DefaultOrganisationAddress,
|
||||
Description = dp.Description,
|
||||
DistributionTypeId = (int)dp.DistributionType,
|
||||
DistributionType = dp.DistributionType.Value,
|
||||
DeviceCount = dp.Devices.Count,
|
||||
DeviceDecommissionedCount = dp.Devices.Count(d => d.DecommissionedDate.HasValue)
|
||||
}).ToArray().Cast<ConfigDeviceProfileIndexModelItem>().ToList();
|
||||
|
||||
@@ -16,15 +16,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceProfile
|
||||
public int? Address { get; set; }
|
||||
public string AddressName { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int DistributionTypeId { get; set; }
|
||||
|
||||
public string DistributionType
|
||||
{
|
||||
get
|
||||
{
|
||||
return Enum.GetName(typeof(Disco.Models.Repository.DeviceProfile.DistributionTypes), this.DistributionTypeId);
|
||||
}
|
||||
}
|
||||
public Disco.Models.Repository.DeviceProfile.DistributionTypes DistributionType { get; set; }
|
||||
|
||||
public int DeviceCount { get; set; }
|
||||
public int DeviceDecommissionedCount { get; set; }
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
}
|
||||
@using (Html.BeginForm())
|
||||
{
|
||||
@Html.ValidationSummary(false)
|
||||
<div class="form" style="width: 450px">
|
||||
<table>
|
||||
<tr>
|
||||
@@ -31,6 +32,7 @@
|
||||
</table>
|
||||
@Html.HiddenFor(model => model.DeviceProfile.ComputerNameTemplate)
|
||||
@Html.HiddenFor(model => model.DeviceProfile.ProvisionADAccount)
|
||||
@Html.HiddenFor(model => model.DeviceProfile.DistributionType)
|
||||
<p class="actions">
|
||||
<input type="submit" class="button" value="Create" />
|
||||
</p>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
// Runtime Version:4.0.30319.18051
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -54,6 +54,20 @@ WriteLiteral("\r\n");
|
||||
#line 5 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
using (Html.BeginForm())
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 7 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.ValidationSummary(false));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 7 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
@@ -70,7 +84,7 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
#line 15 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.DeviceProfile.Name));
|
||||
|
||||
|
||||
@@ -79,7 +93,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 14 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
#line 15 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.DeviceProfile.Name));
|
||||
|
||||
|
||||
@@ -89,7 +103,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
|
||||
">\r\n Short Name:\r\n </th>\r\n <td>");
|
||||
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
#line 22 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.DeviceProfile.ShortName));
|
||||
|
||||
|
||||
@@ -98,7 +112,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 21 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
#line 22 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.DeviceProfile.ShortName));
|
||||
|
||||
|
||||
@@ -109,7 +123,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
|
||||
"");
|
||||
|
||||
|
||||
#line 28 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
#line 29 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.TextBoxFor(model => model.DeviceProfile.Description));
|
||||
|
||||
|
||||
@@ -118,7 +132,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
|
||||
WriteLiteral("<br />");
|
||||
|
||||
|
||||
#line 28 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
#line 29 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.ValidationMessageFor(model => model.DeviceProfile.Description));
|
||||
|
||||
|
||||
@@ -129,7 +143,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 32 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
#line 33 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.HiddenFor(model => model.DeviceProfile.ComputerNameTemplate));
|
||||
|
||||
|
||||
@@ -140,10 +154,21 @@ WriteLiteral("\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
#line 34 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.HiddenFor(model => model.DeviceProfile.ProvisionADAccount));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 35 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
Write(Html.HiddenFor(model => model.DeviceProfile.DistributionType));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <p");
|
||||
@@ -168,7 +193,7 @@ WriteLiteral(">\r\n $(function () {\r\n $(\'#Name\').focus().s
|
||||
"\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 43 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
#line 45 "..\..\Areas\Config\Views\DeviceProfile\Create.cshtml"
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user