コード例 #1
0
        public AlbumControl(Album album)
        {
            InitializeComponent();
            Album = album;

            Controller = new AlbumController(this);
        }
コード例 #2
0
ファイル: frmReports.cs プロジェクト: NimaGhaedsharafi/azDB93
        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;
        }
コード例 #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();
        }
コード例 #4
0
ファイル: AlbumController.cs プロジェクト: Jazastry/SoftUni
        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);
        }
コード例 #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;
        }
コード例 #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;
        }
コード例 #7
0
 partial void DeleteAlbum(Album instance);
コード例 #8
0
 partial void UpdateAlbum(Album instance);
コード例 #9
0
 partial void InsertAlbum(Album instance);
コード例 #10
0
		private void detach_Albums(Album entity)
		{
			this.SendPropertyChanging();
			entity.Artist = null;
		}
コード例 #11
0
		private void attach_Albums(Album entity)
		{
			this.SendPropertyChanging();
			entity.Artist = this;
		}
コード例 #12
0
ファイル: Artist.cs プロジェクト: Kaike23/ForeignKeyMapper
 public void AddAlbum(Album album)
 {
     albums.Add(album);
 }