Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports misFunciones
- Imports System.IO
- Imports System.Xml.Serialization
- Public Class Form1
- Private Sub btnOtra_Click(sender As Object, e As EventArgs) Handles btnOtra.Click
- txtSimple.Clear()
- txtDoble.Clear()
- txtTriple.Clear()
- lblSimple.Text = "$0.00"
- lblDoble.Text = "$0.00"
- lblTriple.Text = "$0.00"
- lblTotal.Text = "$0.00"
- txtSimple.Focus()
- End Sub
- Private Sub btnGenerar_Click(sender As Object, e As EventArgs) Handles btnGenerar.Click
- For Each c In Me.Controls
- If TypeOf c Is TextBox Then
- If c.Text.trim = "" Then
- c.text = "0"
- End If
- End If
- Next
- lblSimple.Text = "$" + Funciones.subtotal(CInt(txtSimple.Text), Val(lblPrecioSimple.Text.Substring(1))).ToString("0.00")
- lblDoble.Text = "$" + Funciones.subtotal(CInt(txtDoble.Text), Val(lblPrecioDoble.Text.Substring(1))).ToString("0.00")
- lblTriple.Text = "$" + Funciones.subtotal(CInt(txtTriple.Text), Val(lblPrecioTriple.Text.Substring(1))).ToString("0.00")
- Dim v(0 To 2) As Double
- v(0) = Val(lblSimple.Text.Substring(1))
- v(1) = Val(lblDoble.Text.Substring(1))
- v(2) = Val(lblTriple.Text.Substring(1))
- lblTotal.Text = "$" + Funciones.calcularTotal(v).ToString("0.00")
- End Sub
- Private Sub btnXML_Click(sender As Object, e As EventArgs) Handles btnXML.Click
- Dim sv As New SaveFileDialog
- sv.Filter = "Archivo XML|*.xml"
- Try
- If sv.ShowDialog Then
- Using fs As New FileStream(sv.FileName, FileMode.Create)
- Dim p As New Pedido
- With p
- .subtotalSimple = CDbl(lblSimple.Text.Substring(1))
- .subtotalDoble = CDbl(lblDoble.Text.Substring(1))
- .subtotalTriple = CDbl(lblTriple.Text.Substring(1))
- .montoTotal = CDbl(lblTotal.Text.Substring(1))
- End With
- Dim xml As New XmlSerializer(GetType(Pedido))
- xml.Serialize(fs, p)
- End Using
- End If
- Catch ex As Exception
- End Try
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement