private void definePhysicalQueues_Button_Click(object sender, EventArgs e)
        {
            if (!_control.ValidatePackageLoaded())
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            using (AssetSelectionForm printerSelectionForm = new AssetSelectionForm(AssetAttributes.Printer, true))
            {
                Cursor.Current = Cursors.Default;
                printerSelectionForm.ShowDialog(this);
                if (printerSelectionForm.DialogResult == DialogResult.OK)
                {
                    _selectedDevices.Clear();
                    foreach (string printerId in printerSelectionForm.SelectedAssets.Select(n => n.AssetId))
                    {
                        _selectedDevices.Add(printerId);
                    }
                    int queueCount = int.Parse(queueCount_TextBox.Text, CultureInfo.InvariantCulture);
                    //_manager.ConstructQueueDefinitions(printerSelectionForm.SelectedPrinterIds, queueCount);

                    pendingPhysicalQueues_TextBox.Text = "Queue definitions pending: {0}".FormatWith(_selectedDevices.Count * queueCount);
                    pendingPhysicalQueues_TextBox.Update();
                }
            }
        }
예제 #2
0
 private void assetUsage_MenuItem_Click(object sender, EventArgs e)
 {
     using (AssetSelectionForm form = new AssetSelectionForm(AssetAttributes.None))
     {
         form.MultiSelect         = true;
         form.SelectButtonVisible = false;
         form.ShowDialog(this);
     }
 }
예제 #3
0
 private void selectPrinters_Button_Click(object sender, EventArgs e)
 {
     using (AssetSelectionForm form = new AssetSelectionForm(AssetAttributes.Printer, false))
     {
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             assetId_TextBox.Text = form.SelectedAssets.First().AssetId;
         }
     }
 }
예제 #4
0
 private void selectAsset_Button_Click(object sender, EventArgs e)
 {
     using (AssetSelectionForm assetSelectionForm = new AssetSelectionForm(AssetAttributes.Printer, asset_TextBox.Text, false))
     {
         assetSelectionForm.ShowDialog(this);
         if (assetSelectionForm.DialogResult == DialogResult.OK)
         {
             _selectedAsset     = assetSelectionForm.SelectedAssets.FirstOrDefault();
             asset_TextBox.Text = _selectedAsset.AssetId;
         }
     }
 }
예제 #5
0
        /// <summary>
        /// Shows the Asset selection form. If a device is selected will start the process for adding it to the grid.
        /// </summary>
        private void GetNewResource()
        {
            string newResourceId = string.Empty;

            using (AssetSelectionForm form = new AssetSelectionForm(AssetAttributes.Printer & AssetAttributes.Scanner | AssetAttributes.ControlPanel))
            {
                form.MultiSelect = false;
                form.ShowDialog(this);
                if (form.DialogResult == DialogResult.OK)
                {
                    newResourceId = form.SelectedAssetIds.FirstOrDefault();
                    BulkDeviceUpdate(newResourceId);
                }
            }
        }
예제 #6
0
 private void deviceSelection_Button_Click(object sender, EventArgs e)
 {
     using (AssetSelectionForm printerSelectionForm = new AssetSelectionForm(AssetAttributes.Printer | AssetAttributes.ControlPanel, false))
     {
         printerSelectionForm.ShowDialog(this);
         if (printerSelectionForm.DialogResult == DialogResult.OK)
         {
             _device = (DeviceInfo)printerSelectionForm.SelectedAssets.FirstOrDefault(); // what happens if not device selected?
             if (_device != null)
             {
                 deviceId_TextBox.Text = _device.AssetId;
             }
         }
     }
 }
 private void Button_PhoneSelect_Click(object sender, EventArgs e)
 {
     using (AssetSelectionForm assetSelectionForm = new AssetSelectionForm(AssetAttributes.Mobile, textBox_PhoneId.Text, false))
     {
         assetSelectionForm.ShowDialog(this);
         if (assetSelectionForm.DialogResult == DialogResult.OK)
         {
             _mobileAsset = (MobileDeviceInfo)assetSelectionForm.SelectedAssets.FirstOrDefault();
             if (_mobileAsset != null)
             {
                 textBox_AssetId.Text     = _mobileAsset.AssetId;
                 textBox_Description.Text = _mobileAsset.Description;
                 textBox_PhoneId.Text     = _mobileAsset.MobileEquipmentId;
             }
         }
     }
 }
        private void selectDeviceLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            using (AssetSelectionForm printerSelectionForm = new AssetSelectionForm(DeviceCapabilities.Print))
            {
                printerSelectionForm.MultiSelect = false;

                printerSelectionForm.ShowDialog(this);
                if (printerSelectionForm.DialogResult == DialogResult.OK)
                {
                    var asset = printerSelectionForm.SelectedAssets.First();

                    Data.Replacement = asset.AssetId;
                    Data.Agent.ImportData.ResourceId = asset.AssetId;

                    newNameValueLabel.Text  = asset.AssetId;
                    newModelValueLabel.Text = asset.Description;
                }
            }
        }
        private void selectDevice_Button_Click(object sender, EventArgs e)
        {
            try
            {
                using (AssetSelectionForm printerSelectionForm = new AssetSelectionForm(AssetAttributes.Printer, deviceId_TextBox.Text, true))
                {
                    printerSelectionForm.ShowDialog(this);
                    if (printerSelectionForm.DialogResult == DialogResult.OK)
                    {
                        _selectedAssetList = printerSelectionForm.SelectedAssets;

                        if (_selectedAssetList != null)
                        {
                            deviceId_TextBox.Text = _selectedAssetList.First().AssetId;
                        }
                    }
                }
            }
            catch (InvalidOperationException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK);
            }
        }