Exemplo n.º 1
0
        public ActionResult Create()
        {
            AlbumBusiness albumBusiness = new AlbumBusiness();

            int   idAlbum = Convert.ToInt32(ConfigurationManager.AppSettings["AlbumUtilizado"].ToString());
            Album album   = albumBusiness.BuscarAlbum(idAlbum);

            ViewBag.Album = album;

            return(View());
        }
Exemplo n.º 2
0
        public ActionResult Edit()
        {
            AlbumBusiness   albumBusiness   = new AlbumBusiness();
            OfertasBusiness ofertasBusiness = new OfertasBusiness();

            int   idAlbum = Convert.ToInt32(ConfigurationManager.AppSettings["AlbumUtilizado"].ToString());
            Album album   = albumBusiness.BuscarAlbum(idAlbum);

            ViewBag.Album = album;

            Ofertas oferta = ofertasBusiness.BuscarOferta(int.Parse(this.RouteData.Values["id"].ToString()));

            return(View(oferta));
        }
        //
        // GET: /VisualizarAlbum/

        public ActionResult Index()
        {
            AlbumBusiness AlbumBusiness = new AlbumBusiness();

            try
            {
                int   idAlbum = Convert.ToInt32(ConfigurationManager.AppSettings["AlbumUtilizado"].ToString());
                Album album   = AlbumBusiness.BuscarAlbum(idAlbum);
                return(View(album));
            }
            catch (BusinessException ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(View());
            }
        }