Hyper-V replace config files with Service Settings
This commit is contained in:
parent
60bc7505ca
commit
45bb3c53a8
12 changed files with 673 additions and 194 deletions
|
@ -443,4 +443,76 @@ The following substitution variables can be used in the pattern:<br/>
|
|||
<data name="locReplicaServer.Text" xml:space="preserve">
|
||||
<value>Replication Server:</value>
|
||||
</data>
|
||||
<data name="btnAddDvd.Text" xml:space="preserve">
|
||||
<value>Add DVD</value>
|
||||
</data>
|
||||
<data name="btnAddOsTemplate.Text" xml:space="preserve">
|
||||
<value>Add OS Template</value>
|
||||
</data>
|
||||
<data name="btnRemoveDvd.Text" xml:space="preserve">
|
||||
<value>Remove</value>
|
||||
</data>
|
||||
<data name="btnRemoveOsTemplate.Text" xml:space="preserve">
|
||||
<value>Remove</value>
|
||||
</data>
|
||||
<data name="chkCanSetAdminPass.Text" xml:space="preserve">
|
||||
<value>Can set an Administrator password</value>
|
||||
</data>
|
||||
<data name="chkCanSetComputerName.Text" xml:space="preserve">
|
||||
<value>Can set a computer name</value>
|
||||
</data>
|
||||
<data name="chkCanSetNetwork.Text" xml:space="preserve">
|
||||
<value>Can set Ip addresses</value>
|
||||
</data>
|
||||
<data name="chkLegacyNetworkAdapter.Text" xml:space="preserve">
|
||||
<value>Use legacy adapter</value>
|
||||
</data>
|
||||
<data name="DvdDescriptionValidator.ErrorMessage" xml:space="preserve">
|
||||
<value>Enter DVD description</value>
|
||||
</data>
|
||||
<data name="DvdFileNameValidator.ErrorMessage" xml:space="preserve">
|
||||
<value>Enter DVD file name</value>
|
||||
</data>
|
||||
<data name="DvdNameValidator.ErrorMessage" xml:space="preserve">
|
||||
<value>Enter DVD name</value>
|
||||
</data>
|
||||
<data name="locDvdDescription.Text" xml:space="preserve">
|
||||
<value>Description:</value>
|
||||
</data>
|
||||
<data name="locDvdFileName.Text" xml:space="preserve">
|
||||
<value>File name (with extension):</value>
|
||||
</data>
|
||||
<data name="locDvdLibrary.Text" xml:space="preserve">
|
||||
<value>DVD Library</value>
|
||||
</data>
|
||||
<data name="locDvdName.Text" xml:space="preserve">
|
||||
<value>Name:</value>
|
||||
</data>
|
||||
<data name="locProcessVolume.Text" xml:space="preserve">
|
||||
<value>Index of the volume to expand:</value>
|
||||
</data>
|
||||
<data name="locSysprep.Text" xml:space="preserve">
|
||||
<value>Sysprep files (separated by ';'):</value>
|
||||
</data>
|
||||
<data name="locTemplateFileName.Text" xml:space="preserve">
|
||||
<value>File name (with extension):</value>
|
||||
</data>
|
||||
<data name="locTemplateName.Text" xml:space="preserve">
|
||||
<value>Name:</value>
|
||||
</data>
|
||||
<data name="locTemplates.Text" xml:space="preserve">
|
||||
<value>OS Templates</value>
|
||||
</data>
|
||||
<data name="TemplateFileNameValidator.ErrorMessage" xml:space="preserve">
|
||||
<value>Enter OS template file name</value>
|
||||
</data>
|
||||
<data name="TemplateNameValidator.ErrorMessage" xml:space="preserve">
|
||||
<value>Enter OS template name</value>
|
||||
</data>
|
||||
<data name="valProcessVolume.ErrorMessage" xml:space="preserve">
|
||||
<value>Enter OS template process volume</value>
|
||||
</data>
|
||||
<data name="vcmProcessVolume.ErrorMessage" xml:space="preserve">
|
||||
<value>Process volume should be a positive number</value>
|
||||
</data>
|
||||
</root>
|
|
@ -62,16 +62,7 @@
|
|||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Localize ID="locOSTemplatesPath" runat="server" meta:resourcekey="locOSTemplatesPath" Text="OS Templates path:"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox Width="300px" CssClass="NormalTextBox" Runat="server" ID="txtOSTemplatesPath"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="TemplatesPathValidator" runat="server" ControlToValidate="txtOSTemplatesPath"
|
||||
Text="*" meta:resourcekey="TemplatesPathValidator" Display="Dynamic" SetFocusOnError="true" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Localize ID="locExportedVpsPath" runat="server" meta:resourcekey="locExportedVpsPath" Text="Exported VPS path:"></asp:Localize>
|
||||
|
@ -82,16 +73,6 @@
|
|||
Text="*" meta:resourcekey="ExportedVpsPathValidator" Display="Dynamic" SetFocusOnError="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead" style="width:200px;">
|
||||
<asp:Localize ID="locDvdIsoPath" runat="server" meta:resourcekey="locDvdIsoPath" Text="Path to DVD ISO files:"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox Width="300px" CssClass="NormalTextBox" Runat="server" ID="txtDvdLibraryPath"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="DvdLibraryPathValidator" runat="server" ControlToValidate="txtDvdLibraryPath"
|
||||
Text="*" meta:resourcekey="DvdLibraryPathValidator" Display="Dynamic" SetFocusOnError="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<br />
|
||||
|
@ -137,6 +118,165 @@
|
|||
</fieldset>
|
||||
<br />
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
<asp:Localize ID="locTemplates" runat="server" meta:resourcekey="locTemplates" Text="OS Templates"></asp:Localize>
|
||||
</legend>
|
||||
<table cellpadding="2" cellspacing="0" width="100%" style="margin: 10px;">
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Localize ID="locOSTemplatesPath" runat="server" meta:resourcekey="locOSTemplatesPath" Text="OS Templates path:"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox Width="300px" CssClass="NormalTextBox" Runat="server" ID="txtOSTemplatesPath"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="TemplatesPathValidator" runat="server" ControlToValidate="txtOSTemplatesPath"
|
||||
Text="*" meta:resourcekey="TemplatesPathValidator" Display="Dynamic" SetFocusOnError="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 15px;margin-bottom: 25px;margin-left: 10px;">
|
||||
<asp:Button ID="btnAddOsTemplate" runat="server" meta:resourcekey="btnAddOsTemplate"
|
||||
CssClass="Button1" Text="Add OS Template" CausesValidation="false"
|
||||
OnClick="btnAddOsTemplate_Click" />
|
||||
</div>
|
||||
<asp:Repeater ID="repOsTemplates" runat="server">
|
||||
<HeaderTemplate>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<table cellpadding="2" cellspacing="0" width="100%" style="margin: 10px;">
|
||||
<tr>
|
||||
<td class="SubHead" style="width: 200px;">
|
||||
<asp:Localize ID="locTemplateName" runat="server" meta:resourcekey="locTemplateName" Text="Name:"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox CssClass="NormalTextBox" runat="server" ID="txtTemplateName" Text='<%# Eval("Name") %>'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="TemplateNameValidator" runat="server" ControlToValidate="txtTemplateName"
|
||||
Text="*" meta:resourcekey="TemplateNameValidator" Display="Dynamic" SetFocusOnError="true" />
|
||||
</td>
|
||||
<td rowspan="3">
|
||||
<asp:CheckBox ID="chkLegacyNetworkAdapter" runat="server" Checked='<%# Eval("LegacyNetworkAdapter") %>' meta:resourcekey="chkLegacyNetworkAdapter" Text="Use legacy adapter" /><br />
|
||||
<%--<asp:CheckBox ID="chkRemoteDesktop" runat="server" Checked='<%# Eval("RemoteDesktop") %>' meta:resourcekey="chkRemoteDesktop" Text="Remote desktop" /><br/>--%>
|
||||
<asp:CheckBox ID="chkCanSetComputerName" runat="server" Checked='<%# Eval("ProvisionComputerName") %>' meta:resourcekey="chkCanSetComputerName" Text="Can set a computer name" /><br />
|
||||
<asp:CheckBox ID="chkCanSetAdminPass" runat="server" Checked='<%# Eval("ProvisionAdministratorPassword") %>' meta:resourcekey="chkCanSetAdminPass" Text="Can set an Administrator password" /><br />
|
||||
<asp:CheckBox ID="chkCanSetNetwork" runat="server" Checked='<%# Eval("ProvisionNetworkAdapters") %>' meta:resourcekey="chkCanSetNetwork" Text="Can set Ip addresses" /><br />
|
||||
</td>
|
||||
<td rowspan="3">
|
||||
<asp:Button ID="btnRemoveOsTemplate" runat="server" meta:resourcekey="btnRemoveOsTemplate"
|
||||
CssClass="Button1" Text="Remove" CausesValidation="false"
|
||||
CommandName="Remove" CommandArgument="<%# Container.ItemIndex %>" OnCommand="btnRemoveOsTemplate_OnCommand" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Localize ID="locTemplateFileName" runat="server" meta:resourcekey="locTemplateFileName" Text="File name (with extension):"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox CssClass="NormalTextBox" runat="server" ID="txtTemplateFileName" Text='<%# Eval("Path") %>'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="TemplateFileNameValidator" runat="server" ControlToValidate="txtTemplateFileName"
|
||||
Text="*" meta:resourcekey="TemplateFileNameValidator" Display="Dynamic" SetFocusOnError="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Localize ID="locProcessVolume" runat="server" meta:resourcekey="locProcessVolume" Text="Index of the volume to expand:"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox CssClass="NormalTextBox" runat="server" ID="txtProcessVolume" Text='<%# Eval("ProcessVolume") %>'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="valProcessVolume" runat="server" ControlToValidate="txtProcessVolume"
|
||||
Text="*" meta:resourcekey="valProcessVolume" Display="Dynamic" SetFocusOnError="true" />
|
||||
<asp:CompareValidator runat="server" ID="vcmProcessVolume" ControlToValidate="txtProcessVolume"
|
||||
Type="Integer" Operator="GreaterThanEqual" Display="Dynamic" ValueToCompare="0" meta:resourcekey="vcmProcessVolume" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Localize ID="locSysprep" runat="server" meta:resourcekey="locSysprep" Text="Sysprep files:"></asp:Localize>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<asp:TextBox Width="470px" CssClass="NormalTextBox" runat="server" ID="txtSysprep" Text='<%# string.Join(";", (string[])Eval("SysprepFiles")) %>'></asp:TextBox>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
<SeparatorTemplate>
|
||||
<br/>
|
||||
<%--<hr style="margin-bottom: 20px; margin-top: 10px; margin-left: 10px; margin-right: 10px;"/>--%>
|
||||
</SeparatorTemplate>
|
||||
</asp:Repeater>
|
||||
</fieldset>
|
||||
<br />
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
<asp:Localize ID="locDvdLibrary" runat="server" meta:resourcekey="locDvdLibrary" Text="DVD Library"></asp:Localize>
|
||||
</legend>
|
||||
<table cellpadding="2" cellspacing="0" width="100%" style="margin: 10px;">
|
||||
<tr>
|
||||
<td class="SubHead" style="width: 200px;">
|
||||
<asp:Localize ID="locDvdIsoPath" runat="server" meta:resourcekey="locDvdIsoPath" Text="Path to DVD ISO files:"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox Width="300px" CssClass="NormalTextBox" runat="server" ID="txtDvdLibraryPath"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="DvdLibraryPathValidator" runat="server" ControlToValidate="txtDvdLibraryPath"
|
||||
Text="*" meta:resourcekey="DvdLibraryPathValidator" Display="Dynamic" SetFocusOnError="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="margin-top: 15px;margin-bottom: 25px;margin-left: 10px;">
|
||||
<asp:Button ID="btnAddDvd" runat="server" meta:resourcekey="btnAddDvd"
|
||||
CssClass="Button1" Text="Add DVD" CausesValidation="false"
|
||||
OnClick="btnAddDvd_Click" />
|
||||
</div>
|
||||
<asp:Repeater ID="repDvdLibrary" runat="server">
|
||||
<HeaderTemplate>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<table cellpadding="2" cellspacing="0" width="100%" style="margin: 10px;">
|
||||
<tr>
|
||||
<td class="SubHead" style="width: 200px;">
|
||||
<asp:Localize ID="locDvdName" runat="server" meta:resourcekey="locDvdName" Text="Name:"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox CssClass="NormalTextBox" runat="server" ID="txtDvdName" Text='<%# Eval("Name") %>'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="DvdNameValidator" runat="server" ControlToValidate="txtDvdName"
|
||||
Text="*" meta:resourcekey="DvdNameValidator" Display="Dynamic" SetFocusOnError="true" />
|
||||
</td>
|
||||
<td rowspan="3">
|
||||
<asp:Button ID="btnRemoveDvd" runat="server" meta:resourcekey="btnRemoveDvd"
|
||||
CssClass="Button1" Text="Remove" CausesValidation="false"
|
||||
CommandName="Remove" CommandArgument="<%# Container.ItemIndex %>" OnCommand="btnRemoveDvd_OnCommand" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Localize ID="locDvdDescription" runat="server" meta:resourcekey="locDvdDescription" Text="Description:"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox CssClass="NormalTextBox" runat="server" ID="txtDvdDescription" Text='<%# Eval("Description") %>'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="DvdDescriptionValidator" runat="server" ControlToValidate="txtDvdDescription"
|
||||
Text="*" meta:resourcekey="DvdDescriptionValidator" Display="Dynamic" SetFocusOnError="true" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Localize ID="locDvdFileName" runat="server" meta:resourcekey="locDvdFileName" Text="File name (with extension):"></asp:Localize>
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox CssClass="NormalTextBox" runat="server" ID="txtDvdFileName" Text='<%# Eval("Path") %>'></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="DvdFileNameValidator" runat="server" ControlToValidate="txtDvdFileName"
|
||||
Text="*" meta:resourcekey="DvdFileNameValidator" Display="Dynamic" SetFocusOnError="true" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ItemTemplate>
|
||||
<SeparatorTemplate>
|
||||
<br/>
|
||||
<%--<hr style="margin-bottom: 20px; margin-top: 10px; margin-left: 10px; margin-right: 10px;"/>--%>
|
||||
</SeparatorTemplate>
|
||||
</asp:Repeater>
|
||||
</fieldset>
|
||||
<br />
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
<asp:Localize ID="locReplication" runat="server" meta:resourcekey="locReplication" Text="Replication"></asp:Localize>
|
||||
|
|
|
@ -61,7 +61,6 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
|
||||
// general settings
|
||||
txtVpsRootFolder.Text = settings["RootFolder"];
|
||||
txtOSTemplatesPath.Text = settings["OsTemplatesPath"];
|
||||
txtExportedVpsPath.Text = settings["ExportedVpsPath"];
|
||||
|
||||
// CPU
|
||||
|
@ -69,8 +68,15 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
txtCpuReserve.Text = settings["CpuReserve"];
|
||||
txtCpuWeight.Text = settings["CpuWeight"];
|
||||
|
||||
// OS Templates
|
||||
txtOSTemplatesPath.Text = settings["OsTemplatesPath"];
|
||||
repOsTemplates.DataSource = new ConfigFile(settings["OsTemplates"]).LibraryItems; //ES.Services.VPS2012.GetOperatingSystemTemplatesByServiceId(PanelRequest.ServiceId).ToList();
|
||||
repOsTemplates.DataBind();
|
||||
|
||||
// DVD library
|
||||
txtDvdLibraryPath.Text = settings["DvdLibraryPath"];
|
||||
repDvdLibrary.DataSource = new ConfigFile(settings["DvdLibrary"]).LibraryItems;
|
||||
repDvdLibrary.DataBind();
|
||||
|
||||
// VHD type
|
||||
radioVirtualDiskType.SelectedValue = settings["VirtualDiskType"];
|
||||
|
@ -132,7 +138,6 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
|
||||
// general settings
|
||||
settings["RootFolder"] = txtVpsRootFolder.Text.Trim();
|
||||
settings["OsTemplatesPath"] = txtOSTemplatesPath.Text.Trim();
|
||||
settings["ExportedVpsPath"] = txtExportedVpsPath.Text.Trim();
|
||||
|
||||
// CPU
|
||||
|
@ -140,7 +145,12 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
settings["CpuReserve"] = txtCpuReserve.Text.Trim();
|
||||
settings["CpuWeight"] = txtCpuWeight.Text.Trim();
|
||||
|
||||
// OS Templates
|
||||
settings["OsTemplates"] = GetConfigXml(GetOsTemplates());
|
||||
settings["OsTemplatesPath"] = txtOSTemplatesPath.Text.Trim();
|
||||
|
||||
// DVD library
|
||||
settings["DvdLibrary"] = GetConfigXml(GetDvds());
|
||||
settings["DvdLibraryPath"] = txtDvdLibraryPath.Text.Trim();
|
||||
|
||||
// VHD type
|
||||
|
@ -301,7 +311,7 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
ReplicaPathErrorTr.Visible = ReplicaErrorTr.Visible = false;
|
||||
if (IsReplicaServer) BindCertificates();
|
||||
if (EnabledReplica) BindReplicaServices();
|
||||
}
|
||||
}
|
||||
|
||||
protected void radioServer_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -334,6 +344,7 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
SetUnsetReplication();
|
||||
}
|
||||
|
||||
|
||||
private void SetUnsetReplication()
|
||||
{
|
||||
if (!IsReplicaServer)
|
||||
|
@ -354,5 +365,118 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
if (!result.IsSuccess)
|
||||
ReplicaErrorTr.Visible = true;
|
||||
}
|
||||
|
||||
// OS Templates
|
||||
protected void btnAddOsTemplate_Click(object sender, EventArgs e)
|
||||
{
|
||||
var templates = GetOsTemplates();
|
||||
|
||||
templates.Add(new LibraryItem());
|
||||
|
||||
RebindOsTemplate(templates);
|
||||
}
|
||||
|
||||
protected void btnRemoveOsTemplate_OnCommand(object sender, CommandEventArgs e)
|
||||
{
|
||||
var templates = GetOsTemplates();
|
||||
|
||||
templates.RemoveAt(Convert.ToInt32(e.CommandArgument));
|
||||
|
||||
RebindOsTemplate(templates);
|
||||
}
|
||||
|
||||
private List<LibraryItem> GetOsTemplates()
|
||||
{
|
||||
var result = new List<LibraryItem>();
|
||||
|
||||
foreach (RepeaterItem item in repOsTemplates.Items)
|
||||
{
|
||||
var template = new LibraryItem();
|
||||
int processVolume;
|
||||
|
||||
template.Name = GetTextBoxText(item, "txtTemplateName");
|
||||
template.Path = GetTextBoxText(item, "txtTemplateFileName");
|
||||
|
||||
int.TryParse(GetTextBoxText(item, "txtProcessVolume"), out processVolume);
|
||||
template.ProcessVolume = processVolume;
|
||||
|
||||
template.LegacyNetworkAdapter = GetCheckBoxValue(item, "chkLegacyNetworkAdapter");
|
||||
template.RemoteDesktop = true; // obsolete
|
||||
template.ProvisionComputerName = GetCheckBoxValue(item, "chkCanSetComputerName");
|
||||
template.ProvisionAdministratorPassword = GetCheckBoxValue(item, "chkCanSetAdminPass");
|
||||
template.ProvisionNetworkAdapters = GetCheckBoxValue(item, "chkCanSetNetwork");
|
||||
|
||||
var syspreps = GetTextBoxText(item, "txtSysprep").Split(new[] {";"}, StringSplitOptions.RemoveEmptyEntries);
|
||||
template.SysprepFiles = syspreps.Select(s=>s.Trim()).ToArray();
|
||||
|
||||
result.Add(template);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
private void RebindOsTemplate(List<LibraryItem> templates)
|
||||
{
|
||||
repOsTemplates.DataSource = templates;
|
||||
repOsTemplates.DataBind();
|
||||
}
|
||||
|
||||
private string GetConfigXml(List<LibraryItem> items)
|
||||
{
|
||||
var templates = items.ToArray();
|
||||
return new ConfigFile(templates).Xml;
|
||||
}
|
||||
|
||||
private string GetTextBoxText(RepeaterItem item, string name)
|
||||
{
|
||||
return (item.FindControl(name) as TextBox).Text;
|
||||
}
|
||||
|
||||
private bool GetCheckBoxValue(RepeaterItem item, string name)
|
||||
{
|
||||
return (item.FindControl(name) as CheckBox).Checked;
|
||||
}
|
||||
|
||||
// DVD Library
|
||||
protected void btnAddDvd_Click(object sender, EventArgs e)
|
||||
{
|
||||
var dvds = GetDvds();
|
||||
|
||||
dvds.Add(new LibraryItem());
|
||||
|
||||
RebindDvds(dvds);
|
||||
}
|
||||
|
||||
protected void btnRemoveDvd_OnCommand(object sender, CommandEventArgs e)
|
||||
{
|
||||
var dvds = GetDvds();
|
||||
|
||||
dvds.RemoveAt(Convert.ToInt32(e.CommandArgument));
|
||||
|
||||
RebindDvds(dvds);
|
||||
}
|
||||
|
||||
private List<LibraryItem> GetDvds()
|
||||
{
|
||||
var result = new List<LibraryItem>();
|
||||
|
||||
foreach (RepeaterItem item in repDvdLibrary.Items)
|
||||
{
|
||||
var dvd = new LibraryItem();
|
||||
|
||||
dvd.Name = GetTextBoxText(item, "txtDvdName");
|
||||
dvd.Description = GetTextBoxText(item, "txtDvdDescription");
|
||||
dvd.Path = GetTextBoxText(item, "txtDvdFileName");
|
||||
|
||||
result.Add(dvd);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void RebindDvds(List<LibraryItem> dvds)
|
||||
{
|
||||
repDvdLibrary.DataSource = dvds;
|
||||
repDvdLibrary.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,33 +147,6 @@ namespace WebsitePanel.Portal.ProviderControls {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locFolderVariables;
|
||||
|
||||
/// <summary>
|
||||
/// locOSTemplatesPath control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locOSTemplatesPath;
|
||||
|
||||
/// <summary>
|
||||
/// txtOSTemplatesPath control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtOSTemplatesPath;
|
||||
|
||||
/// <summary>
|
||||
/// TemplatesPathValidator control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator TemplatesPathValidator;
|
||||
|
||||
/// <summary>
|
||||
/// locExportedVpsPath control.
|
||||
/// </summary>
|
||||
|
@ -201,33 +174,6 @@ namespace WebsitePanel.Portal.ProviderControls {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator ExportedVpsPathValidator;
|
||||
|
||||
/// <summary>
|
||||
/// locDvdIsoPath control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locDvdIsoPath;
|
||||
|
||||
/// <summary>
|
||||
/// txtDvdLibraryPath control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtDvdLibraryPath;
|
||||
|
||||
/// <summary>
|
||||
/// DvdLibraryPathValidator control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator DvdLibraryPathValidator;
|
||||
|
||||
/// <summary>
|
||||
/// locProcessorSettings control.
|
||||
/// </summary>
|
||||
|
@ -318,6 +264,114 @@ namespace WebsitePanel.Portal.ProviderControls {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator CpuWeightValidator;
|
||||
|
||||
/// <summary>
|
||||
/// locTemplates control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locTemplates;
|
||||
|
||||
/// <summary>
|
||||
/// locOSTemplatesPath control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locOSTemplatesPath;
|
||||
|
||||
/// <summary>
|
||||
/// txtOSTemplatesPath control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtOSTemplatesPath;
|
||||
|
||||
/// <summary>
|
||||
/// TemplatesPathValidator control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator TemplatesPathValidator;
|
||||
|
||||
/// <summary>
|
||||
/// btnAddOsTemplate control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnAddOsTemplate;
|
||||
|
||||
/// <summary>
|
||||
/// repOsTemplates control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater repOsTemplates;
|
||||
|
||||
/// <summary>
|
||||
/// locDvdLibrary control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locDvdLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// locDvdIsoPath control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locDvdIsoPath;
|
||||
|
||||
/// <summary>
|
||||
/// txtDvdLibraryPath control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtDvdLibraryPath;
|
||||
|
||||
/// <summary>
|
||||
/// DvdLibraryPathValidator control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator DvdLibraryPathValidator;
|
||||
|
||||
/// <summary>
|
||||
/// btnAddDvd control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnAddDvd;
|
||||
|
||||
/// <summary>
|
||||
/// repDvdLibrary control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater repDvdLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// locReplication control.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue