public FileUtente(string nome_utente, int id) : base() { l = Log.getLog(); this.id = id; //Miglioramenti futuri: rendere questo valore personalizzabile per utente. __snapshot_per_file = Properties.ApplicationSettings.Default.snapshot_per_file; __snapshots = new SnapshotList(id); string[][] parameters = new string[2][]; parameters[0] = new string[2] { "@id", id.ToString() }; parameters[1] = new string[2] { "@nome_utente", nome_utente }; this.ExecuteQuery(sql_get_file_data, parameters); if (this.hasResults()) { //Get the data foreach (Int32 i in GetResults()) { this.__nome_file_c = (string)(this.ResultGetValue("nome_file_c")); DateTime utctCreaz = (DateTime)(this.ResultGetValue("t_creazione")); this.__t_creazione = utctCreaz.ToUniversalTime(); this.__path_relativo_c = (string)(this.ResultGetValue("path_relativo_c")); this.__valido = (bool)(this.ResultGetValue("valido")); this.__nome_utente = nome_utente; } } else { throw new DatabaseException("Impossibile ottenere i dati del FileUtente richiesto.", DatabaseErrorCode.NoDati); } }
public FileUtente(string nome_utente, int id) : base() { l = Log.getLog(); this.id = id; //Miglioramenti futuri: rendere questo valore personalizzabile per utente. __snapshot_per_file = Properties.ApplicationSettings.Default.snapshot_per_file; __snapshots = new SnapshotList(id); string[][] parameters = new string[2][]; parameters[0] = new string[2] { "@id", id.ToString() }; parameters[1] = new string[2] { "@nome_utente", nome_utente }; this.ExecuteQuery(sql_get_file_data, parameters); if (this.hasResults()) { //Get the data foreach (Int32 i in GetResults()) { this.__nome_file_c = (string)(this.ResultGetValue("nome_file_c")); DateTime utctCreaz = (DateTime)(this.ResultGetValue("t_creazione")); this.__t_creazione = utctCreaz.ToUniversalTime(); this.__path_relativo_c = (string)(this.ResultGetValue("path_relativo_c")); this.__valido = (bool)(this.ResultGetValue("valido")); this.__nome_utente = nome_utente; } } else { throw new DatabaseException("Impossibile ottenere i dati del FileUtente richiesto.", DatabaseErrorCode.NoDati); } }