示例#1
0
        public ActionResult AddAlbum()
        {
            AddAlbumViewModel model = new AddAlbumViewModel();
            model.BandName = Session["band"].ToString();

            return View(model);
        }
示例#2
0
        public ActionResult AddAlbum(AddAlbumViewModel model)
        {
            if (model.Cover.PostedFile != null)
            {
                string trailingPath = model.Cover.PostedFile.FileName;
                string fullPath = Path.Combine(Server.MapPath("\\Content\\Uploads\\"), trailingPath);

                model.Cover.RelativePathToSave = fullPath;
            }

            if (ModelState.IsValid && model.SongsNames.Length > 0)
            {
                bandService.AddAlbum(model);
            }

            return View(model);
        }