none
Visual Basic RRS feed

  • Question

  • HI

    I need help with this situation. 

    • The destination country should be selectable from a from a checkbox list. ( i should have 3 countries) 
    • The corresponding city should be selectable from a combo list. ( for each country I should have 3 cities )
    • The customer should be able to select from three car engine sizes, which are:

    -      1.1ltr      Cost:  £140 per day

    -      1.6ltr      Cost:  £190 per day

    -      2.0ltr      Cost:  £250 per day

    • A final quotation will have VAT added at 20%.
    • A final quotation displaying user’s details, grand total with a sub-total and VAT listed should be available in view mode for the customer.
    • The final quotation should be printable in a format that is both easy to read and understand.

    Also if people will take the car for a few days I need to count the price for that few days.  

    Thanks a lot 



    • Edited by Starm1x Wednesday, November 14, 2018 2:48 PM
    Wednesday, November 14, 2018 2:28 PM

All replies

  • Hi

    For school homework, please consult your school teacher.

    *

    Alternatively, post the code you have developed so far, with details of any exceptions, and, what it does that is not what you want/expected. Show what it should have done.

    If you do that, then we can help you with any issues or  problems that you encounter.


    Regards Les, Livingston, Scotland


    • Edited by leshay Wednesday, November 14, 2018 2:46 PM
    Wednesday, November 14, 2018 2:44 PM
  • it is not a school homework I am doing my own prodject.
    Wednesday, November 14, 2018 2:49 PM
  • it is not a school homework I am doing my own prodject.

    Hi

    OK, then follow my second suggestion.


    Regards Les, Livingston, Scotland

    Wednesday, November 14, 2018 2:57 PM
  • Please when following Les's recommendations supply the code in a code block via the second button to the right in the editor. Also, more information is better than less information so make sure you have everything you need up front rather than later as many do here. You are in good hands with Les.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, November 14, 2018 3:10 PM
    Moderator
  • Hi 

    How I can verify my  account as I want to send the image 

    Thank you


    Wednesday, November 14, 2018 9:45 PM
  • Hi 

    How I can verify my  account as I want to send the image 

    Thank you


    Hi,

    https://social.msdn.microsoft.com/Forums/windows/en-US/dc4002e4-e3de-4b1e-9a97-3702387886cc/verify-account-42?forum=reportabug

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 15, 2018 6:49 AM
  • hi 

    how I can do that when I chose one thing from checkboxlist and after in combo list displays  3 different things and if I have a few things in a checkboxlist  for example 1, 2 and 3 I will choose the first one and it should display in combo list 3 thinks and if I take different one the old should be not showing any more. 

    Best regard.


    • Edited by Starm1x Monday, November 19, 2018 12:36 AM
    Sunday, November 18, 2018 11:24 PM
  • Hi

    Show the items for the CheckListBox and also show what the ComboBox must show for each of those.


    Regards Les, Livingston, Scotland

    Monday, November 19, 2018 12:36 AM
  • Hi 

    I did the list which I want but I do not have even idea how I can add the price of the Engine Sizes. With the start date and end date and calculation of the price plus 20% of a vat. Is it possible that you can explain to me how I can do it?

    Best regards 

    thank you for helping me.
    • Edited by Starm1x Monday, November 19, 2018 10:18 PM
    Monday, November 19, 2018 10:16 PM
  • Hi

    You need to answer any questions asked of you. I asked about showing what the ListBox needed to show, and for each of those, what the ComboBox needed to show.


    Regards Les, Livingston, Scotland

    Monday, November 19, 2018 11:05 PM
  • hi 

    I finished the program.

    thank you.

    Public Class Caroption
        Public Class Country
            Public Property Id() As Integer
            Public Property Name() As String
    
            Public Overrides Function ToString() As String
                Return Name
            End Function
        End Class
    
        Public Class City
            Public Property CountryId() As Integer
            Public Property Name() As String
    
        End Class
    
    
    
        Public Class Operations
            Public ReadOnly Property Countries() As List(Of Country)
                Get
                    Return New List(Of Country) From
                        {
                            New Country() With {.Id = 1, .Name = "France"},
                            New Country() With {.Id = 2, .Name = "Italia"},
                            New Country() With {.Id = 3, .Name = "Ukraine"}
                        }
                End Get
            End Property
            Public ReadOnly Property Cities() As List(Of City)
                Get
                    Return New List(Of City) From
                        {
                            New City() With {.CountryId = 2, .Name = "Rome"},
                            New City() With {.CountryId = 2, .Name = "Naples"},
                            New City() With {.CountryId = 2, .Name = "Milan"},
                            New City() With {.CountryId = 1, .Name = "Lyon"},
                            New City() With {.CountryId = 1, .Name = "Marseille"},
                            New City() With {.CountryId = 1, .Name = "Paris"},
                            New City() With {.CountryId = 3, .Name = "Kharkov"},
                            New City() With {.CountryId = 3, .Name = "Lviv"},
                            New City() With {.CountryId = 3, .Name = "Kiev"}
                        }
                End Get
            End Property
        End Class
        Private _CityList As List(Of City)
    
        Private Sub Caroption_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Dim ops As New Operations
    
            CheckedListBox1.DataSource = ops.Countries
            _CityList = ops.Cities
        End Sub
    
        Private Sub CheckedListBox1_ItemCheck(sender As Object, e As ItemCheckEventArgs) Handles CheckedListBox1.ItemCheck
            If e.NewValue = CheckState.Checked Then
                For x As Integer = 0 To CheckedListBox1.Items.Count - 1
                    If x <> e.Index Then
                        CheckedListBox1.SetItemChecked(x, False)
    
                    End If
                Next
                ComboBox1.Items.Clear()
                Dim item As Country = CType(CType(sender, CheckedListBox).Items(e.Index), Country)
    
                Dim results = _CityList.Where(Function(c) c.CountryId = item.Id).ToList()
    
                For Each city In results
                    ComboBox1.Items.Add(city.Name)
    
                Next
            End If
    
    
        End Sub
    
    
    
    
    
    
        Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
            Me.Hide()
            Details.Show()
        End Sub
    
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            Me.Close()
    
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    
            FinalForm.txtcounry.Text = CheckedListBox1.Text
            FinalForm.txtcity.Text = ComboBox1.SelectedItem
            FinalForm.TextBox1.Text = Details.txtfirstname1.Text
            FinalForm.TextBox2.Text = Details.txtsecondname.Text
            FinalForm.TextBox5.Text = Details.txtaddres.Text
            FinalForm.TextBox3.Text = Details.txtpostcode.Text
            FinalForm.TextBox4.Text = Details.txtemail.Text
            FinalForm.TextBox9.Text = start.Value
            FinalForm.TextBox10.Text = dtpend.Value
    
            Me.Hide()
            FinalForm.Show()
    
        End Sub
    
        Private Sub CheckBox140_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox140.CheckedChanged
            Dim valsub As Integer
            Dim txtvatint As Integer
    
            If CheckBox140.Checked Then
                FinalForm.TextBox6.Text = Val(txtdate.Text) * 140
                valsub = Val(txtdate.Text) * 140
                FinalForm.TextBox7.Text = valsub * 0.2
                txtvatint = valsub * 0.2
                FinalForm.TextBox8.Text = txtvatint + valsub
    
            End If
        End Sub
    
        Private Sub CheckBox190_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox190.CheckedChanged
            Dim valsub As Integer
            Dim txtvatint As Integer
    
            If CheckBox190.Checked Then
                FinalForm.TextBox6.Text = Val(txtdate.Text) * 190
                valsub = Val(txtdate.Text) * 190
                FinalForm.TextBox7.Text = valsub * 0.2
                txtvatint = valsub * 0.2
                FinalForm.TextBox8.Text = txtvatint + valsub
    
            End If
        End Sub
    
    
        Private Sub CheckBox250_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox250.CheckedChanged
            Dim valsub As Integer
            Dim txtvatint As Integer
    
            If CheckBox250.Checked Then
                FinalForm.TextBox6.Text = Val(txtdate.Text) * 250
                valsub = Val(txtdate.Text) * 250
                FinalForm.TextBox7.Text = valsub * 0.2
                txtvatint = valsub * 0.2
                FinalForm.TextBox8.Text = txtvatint + valsub
    
            End If
        End Sub
    
    
    
    
        Private Sub DateTimePicker1_ValueChanged(sender As Object, e As EventArgs) Handles start.ValueChanged
    
        End Sub
    
        Private Sub Calculate_Click(sender As Object, e As EventArgs) Handles Calculate.Click
            Dim diff As String
            Dim startdate, enddate As Date
            startdate = start.Value
            enddate = dtpend.Value
            diff = DateDiff(DateInterval.Day, startdate, enddate)
            txtdate.Text = diff
        End Sub
    End Class

    Friday, November 23, 2018 8:18 PM