Estimate Cost of Assembly Computer Configuration while purchasing

Satyapriyanayak
Posted by Satyapriyanayak under VB.NET category on | Points: 40 | Views : 1967
Generally when we go to purchase a new assembly computer of our own suitable components to be assembled with our own suitable brand, we don’t know what will be the total budget of the computer. When we go to the computer shop and give all our required components to be assembled, those people calculate and give the estimation with the help of a computer-generated program as below.

Public Class Form1

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
'Choose Motherboard Kit
If ComboBox1.Text = "No" Then
TextBox1.Text = 0
ElseIf ComboBox1.Text = "Intel" Then
TextBox1.Text = 7000
ElseIf ComboBox1.Text = "Asus" Then
TextBox1.Text = 6000
ElseIf ComboBox1.Text = "Mercury" Then
TextBox1.Text = 5000
End If
End Sub

Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
'Choose Moniter
If ComboBox2.Text = "No" Then
TextBox2.Text = 0
ElseIf ComboBox2.Text = "Lg" Then
TextBox2.Text = 6000
ElseIf ComboBox2.Text = "Samsung" Then
TextBox2.Text = 7000
End If
End Sub

Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
'Choose HardDisk
If ComboBox3.Text = "No" Then
TextBox3.Text = 0
ElseIf ComboBox3.Text = "Seagate" Then
TextBox3.Text = 2600
ElseIf ComboBox3.Text = "Western Digital" Then
TextBox3.Text = 2300
End If
End Sub

Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
'Choose CdR-Rw-Dvrr-Rw
If ComboBox4.Text = "No" Then
TextBox4.Text = 0
ElseIf ComboBox4.Text = "Asus" Then
TextBox4.Text = 3000
ElseIf ComboBox4.Text = "Samsung" Then
TextBox4.Text = 2600
ElseIf ComboBox4.Text = "Lg" Then
TextBox4.Text = 2300
ElseIf ComboBox4.Text = "Acer" Then
TextBox4.Text = 2200
End If
End Sub

Private Sub ComboBox5_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox5.SelectedIndexChanged
'Choose Ups
If ComboBox5.Text = "No" Then
TextBox5.Text = 0
ElseIf ComboBox5.Text = "PowerMax" Then
TextBox5.Text = 1400
ElseIf ComboBox5.Text = "PowerGuard" Then
TextBox5.Text = 1600
ElseIf ComboBox5.Text = "Iball" Then
TextBox5.Text = 2000
End If

End Sub

Private Sub ComboBox6_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox6.SelectedIndexChanged
'Choose Mouse
If ComboBox6.Text = "No" Then
TextBox6.Text = 0
ElseIf ComboBox6.Text = "Frontech" Then
TextBox6.Text = 250
ElseIf ComboBox6.Text = "IBall" Then
TextBox6.Text = 300
ElseIf ComboBox6.Text = "Mercury" Then
TextBox6.Text = 200
End If
End Sub

Private Sub ComboBox7_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox7.SelectedIndexChanged
'Choose Keyboard
If ComboBox7.Text = "No" Then
TextBox7.Text = 0
ElseIf ComboBox7.Text = "Asus" Then
TextBox7.Text = 250
ElseIf ComboBox7.Text = "Frontech" Then
TextBox7.Text = 300
ElseIf ComboBox7.Text = "Mercury" Then
TextBox7.Text = 200
End If
End Sub

Private Sub ComboBox8_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox8.SelectedIndexChanged
'Choose Cabinate
If ComboBox8.Text = "No" Then
TextBox8.Text = 0
ElseIf ComboBox8.Text = "Mercury" Then
TextBox8.Text = "1200"
ElseIf ComboBox8.Text = "Frontech" Then
TextBox8.Text = 1500
ElseIf ComboBox8.Text = "Iball" Then
TextBox8.Text = 1800
End If
End Sub

Private Sub ComboBox9_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox9.SelectedIndexChanged
'Choose Printer
If ComboBox9.Text = "No" Then
TextBox9.Text = 0
ElseIf ComboBox9.Text = "Laser" Then
TextBox9.Text = "12000"
ElseIf ComboBox9.Text = "Inkjet" Then
TextBox9.Text = 3000
ElseIf ComboBox9.Text = "Bubble Jet" Then
TextBox9.Text = 2500
End If
End Sub

Private Sub btncalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalculate.Click
Label10.Text = "The Total Cost is:" & Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text) + Val(TextBox7.Text) + Val(TextBox8.Text) + Val(TextBox9.Text) + Val(TextBox10.Text)
End Sub

Private Sub ComboBox10_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox10.SelectedIndexChanged
'Choose Ram
If ComboBox10.Text = "No" Then
TextBox10.Text = 0
ElseIf ComboBox10.Text = "1gb ddr1" Then
TextBox10.Text = 1500
ElseIf ComboBox10.Text = "2gb ddr2" Then
TextBox10.Text = 2200
End If
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Visible = False
TextBox2.Visible = False
TextBox3.Visible = False
TextBox4.Visible = False
TextBox5.Visible = False
TextBox6.Visible = False
TextBox7.Visible = False
TextBox8.Visible = False
TextBox9.Visible = False
TextBox10.Visible = False
End Sub
End Class

Comments or Responses

Login to post response