Ejemplo n.º 1
0
        private void btn_ComputePrice_Click(object sender, EventArgs e)
        {
            ComputerComponent computer = new Computer();

            if(cb_HardDrive.Checked == true)
            {
                computer = new HardDrive(computer);
            }

            if(cb_Processor.Checked == true)
            {
                computer = new Processor(computer);
            }

            if(cb_RAM.Checked == true)
            {
                computer = new RAM(computer);
            }

            if (cb_SSD.Checked == true)
            {
                computer = new SSD(computer);
            }

            tb_Output.Text = "Order amount: " + computer.getCost().ToString();
            resetCB();
        }
 public string CreateComputer()
 {
     ComputerComponent computer = new Computer();
     computer = new RAM(computer);
     computer = new Processor(computer);
     return computer.getCost().ToString();
 }