Beispiel #1
0
        public ComputerOrderForm(ComputerOrder computerOrder)
        {
            InitializeComponent();

            comp = computerOrder;

            // Setting local arrays to keep the names of the fields from the ComputerOrder class
            string[] driveItems  = comp.DriveInfo;
            string[] moboItems   = comp.MoboInfo;
            string[] memItems    = comp.MemoryInfo;
            string[] periphItems = comp.PeripheralsInfo;

            // Setting drive radio buttons
            radDrive1.Content = driveItems[0];
            radDrive2.Content = driveItems[1];
            radDrive3.Content = driveItems[2];

            // Setting mobo collection list for the combobox
            cbxMobo.ItemsSource = moboItems;

            // Setting memory radio buttons
            radMem1.Content = memItems[0];
            radMem2.Content = memItems[1];
            radMem3.Content = memItems[2];

            // Setting up peripheral checkboxes
            cbPeriph1.Content = periphItems[0];
            cbPeriph2.Content = periphItems[1];
            cbPeriph3.Content = periphItems[2];
            cbPeriph4.Content = periphItems[3];
            cbPeriph5.Content = periphItems[4];
            cbPeriph6.Content = periphItems[5];
            cbPeriph7.Content = periphItems[6];
            cbPeriph8.Content = periphItems[7];
        }
Beispiel #2
0
        private void btnComputer_Click(object sender, RoutedEventArgs e)
        {
            // Creating a new computer order object and assigning the object into the computer order form constructor
            ComputerOrder compOrder = new ComputerOrder();


            ComputerOrderForm frmComputerOrder = new ComputerOrderForm(compOrder);

            // Showing the dialogbox for computer order
            frmComputerOrder.ShowDialog();
            if (frmComputerOrder.DialogResult == true)
            {
                store.CompOrder = compOrder;
            }

            txbComputerResults.Text = store.CompOrder.OrderSummary;
        }