コード例 #1
0
        public ActionResult AddConcert()
        {
            AddConcertViewModel model = new AddConcertViewModel();
            model.BandName = Session["band"].ToString();

            return View(model);
        }
コード例 #2
0
        public ActionResult AddConcert(AddConcertViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (model.Cover.PostedFile != null)
                {
                    string trailingPath = model.Cover.PostedFile.FileName;
                    string fullPath = Path.Combine(Server.MapPath("\\Content\\Uploads\\"), trailingPath);

                    model.Cover.RelativePathToSave = fullPath;
                }

                _concertService.AddConcert(model);
            }

            return View(model);
        }