Ejemplo n.º 1
0
 public MainPageVM()
 {
    _bands = Band.getBands();
    _uniekeDagen = Festival.aantalDagen();
  // _stagesPerDag = Stage.GetStagesByDay(SelectedDag);
    _podiums = Stage.GetStages();
     _lineUp = new LineUp();
    
 }
Ejemplo n.º 2
0
   private static LineUp CreateLineUp(DbDataReader reader)
 {
     LineUp lineup = new LineUp();
     lineup.ID = Convert.ToString(reader["lineup_id"]);
     lineup.Date = Convert.ToDateTime(reader["lineup_date"]);
     lineup.From = Convert.ToDateTime(reader["lineup_from"]);
     lineup.Until = Convert.ToDateTime(reader["lineup_until"]);
     //lineup.Stage = //een methode die de stage name ophaalt -> enkel name (string) is genoeg
     lineup.band = Band.GetBandByID(Convert.ToInt32(reader["lineup_band"]));
     return lineup;
 }
Ejemplo n.º 3
0
        public static LineUp GetLineUpByID(int id)
        {
            LineUp gevondenLineUp = new LineUp();
            DbParameter paramid = Database.AddParameter("@ID", id);
            string sql = "SELECT * FROM lineup WHERE lineup_id = @ID";
            DbDataReader reader = Database.GetData(sql,paramid);
            while (reader.Read())
            {
                gevondenLineUp = CreateLineUp(reader);
            }

            return gevondenLineUp;
        }
Ejemplo n.º 4
0
        public static void AddLineUp(LineUp lineup)
        {
            string sql = "INSERT INTO lineup(lineup_date, lineup_from, lineup_until, lineup_stage, lineup_band) VALUES (@date, @from, @until, @stageid, @bandid);";
            string from = lineup.From.ToShortTimeString();
            string until = lineup.Until.ToShortTimeString();
            DbParameter par1 = Database.AddParameter("@date", lineup.Date);
            DbParameter par2 = Database.AddParameter("@from", from);
            DbParameter par3 = Database.AddParameter("@until",until );
            DbParameter par4 = Database.AddParameter("@stageid", lineup.stage.ID);
            DbParameter par5 = Database.AddParameter("@bandid", lineup.band.ID);

            int i = Database.ModifyData(sql, par1, par2, par3, par4, par5);
            if (i == 0)
            {
                MessageBox.Show("Toevoegen mislukt", "Error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error, System.Windows.MessageBoxResult.OK);
            }
            Console.WriteLine(i + " row(s) are affected");
        }