コード例 #1
0
        public ActionResult EditarCancion(int Id)
        {
            try
            {
                Songs song = new Songs();
                song = new Front().BuscarCancion(Id);
                Models.Songs sog = new Models.Songs();
                sog.id   = song.id;
                sog.Name = song.Name;

                List <Album> alb = new List <Album>();
                alb = new Front().ListarAlbum();

                List <SelectListItem> items = alb.ConvertAll(al =>
                {
                    return(new SelectListItem()
                    {
                        Text = al.Name,
                        Value = Convert.ToString(al.id),
                        Selected = true
                    });
                });

                ViewBag.items = items;
                return(View(sog));
            }
            catch (Exception e)
            {
                Request.Flash("danger", e.Message);
                throw;
            }
        }
コード例 #2
0
        public ActionResult AgregarCancion()
        {
            try
            {
                List <Album> alb = new List <Album>();
                alb = new Front().ListarAlbum();

                List <SelectListItem> items = alb.ConvertAll(al =>
                {
                    return(new SelectListItem()
                    {
                        Text = al.Name,
                        Value = Convert.ToString(al.id),
                        Selected = false
                    });
                });

                ViewBag.items = items;
                return(View());
            }
            catch (Exception ex)
            {
                Request.Flash("danger", ex.Message);
                throw;
            }
        }
コード例 #3
0
        public ActionResult CrearPedido()
        {
            List <Album> alb = new List <Album>();

            alb = new Front().ListarAlbum();

            List <SelectListItem> items = alb.ConvertAll(al =>
            {
                return(new SelectListItem()
                {
                    Text = al.Name,
                    Value = Convert.ToString(al.id),
                    Selected = false
                });
            });

            ViewBag.items = items;
            return(View());
        }