Example #1
0
 public List<Movimento> cercaMovimentiScaduti()
 {
     OleDbConnection conn = new OleDbConnection(Properties.Settings.Default.scadenzettiDbConnectionString);
     string queryString = "SELECT * FROM QueryMovimentiUntil";
     OleDbCommand cmd = new OleDbCommand(queryString, conn);
     cmd.Parameters.Add("DataScadenza", OleDbType.Date).Value = DateTime.Today;
     conn.Open();
     OleDbDataReader reader = cmd.ExecuteReader();
     List<Movimento> list = new List<Movimento>();
     while (reader.Read())
     {
         Movimento mov = new Movimento();
         mov.DataScadenza = DateTime.Parse(reader[0].ToString());
         mov.Tipo = reader[1].ToString();
         mov.ImportoIvato = decimal.Parse(reader[2].ToString());
         Utente u = new Utente();
         u.Nome = reader[3].ToString();
         mov.Utente = u;
         Destinatario d = new Destinatario();
         d.Nome = reader[4].ToString();
         mov.Destinatario = d;
         mov.Id = int.Parse(reader[5].ToString());
         list.Add(mov);
     }
     reader.Close();
     conn.Close();
     return list;
 }
Example #2
0
 public void addMovimento(Movimento m)
 {
     this._movimenti.Add(m);
 }