コード例 #1
0
        public ActionResult Create()
        {
            ExhibitsViewModel vm = new ExhibitsViewModel();

            vm.ArtList = ArtsDb.GetCurrentArts_SelectListItems(db);
            return(View(vm));
        }
コード例 #2
0
        // GET: Exhibits/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Exhibit ex = db.DbExhibit.Find(id);

            if (ex == null)
            {
                return(HttpNotFound());
            }

            ExhibitsViewModel vm = new ExhibitsViewModel
            {
                Name     = ex.Name,
                Date     = ex.Date,
                Location = ex.Location,
                ArtList  = ArtsDb.GetCurrentArts_SelectListItems(db)
            };

            return(View(vm));
        }