Skip to content

Instantly share code, notes, and snippets.

View riccardopirani's full-sized avatar

riccardop riccardopirani

View GitHub Profile
@riccardopirani
riccardopirani / default.conf
Created May 20, 2017 15:26 — forked from HariantoAtWork/default.conf
Docker Nginx FPM MySql
server {
listen 80 default_server;
listen [::]:80 default_server;
root /vhosts/_default_/httpdocs;
index index.html index.htm index.php;
server_name _;
@riccardopirani
riccardopirani / User.swift
Created June 6, 2017 18:28
Error on unwrapping string email and password
//
// User.swift
// GeneratorPass
//
// Developer: http://riccardopirani.altervista.org
// Created by riccardo
// Copyright © 2016 ViewSoftware. All rights reserved.
// Software House: http://viewsoftware.it
import Foundation
@riccardopirani
riccardopirani / Error
Last active October 17, 2017 08:54
Sql Server with C error with Image
Image of Error: https://imgur.com/a/iNfK9
C# Code:
-------------------------First.cs ---------------------------------------------------------------------
if (comboBoxStampe.Text == "Stampa con Prezzo")
{
if (checkedListBoxCosaStampare.CheckedItems.Count > 0)
@riccardopirani
riccardopirani / Basic.cs
Created October 24, 2017 07:36
Error must declare the scalar variable @immagine
private void pictureBoxImmagineDistinta_DoubleClick(object sender, EventArgs e)
{
SqlConnection conn = db.apriconnessione();
try
{
Image imm;
OpenFileDialog of = new OpenFileDialog();
of.Filter = "Image Files (*.bmp;*.jpg;*.jpeg,*.png)|*.BMP;*.JPG;*.JPEG;*.PNG";
if (of.ShowDialog() == DialogResult.OK)
@riccardopirani
riccardopirani / Insert.cs
Last active October 25, 2017 09:55
GDI+ error C#
private void pictureBoxImmagineDistinta_DoubleClick(object sender, EventArgs e)
{
SqlConnection conn = db.apriconnessione();
try
{
Image imm;
OpenFileDialog of = new OpenFileDialog();
of.Filter = "Image Files (*.bmp;*.jpg;*.jpeg,*.png)|*.BMP;*.JPG;*.JPEG;*.PNG";
if (of.ShowDialog() == DialogResult.OK)
@riccardopirani
riccardopirani / Print.cs
Created November 20, 2017 14:33
Print.cs
try {
Preventivi p = new Preventivi(int.Parse(IdPreventivo));
p.db = this.db;
String Query = "SELECT Preventivo.IdPreventivo,Utente.LogoAzienda,convert(VARCHAR(10),Preventivo.DataInserimento,105) as DataInserimento,Preventivo.RiferimentoInterno,Preventivo.Testata,Preventivo.Chiusura,Cliente.Titolo,Cliente.RagioneSociale,Cliente.Indirizzo,Cliente.Cap,Cliente.Citta,Cliente.Provincia FROM Preventivo inner join Cliente on Cliente.IdCliente = Preventivo.IdCliente inner join Utente on Preventivo.UtenteCreazione = Utente.Username where Preventivo.IdPreventivo='" + IdPreventivo + "' ";
String Query2 = "DECLARE @T AS table( Descrizione varchar(5000), NumeroCapitolo varchar(100), SottoCapitolo1 varchar(5000), SottoCapitolo2 varchar(5000), SottoCapitolo3 varchar(5000), Totale money, DescrizioneEstesa varchar(5000), Images Image, CostoUnitario money, Quantita money, DescrizioneDis varchar(5000)); INSERT INTO @T SELECT Capitolo.Descrizi
@riccardopirani
riccardopirani / Insert.cs
Last active November 22, 2017 09:31
SqlException
String QuerySalvataggioElementi = "Insert into ComponenteOrdine(IdOrdine,CodArt,Descrizione,UM,Quantita) values(@IdOrdine,@CodArt,@Descrizione,@UM,@Quantita)";
cmd = new SqlCommand(QuerySalvataggioElementi, conn);
for (int i = 0; i < dataGridViewArticoli.Rows.Count; i++)
{
//Controllo se l'articolo è "chekkato prima di aggiungerlo nella tabella temporanea"
if (Convert.ToBoolean(dataGridViewArticoli.Rows[i].Cells[6].Value) == true)
{
cmd.Parameters.AddWithValue(string.Format("@IdOrdine{0}", i), IdOrdine);
cmd.Parameters.AddWithValue(string.Format("@CodArt{0}", i), dataGridViewArticoli.Rows[i].Cells["Codice"].Value.ToString());
cmd.Parameters.AddWithValue(string.Format("@Descrizione{0}", i), dataGridViewArticoli.Rows[i].Cells["Descrizione"].Value.ToString());
@riccardopirani
riccardopirani / class.cs
Created November 27, 2017 07:26
Gdi+ error
Image imm;
OpenFileDialog of = new OpenFileDialog();
of.Filter = "Image Files (*.bmp;*.jpg;*.jpeg,*.png)|*.BMP;*.JPG;*.JPEG;*.PNG";
if (of.ShowDialog() == DialogResult.OK)
{
pictureBoxImmagineDistinta.ImageLocation = of.FileName;
imm = pictureBoxImmagineDistinta.Image;
String PathImage = pictureBoxImmagineDistinta.ImageLocation;
@riccardopirani
riccardopirani / Main.cs
Created December 12, 2017 09:27
Order by error on Sql Server
SET LANGUAGE 'Italian' select Tipo, Data , GG, CodArt as 'CodArt',Descrizione,Quantita as 'Quantita',Prezzo,Totale from (
Select 'R' as Tipo, CONVERT(VARCHAR(10), RisorseUmane.Data, 105) as Data, DATENAME(WEEKDAY, RisorseUmane.Data) as GG, 'Utente' as CodArt, RisorseUmane.Descrizione, PARSE(REPLACE(convert(varchar(5), Cast(convert(varchar(5), (OreFine - OreInizio), 108) as datetime) - CAST(REPLACE(Pausa, '.', ':') as datetime), 108),':',',') as money) as Quantita, Utente.CostoInterno as Prezzo, (Utente.CostoInterno* Replace(convert(varchar(5), Cast(convert(varchar(5), (OreFine - OreInizio), 108) as datetime) - CAST(REPLACE(Pausa, '.', ':') as datetime), 108),':', ',')/100) as Totale from RisorseUmane inner join Utente on RisorseUmane.IdUtente = Utente.IdUtente where IdCantiere = '131'
/*.....*/
)Q
ORDER BY Data ASC
@riccardopirani
riccardopirani / server.js
Last active December 28, 2017 16:23
how to extrapolate the parameters of the Json request
//Correctly Version
//Import the necessary libraries/declare the necessary objects
var express = require("express");
var myParser = require("body-parser");
var app = express();
//Login