コード例 #1
0
 public bool InserProd(string CodigoGenerico, string nombre, string marca, string modelo, string numeroFactura, string precio, string fechaCompra)
 {
     try
     {
         string     sql = "insert into Producto values ('" + CodigoGenerico + "', '" + nombre + "', '" + marca + "', '" + modelo + "', '" + numeroFactura + "', " + precio + ", '" + fechaCompra + "');";
         SqlCommand cmd = new SqlCommand(sql, cn.getConexion());
         int        n   = cmd.ExecuteNonQuery();
         return(n > 0);
     }
     catch (Exception)
     {
         return(false);
     }
 }
コード例 #2
0
 public bool InserTrab(string rut, string nombre, string apellidop, string apellidom, string clave, string fecha, string cargo)
 {
     try
     {
         string     sql = "insert into Trabajador values ('" + rut + "', '" + clave + "', '" + nombre + "', '" + apellidop + "', '" + apellidom + "', '" + fecha + "', " + cargo + ");";
         SqlCommand cmd = new SqlCommand(sql, cn.getConexion());
         int        n   = cmd.ExecuteNonQuery();
         return(n > 0);
     }
     catch (Exception)
     {
         return(false);
     }
 }
コード例 #3
0
 public bool InserContrato(string descripcion)
 {
     try
     {
         string     sql = "insert into Contrato values ('" + descripcion + "');";
         SqlCommand cmd = new SqlCommand(sql, cn.getConexion());
         int        n   = cmd.ExecuteNonQuery();
         return(n > 0);
     }
     catch (Exception)
     {
         return(false);
     }
 }
コード例 #4
0
 public bool InserPres(string fecha, string fechaEntrega, string observacion, string estado, string idtipoPrestamo, string idProducto, string idTrabajador, string idUsuario)
 {
     try
     {
         string     sql = "insert into Prestamo values ('" + fecha + "', '" + fechaEntrega + "', '" + observacion + "', '" + estado + "', " + idtipoPrestamo + ", " + idProducto + ", " + idTrabajador + ", " + idUsuario + ");";
         SqlCommand cmd = new SqlCommand(sql, cn.getConexion());
         int        n   = cmd.ExecuteNonQuery();
         return(n > 0);
     }
     catch (Exception)
     {
         return(false);
     }
 }