Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table Credito(
- id_credito int primary key identity,
- id_cliente int,
- id_Usuario int,
- concepto varchar(40) not null,
- descripcion varchar(150) not null,
- cantidad_credito float not null,
- fecha_inicio date not null,
- tipo_cuota varchar(10) not null,
- fecha_fin date not null,
- cantidad_cuotas int not null,
- cantidad_mensual float not null,
- estado_credito char(1) not null,
- estado_mora int not null,
- numero_credito int,
- saldo float,
- check (estado_credito='C' or estado_credito='P'),
- check (estado_mora=1 or estado_mora=0),
- check (tipo_cuota='quincenal' or tipo_cuota='mensual'),
- constraint fk_ic foreign key(id_cliente) references Cliente,
- constraint fk_iu foreign key(id_Usuario) references Usuario
- );
- Public Class Datos
- Dim conex As New SqlConnection
- Dim conectar As String = "Data Source=Desktop-sigtqcfmyserver;Initial Catalog=ProyectoFinal2;Integrated Security=True"
- Public Sub New()
- Try
- conex.ConnectionString = conectar
- Catch ex As SqlException
- MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
- End Try
- End Sub
- //Esta es la función que utilizo para actualizar los registros
- Public Sub Actualizar(tabla As String, campos_valores As String, condicion As String)
- Try
- conex.Open()
- Dim cmd As New SqlCommand("update " & tabla & " set " & campos_valores & " where " & condicion, conex)
- cmd.ExecuteNonQuery()
- Catch ex As Exception
- MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
- Finally
- conex.Close()
- End Try
- End Sub
- End Class
- Public Class Pagos
- Dim obj as New Datos
- Public Sub ActualizarPago()
- If meses >= 1 Then
- cantMora = meses * precioMora **PrecioMora equivale a 2.5**
- tabla = "Credito"
- campos_valores = "Saldo=" & cantMora + saldoPend
- condicion = "numero_credito=" & numero_factura
- obj.Actualizar(tabla, campos_valores, condicion)
- End If
- End Sub
- End Class
- Dim oldString As String = "32,3"
- ' Returns "Shipping List".
- Dim newString As String = Replace(TestString, ",", ".")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement