public void BindVirtualMachineDetails()
        {
            int    serviceId = Utils.ParseInt(HyperVServices.SelectedValue, 0);
            string vmId      = VirtualMachines.SelectedValue;

            if (serviceId > 0 && vmId != "")
            {
                VirtualMachine vm = ES.Services.Proxmox.GetVirtualMachineExtendedInfo(serviceId, vmId);
                if (vm != null)
                {
                    // bind VM
                    CpuCores.Text = vm.CpuCores.ToString();
                    RamSize.Text  = vm.RamSize.ToString();
                    HddSize.Text  = vm.HddSize[0].ToString();
                    VhdPath.Text  = vm.VirtualHardDrivePath[0];

                    this.BindSettingsControls(vm);

                    // other settings
                    NumLockEnabled.Value = vm.NumLockEnabled;
                    BootFromCd.Value     = vm.BootFromCD;
                    DvdInstalled.Value   = vm.DvdDriveInstalled;

                    // network adapters
                    ExternalAdapters.DataSource = vm.Adapters;
                    ExternalAdapters.DataBind();
                    ExternalAdapters.Items.Insert(0, new ListItem(GetLocalizedString("SelectNetworkAdapter.Text"), ""));

                    ManagementAdapters.DataSource = vm.Adapters;
                    ManagementAdapters.DataBind();
                    ManagementAdapters.Items.Insert(0, new ListItem(GetLocalizedString("SelectNetworkAdapter.Text"), ""));
                }
            }
        }
        private void BindVirtualMachineDetails()
        {
            int    serviceId = Utils.ParseInt(HyperVServices.SelectedValue, 0);
            string vmId      = VirtualMachines.SelectedValue;

            if (serviceId > 0 && vmId != "")
            {
                // load package context (quotas informations)
                PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);

                VirtualMachine vm = ES.Services.VPS2012.GetVirtualMachineExtendedInfo(serviceId, vmId);
                if (vm != null)
                {
                    // bind VM
                    CpuCores.Text = vm.CpuCores.ToString();
                    RamSize.Text  = vm.RamSize.ToString();
                    HddSize.Text  = vm.HddSize[0].ToString();
                    VhdPath.Text  = vm.VirtualHardDrivePath[0];

                    BindAdditionalHddInfo(vm);

                    this.BindSettingsControls(vm);

                    // snapshots number
                    if (cntx.Quotas.ContainsKey(Quotas.VPS2012_SNAPSHOTS_NUMBER))
                    {
                        int snapsNumber = cntx.Quotas[Quotas.VPS2012_SNAPSHOTS_NUMBER].QuotaAllocatedValue;
                        txtSnapshots.Text    = (snapsNumber != -1) ? snapsNumber.ToString() : "";
                        txtSnapshots.Enabled = (snapsNumber != 0);
                    }

                    // other settings
                    NumLockEnabled.Value = chkNumLock.Checked = vm.NumLockEnabled;
                    BootFromCd.Value     = chkBootFromCd.Checked = vm.BootFromCD;
                    DvdInstalled.Value   = chkDvdInstalled.Checked = vm.DvdDriveInstalled;
                    ShowCheckBoxes(false);

                    // network adapters
                    ExternalAdapters.DataSource = vm.Adapters;
                    ExternalAdapters.DataBind();
                    ExternalAdapters.Items.Insert(0, new ListItem(GetLocalizedString("SelectNetworkAdapter.Text"), ""));

                    ManagementAdapters.DataSource = vm.Adapters;
                    ManagementAdapters.DataBind();
                    ManagementAdapters.Items.Insert(0, new ListItem(GetLocalizedString("SelectNetworkAdapter.Text"), ""));
                }
            }
        }