예제 #1
0
 public void ToModel(album a)
 {
     ArtistID  = a.artist_id;
     AlbumName = a.albumName;
     AlbumID   = a.id;
     GenreID   = a.genre_id;
 }
예제 #2
0
파일: UnitTest1.cs 프로젝트: quamv/chinook
        public void add_sample_data(ChinookDbContext db)
        {
            var digital_download = new media_type()
            {
                Name = "Digital Download"
            };
            var rock_genre = new genre()
            {
                Name = "Rock"
            };
            var new_artist = new artist()
            {
                Name = "Bob Sacamano"
            };
            var new_album = new album()
            {
                Title = "My stuff 2018", Artist = new_artist
            };
            var new_track = new track()
            {
                Name = "Bad Medicine", Album = new_album, Genre = rock_genre, MediaType = digital_download
            };
            var new_playlist = new playlist()
            {
                PlaylistId = 0, Name = "Test playlist"
            };
            var ref_playlist_track = new playlist_track()
            {
                playlist = new_playlist, track = new_track
            };

            new_playlist.tracks.Add(ref_playlist_track);
            db.playlist_tracks.Add(ref_playlist_track);
            db.SaveChanges();
        }
예제 #3
0
        public async Task <ActionResult> Edit([Bind(Include = "album_id,singer_id,album_name,album_createdate,album_image")] album album, HttpPostedFileBase Upload)
        {
            if (ModelState.IsValid)
            {
                var path = "";
                var file = Request.Files[0];
                if (file != null && file.ContentLength > 0)
                {
                    string _FileName = Path.GetFileName(file.FileName);
                    string _Ext      = Path.GetExtension(file.FileName);
                    path = Path.Combine(Server.MapPath("~/source/images/"), _FileName);
                    // Kiễm tra tồn tại file.
                    if (System.IO.File.Exists(path))
                    {
                        System.IO.File.Delete(path);
                    }
                    album.album_image      = "~/source/images/" + _FileName;
                    album.album_createdate = DateTime.Now;
                    Upload.SaveAs(path);
                }
                db.Entry(album).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.singer_id = new SelectList(db.singers, "singer_id", "singer_name", album.singer_id);
            return(View());
        }
예제 #4
0
        public ActionResult Alterar(int id, album collection)
        {
            try
            {
                // TODO: Add update logic here
                if (ModelState.IsValid)
                {
                    var albumObj = collection;
                    string imgPath = Server.MapPath("/Content/");
                    var postedFile = Request.Files[0];

                    if (postedFile != null && postedFile.InputStream.Length > 0)
                    {
                        Stream foto = postedFile.InputStream;
                        albumObj = _albumService.SalvarThumbnail(foto, imgPath, albumObj);
                    }
                    _albumService.UpdateAlbum(albumObj);
                    return RedirectToAction("Index");
                }
                return View(collection);
            }
            catch
            {
                return View();
            }
        }
예제 #5
0
        public IActionResult ListAlbumPhoto(string albumCode)
        {
            album album  = _context.album.SingleOrDefault(m => m.album_code == albumCode);
            var   abName = album.album_name;
            var   abDesc = album.album_desc;

            var uploads = Path.Combine(_env.WebRootPath, _configuration.GetSection("Paths").GetSection("images_album").Value);

            uploads = Path.Combine(uploads, albumCode);
            string[]     fileEntries = Directory.GetFiles(uploads);
            List <photo> p = new List <photo>();
            string       fiN; string fiP;

            foreach (string fileName in fileEntries)
            {
                fiN = Path.GetFileName(fileName);
                fiP = Path.Combine(albumCode, fiN);
                fiP = Path.Combine(_configuration.GetSection("Paths").GetSection("images_album").Value, fiP);
                p.Add(new photo {
                    albumCode = albumCode, image_code = "", fileName = fiN, filePath = fiP, albumName = abName, albumDesc = abDesc
                });
            }
            string pjson = JsonConvert.SerializeObject(p);

            //return Json(new { result = "success", uploads = uploads, photos = pjson });
            return(Json(pjson));
        }
예제 #6
0
        // GET: albums
        public async Task <ViewResult> Index(string titleFilter, string userFilter, int?page)
        {
            int pageSize  = 6;
            int pageIndex = 1;

            pageIndex = page.HasValue ? Convert.ToInt32(page) : 1;
            IPagedList <album> pagedAlbums = null;
            var albums = await myAlbums.Albums();

            if (!string.IsNullOrEmpty(titleFilter))
            {
                albums = albums.Where(a => a.title.Contains(titleFilter));
            }
            if (!string.IsNullOrEmpty(userFilter))
            {
                albums = albums.Where(a => a.user.name.Contains(userFilter));
            }
            if (albums.Count() < 1)
            {
                var          a  = new album();
                List <album> lA = new List <album>();
                a.id        = 1;
                a.title     = "No Albums found matching entered criteria ";
                a.user      = new user();
                a.user.id   = -1;
                a.user.name = " ";
                lA.Add(a);
                albums = lA.AsQueryable();
            }
            pagedAlbums         = albums.ToPagedList(pageIndex, pageSize);
            ViewBag.TitleFilter = " ";
            ViewBag.UserFilter  = " ";

            return(View(pagedAlbums));
        }
예제 #7
0
        public async Task <ActionResult> Create([Bind(Include = "album_id,singer_id,album_name,album_createdate,album_image,album_view,album_viewed_day,album_viewed_week,album_viewed_month")] album album, HttpPostedFileBase Upload)
        {
            if (ModelState.IsValid)
            {
                var file = Request.Files[0];
                if (file != null && file.ContentLength > 0)
                {
                    string _FileName = Path.GetFileName(file.FileName);
                    string _Ext      = Path.GetExtension(file.FileName);
                    string path      = Path.Combine(Server.MapPath("~/source/images/"), _FileName);
                    album.album_image = "~/source/images/" + _FileName;
                    Upload.SaveAs(path);
                }
                album.album_view         = 1;
                album.album_viewed_day   = 1;
                album.album_viewed_week  = 1;
                album.album_viewed_month = 1;
                db.albums.Add(album);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.singer_id = new SelectList(db.singers, "singer_id", "singer_name", album.singer_id);
            return(View(album));
        }
예제 #8
0
 public ActionResult ChangeAlbumStatus(int Id, bool status)
 {
     try
     {
         if (status == true)
         {
             album xalbum = db.Albums.Find(Id);
             xalbum.status          = true;
             db.Entry(xalbum).State = EntityState.Modified;
             db.SaveChanges();
             var    xuser = Udb.Users.Where(x => x.UserName == xalbum.username).FirstOrDefault();
             string Email = xuser.Email;
             string NAme  = xuser.Name;
             sendmail.AlbumAdded(NAme, Email, xalbum.AlbumName, xalbum.NoOFPics, xalbum.username);
             return(Content(xalbum.AlbumName + " is now Active"));
         }
         else
         {
             album xalbum = db.Albums.Find(Id);
             xalbum.status          = false;
             db.Entry(xalbum).State = EntityState.Modified;
             db.SaveChanges();
             return(Content(xalbum.AlbumName + " has been disactivated"));
         }
     }
     catch (Exception e)
     {
         return(Content("Please try again later"));
     }
 }
예제 #9
0
        public ActionResult Albumthumbs()
        {
            album thisalbum  = (album)Session["thisAlbum"];
            var   thumbsPics = db.Images.Where(z => z.AlbumId == thisalbum.Id).Select(x => x.themb).ToList();

            return(PartialView("Albumthumbs", thumbsPics));
        }
예제 #10
0
        public ActionResult NewSongCreate(AlbumViewModel album)
        {
            //In case the user submits the album without adding a genre, don't assing a genrename.
            if (album.GenreID != 0)
            {
                album.GenreName = db.genres.Where(x => x.id == album.GenreID).First().genreName;
            }
            album al = album.FromModel();

            if (ModelState.IsValid)
            {
                db.albums.Add(al);
                db.SaveChanges();
                //If an artist isn't passed in from the new song page, then redirect to the new album in the song Index.
                if (album.importedArtist == true)
                {
                    return(RedirectToAction("Create", "songs", new { ArtistID = album.ArtistID, AlbumID = al.id }));
                }
                else
                {
                    return(RedirectToAction("AlbumIndex", "songs", new { AlbumID = al.id, ArtistID = album.ArtistID }));
                }
            }

            AlbumViewModel av = new AlbumViewModel();

            av.ArtistNames = new SelectList(db.artists.OrderBy(x => x.artistName), "id", "artistName");
            av.GenreNames  = new SelectList(db.genres.OrderBy(x => x.genreName), "id", "genreName");
            return(View(av));
        }
예제 #11
0
        public static string Description(upnpObject aObject)
        {
            string result = string.Empty;

            if (aObject is audioItem)
            {
                audioItem item = aObject as audioItem;
                result = item.Description;
            }
            else if (aObject is videoItem)
            {
                videoItem item = aObject as videoItem;
                result = item.Description;
            }
            else if (aObject is album)
            {
                album item = aObject as album;
                result = item.Description;
            }
            else if (aObject is playlistContainer)
            {
                playlistContainer item = aObject as playlistContainer;
                result = item.Description;
            }

            // always return a non-null string
            return(NonNullString(result));
        }
예제 #12
0
        public IActionResult Create([Bind("album_code,album_date,album_desc,album_name,created_by,id,rowversion,x_log,x_note,x_status")] album album)
        {
            album.album_type = "V"; //video
            album.x_status   = "Y";
            album.created_by = "Administrator";

            _context.Add(album);
            _context.SaveChanges();

            var pImages = _context.pic_image.Where(p => (p.ref_doc_code == album.album_code) && (p.x_status == "N")).ToList();

            if (pImages != null)
            {
                foreach (var pImage in pImages)
                {
                    pImage.x_status = "Y";
                    _context.Update(pImage);
                }
                _context.SaveChanges();

                var uploads = Path.Combine(_env.WebRootPath, _configuration.GetSection("Paths").GetSection("images_upload").Value);
                uploads = Path.Combine(uploads, album.album_code);

                DirectoryInfo di = new DirectoryInfo(uploads);
                if (di.Exists)
                {
                    var dest = Path.Combine(_env.WebRootPath, _configuration.GetSection("Paths").GetSection("images_album").Value);
                    dest = Path.Combine(dest, album.album_code);
                    Directory.Move(uploads, dest);
                }
            }
            return(RedirectToAction("Index"));
        }
예제 #13
0
        internal List <string> AlbumPreview(string albumName)
        {
            album         thisAlbum = db.Albums.Single(w => w.AlbumName == albumName);
            List <string> imgs      = db.Images.Where(d => d.AlbumId == thisAlbum.Id).Select(f => f.themb).Take(4).ToList();

            return(imgs);
        }
예제 #14
0
        public ActionResult NewAllbum(string XuName)
        {
            album album = new album();

            album.username = XuName;
            return(View(album));
        }
예제 #15
0
        public IActionResult ListAlbumVideo(string albumCode)
        {
            album album  = _context.album.SingleOrDefault(m => m.album_code == albumCode);
            var   abName = album.album_name;
            var   abDesc = album.album_desc;

            var          fiN = ""; var fiP = "";
            List <photo> ph      = new List <photo>();
            var          pImages = _context.pic_image.Where(p => (p.ref_doc_code == albumCode) && (p.x_status == "Y")).ToList();

            if (pImages != null)
            {
                foreach (var pImage in pImages)
                {
                    fiN = pImage.image_code;
                    fiP = Path.Combine(albumCode, fiN);
                    fiP = Path.Combine(_configuration.GetSection("Paths").GetSection("images_album").Value, fiP);
                    if (pImage.image_desc == null)
                    {
                        pImage.image_desc = "";
                    }
                    ph.Add(new photo {
                        albumCode = albumCode, image_code = pImage.image_code, image_desc = pImage.image_desc, fileName = fiN, filePath = fiP, albumName = abName, albumDesc = abDesc
                    });
                }
                string pjson = JsonConvert.SerializeObject(ph);
                return(Json(pjson));
            }
            else
            {
                return(Json(""));
            }
        }
예제 #16
0
        public ActionResult InsertRelatedTables(int count)
        {
            List <MeasurementViewModel> results = new List <MeasurementViewModel>();

            for (int i = 0; i < count; i++)
            {
                List <album>     albums     = new List <album>();
                List <genre>     genres     = new List <genre>();
                List <mediatype> mediaTypes = new List <mediatype>();

                using (ChinookContext context = new ChinookContext())
                {
                    for (int j = 0; j < 100; j++)
                    {
                        album newAlbum = context.albums.Create();
                        newAlbum.ArtistId = 1;
                        newAlbum.Title    = "Inserted Album " + j.ToString();
                        albums.Add(newAlbum);

                        genre newGenre = context.genres.Create();
                        newGenre.Name = "Inserted Genre " + j.ToString();
                        genres.Add(newGenre);

                        mediatype newType = context.mediatypes.Create();
                        newType.Name = "Inserted Media Type";
                        mediaTypes.Add(newType);
                    }
                    ;


                    List <track> tracks = new List <track>();
                    for (int j = 0; j < 100; j++)
                    {
                        track newTrack = context.tracks.Create();
                        newTrack.album        = albums[j];
                        newTrack.Bytes        = 123;
                        newTrack.Composer     = "Inseted Composer";
                        newTrack.genre        = genres[j];
                        newTrack.mediatype    = mediaTypes[j];
                        newTrack.Milliseconds = 123;
                        newTrack.Name         = "Inseted Track " + j.ToString();
                        newTrack.UnitPrice    = 99;

                        tracks.Add(newTrack);
                    }

                    measurement.Start();
                    context.tracks.AddRange(tracks);
                    context.SaveChanges();
                    measurement.Stop();
                    results.Add(new MeasurementViewModel()
                    {
                        memory = measurement.memory, milliseconds = measurement.milliseconds
                    });
                }
            }

            return(View("MeasurementResults", results));
        }
예제 #17
0
 public void deletealbumn(album album)
 {
     if (album == null)
     {
         throw new ArgumentNullException(nameof(album));
     }
     _context.albums.Remove(album);
 }
예제 #18
0
 private void CreateAlbumCallback(album album, object state, FacebookException e)
 {
     fbService.Photos.UploadAsync(album.aid,
                                  "A photo to remember.",
                                  screenShotFormatter.GetScreenShot(),
                                  Enums.FileType.png,
                                  UploadCallback,
                                  null);
 }
예제 #19
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            album album = await db.albums.FindAsync(id);

            db.albums.Remove(album);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #20
0
 public ActionResult Edit([Bind(Include = "ID,name")] album album)
 {
     if (ModelState.IsValid)
     {
         db.saveChange();
         return(RedirectToAction("Index"));
     }
     return(View(album));
 }
예제 #21
0
        public ActionResult DeletImg(string imgName)
        {
            album thisalbum = (album)Session["thisAlbum"];
            Img   ximg      = db.Images.Where(z => z.themb == imgName).FirstOrDefault();

            thisalbum.NoOFPics        = thisalbum.NoOFPics - 1;
            db.Entry(thisalbum).State = EntityState.Modified;
            db.Images.Remove(ximg);
            db.SaveChanges();
            return(RedirectToAction("ManageAlbum", "Admin", new { Id = thisalbum.Id }));
        }
예제 #22
0
        public async Task <IActionResult> Create([Bind("album_code,album_desc,album_name,created_by,album_date,rowversion")] album album)
        {
            album.x_status = "Y";
            //album.album_code = DateTime.Now.ToString("yyMMddhhmmss");
            album.created_by = "Administrator";

            _context.Add(album);
            await _context.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #23
0
 //public JsonResult CityList()
 //{
 //    try
 //    {
 //        var cityList = _cityService.GetCityList().Select(c => new { DisplayText = c.Name, Value = c.Id });
 //        return Json(new { Result = "OK", Options = cityList });
 //    }
 //    catch (Exception ex)
 //    {
 //        return Json(new { Result = "ERROR", Message = ex.Message });
 //    }
 //}
 public JsonResult CreateAlbum(album album)
 {
     try
     {
         _albumService.CreateAlbum(album);
         return Json(new { Result = "OK", Record = album });
     }
     catch (Exception ex)
     {
         return Json(new { Result = "ERROR", Message = ex.Message });
     }
 }
예제 #24
0
        public async Task <ActionResult> Edit([Bind(Include = "album_id,singer_id,album_name,album_createdate,album_image,album_view,album_viewed_day,album_viewed_week,album_viewed_month")] album album)
        {
            if (ModelState.IsValid)
            {
                db.Entry(album).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.singer_id = new SelectList(db.singers, "singer_id", "singer_name", album.singer_id);
            return(View(album));
        }
예제 #25
0
        public int InsertAlbum(album album)
        {
            string sql = "insert into album(creater_id,create_time,album_intro,photo)values(@creater_id,@create_time,@album_intro,@photo)";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@creater_id", album.creater_id),
                new SqlParameter("@create_time", album.create_time),
                new SqlParameter("@album_intro", album.album_intro),
                new SqlParameter("@photo", album.photo),
            };
            return(DBHelper.GetExcuteNonQuery(sql, sp));
        }
예제 #26
0
 public bool addAlbum(album pAlbum)
 {
     bool error = false;
     try
     {
         error = this.dbService.addAlbum(pAlbum);
     }
     catch (Exception e)
     {
         error = true;
     }
     return error;
 }
예제 #27
0
        public ActionResult editarAlbum(album data)
        {
            var repo = new user(Ent);

            if (repo.editarAlbum(data))
            {
                return(RedirectToAction("Index", "Album", new { id = data.idArtista }));
            }
            else
            {
                return(RedirectToAction("editarAlbum", "Album", new { id = data.idArtista }));
            }
        }
예제 #28
0
        public album getAlbumById(int pId)
        {
            album albumById = null;

            try
            {
                albumById = this.dbService.findAlbumById(pId);
            }
            catch (Exception e) {
                albumById = null;
            }
            return(albumById);
        }
예제 #29
0
        public int UpdateAlbum(album album)
        {
            string sql = "update album set creater_id=@creater_id,create_time=@create_time,album_intro=@album_intro,photo_amount=@photo_amount,photo=@photo";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@creater_id", album.creater_id),
                new SqlParameter("@create_time", album.create_time),
                new SqlParameter("@album_intro", album.album_intro),
                new SqlParameter("@photo", album.photo),
            };
            return(DBHelper.GetExcuteNonQuery(sql, sp));
        }
예제 #30
0
 public void addalbumn(Guid bandid, album album)
 {
     if (bandid == Guid.Empty)
     {
         throw new ArgumentNullException(nameof(bandid));
     }
     if (album == null)
     {
         throw new ArgumentNullException(nameof(album));
     }
     album.BandId = bandid;
     _context.albums.Add(album);
 }
예제 #31
0
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            album album = await db.albums.FindAsync(id);

            if (album == null)
            {
                return(HttpNotFound());
            }
            return(View(album));
        }
예제 #32
0
 public album SalvarThumbnail(Stream image, string root, album album)
 {
     if (image.Length > 0 && !string.IsNullOrEmpty(root))
     {
         string srcPath = root + album.ThumbUrl;
         var fi = new FileInfo(srcPath);
         string filename = "AlbumThumb_" + album.Id.ToString(CultureInfo.InvariantCulture) +
                            fi.Extension.ToString(CultureInfo.InvariantCulture);
         string destPath = root + AlbumPath + filename;
         album.ThumbUrl = AlbumUrl + filename;
         _image.CriarThumbnail(image, destPath);
     }
     return album;
 }
예제 #33
0
        public ActionResult Excluir(int id, album collection)
        {
            try
            {
                // TODO: Add delete logic here
                _noticiaService.DeleteNoticia(collection.Id);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
예제 #34
0
        public bool deleteAlbum(album pAlbum)
        {
            bool error = false;

            try
            {
                error = this.dbService.deleteAlbum(pAlbum);
            }
            catch (Exception e)
            {
                error = true;
            }
            return(error);
        }
예제 #35
0
        private void getAlbumList()
        {
            HtmlElement root = wbPostToFanpage.Document.GetElementById("root");

            HtmlElementCollection aColec = root.GetElementsByTagName("a");

            foreach (HtmlElement a in aColec)
            {
                if (a.GetAttribute("href").Contains("/thoitrangella/albums/"))
                {
                    string          html = a.GetAttribute("href");
                    Regex           reg  = new Regex("/albums/([0-9]{6,30})");
                    MatchCollection mc   = reg.Matches(html);

                    album ab = new album(a.InnerText, mc[0].Groups[1].Value.ToString());

                    arrAlbumList.Add(ab);
                }
            }

            string url = "";

            foreach (HtmlElement a in aColec)
            {
                if (a.InnerText != null)
                {
                    if (a.GetAttribute("href").Contains("/photos/albums/") && a.InnerText.Contains("Xem thêm"))
                    {
                        url = a.GetAttribute("href");
                        break;
                    }
                }
            }

            if (url != "")
            {
                wbPostToFanpage.Navigate(url);
                timeCheck.Start();
            }
            else
            {
                if (_step == 1)
                {
                    cbxAlbumList.DataSource    = arrAlbumList;
                    cbxAlbumList.DisplayMember = "name";
                    cbxAlbumList.ValueMember   = "url";
                    MessageBox.Show("Get album list done");
                }
            }
        }
예제 #36
0
        public static List<album> getAlbumData(string url)
        {
            JObject response = JObject.Parse(performWebRequest(url));
            List<album> albums = new List<album>();

            Console.WriteLine("json:" + response);
            foreach (JToken token in response["data"])
            {
                album curAlbum = new album();
                curAlbum.id = token["id"].ToString();
                JEnumerable<JToken> children = token.Children();
                curAlbum.name = token.Value<string>("name") ?? "";
                curAlbum.photos = new List<photo>();
                albums.Add(curAlbum);
            }

            if (response["paging"].Value<string>("next") != null)
                albums.AddRange(getAlbumData(response["paging"]["next"].ToString()));

            return albums;
        }
예제 #37
0
        public ActionResult Incluir(album collection)
        {
            try
            {
                // TODO: Add insert logic here
                var obj = collection;
                if (ModelState.IsValid)
                {

                    obj.Usuario = new usuario { Id = 1 };

                    //album albumObj = _albumServico.Inclui(obj);
                    var postedFile = Request.Files[0];

                    if (postedFile != null && postedFile.InputStream.Length > 0)
                    {
                        obj.ThumbUrl = postedFile.FileName;
                        string imgPath = Server.MapPath("/Content/");
                        Stream foto = postedFile.InputStream;
                        //_albumServico.SalvarThumbnail(foto, imgPath, albumObj);
                        _albumService.SalvarThumbnail(foto, imgPath, obj);

                    }
                    _albumService.CreateAlbum(obj);
                    return RedirectToAction("Index");
                }
                else return View(collection);
            }
            catch
            {
                return View();
            }
        }
예제 #38
0
        //
        // GET: /Conteudo/album/Create
        //[Authorize(Roles="admin")]
        public ActionResult Incluir()
        {
            var obj = new album();

            return View(obj);
        }
예제 #39
0
        public List<cancion> getCancionesDeAlbum(album pAlbum)
        {
            List<cancion> canciones = null;

            try
            {
                cancion[] listaCanciones = dbService.findCancionesByAlbumId(pAlbum.idAlbum);
                if (listaCanciones != null) {
                    canciones = new List<cancion>(listaCanciones);
                }
            }
            catch {
                canciones = null;
            }
            return canciones;
        }
예제 #40
0
 public JsonResult UpdateAlbum(album album)
 {
     try
     {
         _albumService.UpdateAlbum(album);
         return Json(new { Result = "OK" });
     }
     catch (Exception ex)
     {
         return Json(new { Result = "ERROR", Message = ex.Message });
     }
 }
        private void addAlbum(List<string> liste)
        {
            using (var musik = new pcindexEntities())
            {
                List<string> list2 = (from p in musik.albums

                                      select p.Album1

                                        ).ToList();

                liste = listcompair(liste, list2);

                if (liste.Count >= 1)
                {

                    foreach (var onpath in liste)
                    {
                        var entity = new album();
                        entity.Album1 = onpath;

                        musik.albums.Add(entity);
                        musik.SaveChanges();

                    }

                }
            }
        }
예제 #42
0
 public album CreateAlbum(album _album)
 {
     /* Not used UnitOfWork attribute, because this method only calls one repository method and repoository can manage it's connection/transaction. */
     _albumRepository.Insert(_album);
     return _albumRepository.Get(_album.Id);
 }
예제 #43
0
 public void UpdateAlbum(album _album)
 {
     /* Not used UnitOfWork attribute, because this method only calls one repository method and repoository can manage it's connection/transaction. */
     _albumRepository.Update(_album);
 }