Aplicaciones del cálculo de costos
Imports System.Data.SqlClient
Partial Class _Default Inherits System.Web.UI.Page Dim conexion As New SqlConnection("Data Source=TELMEX0;Initial Catalog=Computadoras;Integrated Security=True") Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click MultiView1.ActiveViewIndex = 0 End Sub
Protected Sub ImageButton2_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton2.Click MultiView1.ActiveViewIndex = 1 TextBox7.Text = GridView1.SelectedRow.Cells(2).Text TextBox8.Text = GridView1.SelectedRow.Cells(3).Text TextBox9.Text = …ver más…
stem.EventArgs) Handles GridView1.SelectedIndexChanged End Sub Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click If MsgBox("Desea Eliminarlo", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "Ojo") = MsgBoxResult.Yes Then
Dim strcad As String strcad = String.Format("delete from accesorios where id={0}", TextBox13.Text) Dim comando As New SqlCommand(strcad, conexion) Try conexion.Open() comando.ExecuteNonQuery() conexion.Close() Call llenagrid() MultiView1.ActiveViewIndex = -1 Catch ex As Exception MsgBox(ex.Message) End Try End If
End Sub
Protected Sub Button6_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button6.Click MultiView1.ActiveViewIndex = -1 End Sub
Protected Sub Button5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.Click Dim strcad As String strcad = String.Format("update accesorios set marca='{0}', color='{1}', serie='{2}', precio={3},existencias={4}, nombre= '{5}' where id={6}", TextBox14.Text, TextBox15.Text, TextBox16.Text, TextBox17.Text, TextBox18.Text, TextBox19.Text, TextBox20.Text) Dim comando As New SqlCommand(strcad, conexion) Try conexion.Open()