示例#1
0
        // get list of all bands and artists
        public ActionResult Index()
        {
            //call model method getAll() that returns a dataset
            //put the data in a dataset to use it in the view
            DataSet ds = data.GetAll();

            // return the view with the dataset
            return(View(ds));
        }
        // create an band or artist
        public ActionResult Create()
        {
            DataSet ds  = bandArtist.GetAll();
            DataSet ds1 = stage.GetAll();

            // array of the datasets to acces in the view
            DataSet[] dsArray = { ds, ds1 };

            // set error
            var message = TempData["error"];

            if (message != null)
            {
                ViewData["error"] = message;
            }

            return(View(dsArray));
        }