public AlbumControl(Album album) { InitializeComponent(); Album = album; Controller = new AlbumController(this); }
private void crystalReportViewer1_Load(object sender, EventArgs e) { Model.Album da = new Model.Album(); ReportDocument rc = new ReportDocument(); rc.FileName = "albums.rpt"; rc.SetDataSource(da.getQuery()); crystalReportViewer1.ReportSource = rc; }
private void AlbumsReport_Load(object sender, EventArgs e) { ReportDocument rd = new ReportDocument(); rd.Load(@"E:\Programming\Windows Programming\C#\AzDBStructure\AzDBStructure\albums\Albums.rpt"); Model.Album ma = new Model.Album(); rd.SetDataSource(ma.getQuery()); crystalReportViewer1.ReportSource = rd; crystalReportViewer1.Refresh(); }
public IHttpActionResult CreateAlbum([FromUri]AlbumsCreateBindingModel model) { if (model == null) { return BadRequest(); } Album album = new Album() { Title = model.Title, Producer = model.Producer, Year = model.Year }; context.Albums.Add(album); context.SaveChanges(); return Ok(album); }
private Guid GetAlbum(Guid artistId, Tag tag, ref Repository repo) { Guid id; lock (albumLock) { var album = repo.Albums.FirstOrDefault(x => x.ArtistId == artistId && x.Name == tag.Album); if (album == null) { album = new Album {Id = Guid.NewGuid()}; album.MBID = string.IsNullOrEmpty(tag.MusicBrainzReleaseId) ? (Guid?) null : new Guid(tag.MusicBrainzReleaseId); album.Name = tag.Album; album.ArtistId = artistId; repo.Albums.InsertOnSubmit(album); repo.SubmitChanges(); } id = album.Id; } return id; }
public override List<Model.Album> ShowOnlyPublic() { var result = new List<Model.Album>(); String strConnString = System.Configuration.ConfigurationManager.ConnectionStrings["Sql"].ConnectionString; SqlCommand cmd = new SqlCommand("PublicOnly"); DataTable dt = new DataTable(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@published", true); SqlConnection cn = new SqlConnection(strConnString); cmd.Connection = cn; cn.Open(); SqlDataAdapter sda = new SqlDataAdapter(); sda.SelectCommand = cmd; sda.Fill(dt); sda.Dispose(); cn.Close(); foreach (DataRow row in dt.Rows) { var album = new Model.Album(); album.AlbumName = (string)row["AlbumName"]; album.AlbumID = (int)row["AlbumID"]; album.Description = (string)row["Description"]; album.IsPublished = (bool)row["IsPublished"]; album.UserName = (string)row["UserName"]; result.Add(album); } return result; }
partial void DeleteAlbum(Album instance);
partial void UpdateAlbum(Album instance);
partial void InsertAlbum(Album instance);
private void detach_Albums(Album entity) { this.SendPropertyChanging(); entity.Artist = null; }
private void attach_Albums(Album entity) { this.SendPropertyChanging(); entity.Artist = this; }
public void AddAlbum(Album album) { albums.Add(album); }