client/Reportes/FrmParamSITI.vb

117 lines
3.5 KiB
VB.net
Raw Normal View History

Public Class FrmParamSITI
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
End Sub
Private Sub FrmParamSITI_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim Classcom As New clsComplejo
Dim SQL As String
Dim ClassMy As New ClassMyUtils
SQL = "SELECT * FROM PARAMETROSSITI"
Classcom.fdtDataSet(SQL)
If Classcom.ds.Tables(0).Rows.Count <> 0 Then
TXTOrganismo.Text = ClassMy.ISNull(Classcom.ds.Tables(0).Rows(0).Item("ClaveOrganismo"), 0)
TXTIns.Text = ClassMy.ISNull(Classcom.ds.Tables(0).Rows(0).Item("Claveins"), 0)
TXTRutaRelevantes.Text = ClassMy.ISNull(Classcom.ds.Tables(0).Rows(0).Item("rutarelevantes"), "")
TXTRutaInu.Text = ClassMy.ISNull(Classcom.ds.Tables(0).Rows(0).Item("rutainusuales"), "")
TXTRutaPre.Text = ClassMy.ISNull(Classcom.ds.Tables(0).Rows(0).Item("rutapreocupantes"), "")
End If
Catch er As Exception
MessageBox.Show(er.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub BTRutaRel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTRutaRel.Click
Try
FolderBrowser.ShowDialog()
TXTRutaRelevantes.Text = FolderBrowser.SelectedPath.ToString
Catch ex As Exception
End Try
End Sub
Private Sub BTRutaInu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTRutaInu.Click
FolderBrowser.ShowDialog()
TXTRutaInu.Text = FolderBrowser.SelectedPath.ToString
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTPre.Click
FolderBrowser.ShowDialog()
TXTRutaPre.Text = FolderBrowser.SelectedPath.ToString
End Sub
Private Sub BTSalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTSalir.Click
Me.Close()
End Sub
Private Sub BTGrabar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTGrabar.Click
Dim SQL As String
Dim CLASSCOM As New clsComplejo
Try
SQL = "SELECT * FROM PARAMETROSSITI "
CLASSCOM.fdtDataSet(SQL)
If CLASSCOM.ds.Tables(0).Rows.Count <> 0 Then
SQL = "UPDATE PARAMETROSSITI SET claveorganismo = " & TXTOrganismo.Text & ", CLAVEINS = " & TXTIns.Text & ","
SQL = SQL & " RUTARELEVANTES = '" & TXTRutaRelevantes.Text & "', RUTAINUSUALES = '" & TXTRutaInu.Text & "',"
SQL = SQL & " RUTAPREOCUPANTES = '" & TXTRutaPre.Text & "'"
CLASSCOM.sbInserta(SQL)
Else
SQL = "INSERT INTO PARAMETROSSITI (CLAVEORGANISMO,CLAVEINS,RUTARELEVANTES,RUTAINUSUALES,RUTAPREOCUPANTES )"
SQL = SQL & " VALUES (" & TXTOrganismo.Text & "," & TXTIns.Text & ",'" & TXTRutaRelevantes.Text & "',"
SQL = SQL & "'" & TXTRutaInu.Text & "','" & TXTRutaPre.Text & "')"
CLASSCOM.sbInserta(SQL)
End If
Catch er As Exception
MessageBox.Show(er.Message, "MINDS", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
End Class