public int Agregar(ClientesBO Cliente) { SqlCommand sqlCommand = new SqlCommand("INSERT INTO Clientes VALUES(@nombre, @apellido,@telefono)"); sqlCommand.Parameters.Add("@nombre", SqlDbType.VarChar).Value = Cliente.Nombre; sqlCommand.Parameters.Add("@apellido", SqlDbType.VarChar).Value = Cliente.Apellido; sqlCommand.Parameters.Add("@telefono", SqlDbType.VarChar).Value = Cliente.Telefono; return(Conexion.EjecutarComando(sqlCommand)); }
public int Agregar(SimulacionBO simulacion) { SqlCommand command = new SqlCommand("insert into Simulaciones values(@idCliente, @Monto, @Taza, @Plazo, @FechaIni)"); command.Parameters.Add("@idCliente", SqlDbType.Int).Value = simulacion.CodigoCliente; command.Parameters.Add("@Monto", SqlDbType.Real).Value = simulacion.Monto; command.Parameters.Add("@Taza", SqlDbType.Real).Value = simulacion.TazaInteres; command.Parameters.Add("@Plazo", SqlDbType.Int).Value = simulacion.PlazoPago; command.Parameters.Add("@FechaIni", SqlDbType.Date).Value = simulacion.FechaIncio.ToString("yyyy/MM/dd"); return(Conexion.EjecutarComando(command)); }