public ReportModel() { _bands.Add(new Band(BandEnum.PageHeaderBand)); _bands.Add(new Band(BandEnum.PageHeaderBand)); _bands.Add(new Band(BandEnum.PageHeaderBand)); _bands.Add(new Band(BandEnum.PageDetailBand)); _bands.Add(new Band(BandEnum.PageFooterBand)); _bands.Add(new Band(BandEnum.PageFooterBand)); _bands.Add(new Band(BandEnum.SummaryBand)); }
public void SaveBand() { try { string sql = "INSERT INTO Bands(Name,Picture,Description,Facebook,Twitter) VALUES (@Name,@Picture,@Description,@Facebook,@Twitter);"; DbParameter parName = Database.AddParameter("@Name", NewBand.Name); DbParameter parPicture = Database.AddParameter("@Picture", NewBand.Picture); DbParameter parDescription = Database.AddParameter("@Description", NewBand.Description); DbParameter parFacebook = Database.AddParameter("@Facebook", NewBand.Facebook); DbParameter parTwitter = Database.AddParameter("@Twitter", NewBand.Twitter); Database.ModifyData(sql, parName, parPicture, parDescription, parFacebook, parTwitter); BandList.Add(NewBand); BandList = Band.GetBands(); MessageBox.Show("Artiest werd succesvol toegevoegd"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }