Exemplo n.º 1
0
        public AlbumControl(Album album)
        {
            InitializeComponent();
            Album = album;

            Controller = new AlbumController(this);
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
        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;
        }
Exemplo n.º 7
0
 partial void DeleteAlbum(Album instance);
Exemplo n.º 8
0
 partial void UpdateAlbum(Album instance);
Exemplo n.º 9
0
 partial void InsertAlbum(Album instance);
Exemplo n.º 10
0
		private void detach_Albums(Album entity)
		{
			this.SendPropertyChanging();
			entity.Artist = null;
		}
Exemplo n.º 11
0
		private void attach_Albums(Album entity)
		{
			this.SendPropertyChanging();
			entity.Artist = this;
		}
Exemplo n.º 12
0
 public void AddAlbum(Album album)
 {
     albums.Add(album);
 }